FreeEMS Issues - Firmware
View Issue Details
0000293FirmwareDecoderspublic2011-10-10 11:092011-10-10 14:17
Fred 
Fred 
normalminorN/A
assignedopen 
0.2.0-SNAPSHOT 
Future 
Improvement
low
0000293: For 2 Edge Decoders Check Consistency Of Observed Pin State
IE, make sure that each alternate interrupt is an alternate interrupt. I realised last night that it is possible that a noise pulse could trigger the interrupt to occur and go away again before the ISR samples the pin state to determine rising/falling edge. Then I realised that if we keep a history of this, we can check to ensure that our edge is correct.

For single edge decoders a similar thing can be done in terms of ensuring that it is always the same and correct. If not, it's noise, lose sync with a specific error.

Preferably add these as part of the decoder interface common code base.
No tags attached.

Notes
(0000362)
Fred   
2011-10-10 14:17   
Another way to do this would be to check for the interrupt flag telling us that we're about to run again and clear it, and lose sync, right there and then.

This way would also protect from excess RPM, and give something in the log saying "interrupt arrived before we were done = noise or too high RPM for current code efficiency and pattern in use" - I like this solution.