OpenSourceEBike / TSDZ2_wireless

TSDZ2_wireless
36 stars 11 forks source link

Update main.c #70

Closed 4var1 closed 3 years ago

4var1 commented 3 years ago

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!

4var1 commented 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!

4var1 commented 3 years ago

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...

4var1 commented 3 years ago

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.