OpenSourceEBike / TSDZ2_wireless

TSDZ2_wireless
35 stars 11 forks source link

release candidate #90

Closed rananna closed 3 years ago

rananna commented 3 years ago

@casino, I have incorporated the power improvements in this version. Checked it out for all modes of operation, and it is working well.

However, there appears to be a quite random issue that I cannot nail down. Very occasionally, a button press will be missed. by missed, I mean that the button handler code is NOT called when the button is pressed. you can see this by the led not lighting. This seems to be related to the frequency of interrupts, that is is you press the button very quickly, the board will enter a state where no button presses are detected for some time. (like seconds in duration!!) is there some kind of interrupt buffer overflow happening? Anyway, please give this a try and let me know if you ever see the same issue, or if you have any ideas why this might be happening. Edit: I am not using the potentially blocking power saving nrf_delay, so it isn't that.

casainho commented 3 years ago

Maybe the issue is about code on interrupts... can you try to not use the delays inside the interrupts and test again? see that you could set / clear flags / machine state on interrupts and then processing on the main loop, as main loop will also always be executed when interrupts fire.