Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hi could someone explain to my what my code hangs when i try to read something from the serial port? My code seems to run fine until i get an interrupt. if i comment the line "pc.putc(pc.getc());", it runs fine.
here is my code
#include "mbed.h" #include "rtos.h" DigitalOut led1(LED1); Serial pc(USBTX,USBRX); void pcrxcallback(void){ pc.putc(pc.getc()); } int main() { pc.baud(115200); pc.attach( &pcrxcallback); while (true) { led1 = !led1; Thread::wait(500); } }