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.
Dependents: projecte_v4_rtos ProjecteRobotFinal
RawSerialPc.cpp
00001 #include "RawSerialPc.h" 00002 #include "mbed.h" 00003 00004 00005 RawSerialPc::RawSerialPc(PinName tx, PinName rx) : RawSerial(tx, rx){ 00006 baud(115200); 00007 }; 00008 00009 void RawSerialPc::enviaString(char* str){ 00010 int i = 0; 00011 while((i < longString) && (str[i] != '\0')) { 00012 putc(str[i]); 00013 i++; 00014 } 00015 putc(10); 00016 }; 00017 00018 bool RawSerialPc::llegirString(char* str){ 00019 if(readable()){ 00020 int i= 0; 00021 str[i] = getc(); 00022 while((i < longString) && (str[i] != 13)) { 00023 if (str[i] != '@') 00024 i++; 00025 str[i] = getc(); 00026 } 00027 str[i] = '\0'; 00028 return true; 00029 } 00030 return false; 00031 };
Generated on Tue Jul 12 2022 17:44:56 by
1.7.2