TREK Demo project interrupt processing


In TREK demo project(DecaRangeRTLS_ARMCubeMx_2p25) the interrupt callback function cbRxOk is doing the functions like
1. reads the received packet
2. process the received packet
3. Creates the response message packet
4. Initiate the delayed transmit.
Here all these processing are done in the context of ISR. Is it recommended to do all these in ISR? Is there any special reason to do all these processing in ISR? Since we want to reduce the interrupt execution time, we are planning to do some of these processing in while loop. Is it recommended to do these operations in while loop???

Please Help

Shijo Thomas

Hi Shijo,

Yes you are right, in a real implemented system, the ISR time should be kept as short as possible. The SPI operations surely will take quite a long time and should be put in some while(1) loop. A more proper way is to use some global volatile flag from the ISR to enable the process in the while(1) loop, or send signal/events to a thread/task in OS based system.

I think in the TREK project, doing this is because the designer is sure that the system has only one simple thread and is not doing anything else. This demo is more for a POC/tutorial purpose so it is not very well cleaned up.


Hi Weibo,

Thanks for the support.

Shijo Thomas