Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
MbedConsole.h
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 2 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00015 * MA 02110-1301, USA. 00016 * 00017 */ 00018 00019 #ifndef __MBEDCONSOLE_H 00020 #define __MBEDCONSOLE_H 00021 #include "Console.h" 00022 #include "mbed.h" 00023 #include <stdio.h> 00024 00025 extern Serial pc; 00026 00027 class MbedConsole : public Console 00028 { 00029 public: 00030 virtual char getCh() 00031 { 00032 return pc.getc(); 00033 } 00034 virtual void putCh(char ch) 00035 { 00036 pc.printf("%c", ch); 00037 } 00038 virtual void puts(char *str) 00039 { 00040 pc.printf("%s", str); 00041 } 00042 virtual void printf(char *fmt, ...); 00043 virtual int available(); 00044 }; 00045 00046 #endif 00047
Generated on Thu Aug 4 2022 08:49:39 by
1.7.2