Problem "Attach to RX Interrupt" example

15 Jun 2017

Hello, I've a problem with the mdot platform. I want to run the "Attach to RX Interrupt" from the handbook example but it doesn't run correctly. Without the line "printf("%c\n", pc.getc());" the program runs OK and the interruption turns on and off the led2 when it recives the character. But with this line the program is stops when the character is recived. this is the code: /media/uploads/SergioValiente/example.c

thanks

15 Jun 2017

I think the mdot is using only mbed-os v5 now? If so, you cannot use printf from your callback ISR. Read the character into a variable and print it from main loop.

Also with mbed-os, you cannot call getc() from ISR when using Serial class. I notice it works ok if using RawSerial, which allows getc from ISR. I think it has something to do with streams.

20 Jun 2017

Yes, mdot use only mbed-os 5. Ok, then the example from the hand book os 5 is incorrect.... With the RawSerial it run ok. Thanks very much