I am new to arduino and i have a problem with programming STM32F103C
I want to write an interrupt routine so when ever there was a "+EVT+" it to some thing
but i don't know how to write it.
How can i write any interrupt for serial? so when ever there is a data coming serial i do some thing related to it? how can i get that data from serial?
is there anything in arduino to help me doing this?
The Arduino core for STM32 (like Arduino cores in general) hooks the UART data received interrupt to move characters received by the UART to a serial input buffer. Status of the buffer is then checked by Serial.available(), typically by polling.
The STM32 Arduino core serial character receive interrupt callback routine starts on line 294 of the link provided above. The callback is attached on line 392 under the Arduino Serial.begin() method.
Is this for learning or do you try to solve a problem?
For the latter, I would simply read serial in loop() or in a function called from loop(). Detect when a + is received and start storing in a char array. Read next char or next 3 chars and compare with what you expect. If not, restart the process.