Closed 4var1 closed 3 years ago
Probably should have ui32_time_now = get_time_base_counter_1ms(); before the DFU if statement too - otherwise it might be slightly jittery. Not that it really matters for a 1s timer!
I also corrected the button constant I had to change to get the buttons to work. All works ok now - and I no longer see the assist level change on my test rig (I'd managed to reproduce) - haven't yet ridden with these changes...
Ah - I do see the assist change still - just not very often...
Ok - last update for today I think - I've updated button.c so quick 'presses' are filtered out. Need to be pressed for at least one cycle (50ms) - now I can't get the assist problem to show at all.
Uses method similar to motor controller - using ms counter not ticks. I haven't so far used the DFU functionality - so the 1s loop hasn't been tested. The main 50ms loop now runs 20-21 times a second vs 150-200 before!