cancel
Showing results for 
Search instead for 
Did you mean: 

UART data loss

LOnGr.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
gbm
Lead III

Whether it is good or wrong depends on the details of "processing". There is nothing wrong with doing everything only in ISRs and not having the "main loop" at all (putting the processor to sleep instead). There is no general rule for this.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

View solution in original post

4 REPLIES 4
gbm
Lead III

How could anyone help without seeing a single line of code? You can do the processing in an interrupt routine or in main. In both cases you may do it right or wrong.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
LOnGr.1
Associate III

I said that it was working fine in the interrupt, my question was about the idea of processing data in the interrupt handler, not the structure of processing. My discussion with the engineer made me think that its wrong to process the incoming data in the interrupt

Generally, ISRs should be kept as short as possible so that they interfere (delay execution) with other code (including other ISRs) as little as possible.

Individual exceptions may exist, but you should be able to argue about your design choices.

JW

gbm
Lead III

Whether it is good or wrong depends on the details of "processing". There is nothing wrong with doing everything only in ISRs and not having the "main loop" at all (putting the processor to sleep instead). There is no general rule for this.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice