Hi all
On my current (maintenance) project, I have come across a couple of interrupt service routines (ISR) which have while loops inside them. An example follows.
Personally I think this is rather dangerous, as if there is a hardware problem, the software will lock up inside the ISR and not permit other RTOS processes to execute. Do you agree, and what would your fix be? I think I would put in an iterator.
Thanks R
void ISR(void) { volatile int status;
status = READ_HARDWARE(); while (status) { /* handle the expected types of interrupt */ if (status & 1) HANDLE_INT_TYPE_1(); if (status & 2) HANDLE_INT_TYPE_2();
/* re-read in case another type occurred simultaneously */ status = READ_HARDWARE();
} }