2007-03-18 04:08 AM
2011-05-17 12:39 AM
Hi All
I have a question about the ST code used to handle interrupt routines. After having some strange effects when a test program was running - I had found for example that the UART interrupt was sometimes being interrupted by itself, causeing the rx byte to be written twice to the RX buffer - analysed this code. The reason for the problem was obvious because the interrupt routine re-enables interrupts before calling the handling code - thus requiring interrupt user interrupt routines to be capable fo being re-entrant. In a system which assumes that the interrupt mask is cleared when interrupts are called this can cause some nasty problems - after modifying the code the issue in the test system seems to be solved. My question is whether there is a reason for enabling the interrupts in the reference file? Do most users expect interrupts to be enabled when their interrupt routines are called? I am very curious... Regards Mark Butcher www.uTasker.com