FreeEMS Issues - Firmware
View Issue Details
0000158FirmwareInit & Configpublic2011-06-15 17:472011-07-28 15:06
Fred 
Fred 
normalminorN/A
assignedopen 
 
Future 
Bug
low
0000158: Fix up order of init operations to avoid spurious interrupts
Some interrupts fire at boot time when they shouldn't. Investigate why, and implement a sequence and procedure there that avoids such behaviour.
No tags attached.

Notes
(0000209)
Fred   
2011-06-28 19:52   
Serial for one. Use bit banging and saleae to watch for init time interrupts when the streaming of data is disabled. Check other key interrupts in a similar fashion.
(0000223)
Fred   
2011-07-28 15:02   
(edited on: 2011-07-28 15:04)
I believe that the correct approach to this is to have a function that clears all enabled interrupt flags immediately before running ATOMIC_END()

So:

 - Call init()
 - Disable interrupts with a call to ATOMIC_START() (which is just an asm sei)
 - Configure everything
 - Clear ALL flags
 - Enable interrupts with a call to ATOMIC_END() (which is just an asm cli)
 - Return from init()

I'll be playing with the init code soon anyway, so I may tackle this then.

(0000224)
Fred   
2011-07-28 15:06   
I should first check if it's possible to make it behave by simple adjustments such as adding forgotten clear of particular interrupt flags, for example.