OpenSourceEBike / TSDZ2-Smart-EBike

Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor
GNU General Public License v3.0
251 stars 130 forks source link

timer loop in adc.c #152

Open 4var1 opened 3 years ago

4var1 commented 3 years ago

Another one for when I've finished playing with mspider's changes:

adc calibration timers may not wait as expected if startup times are long:

ui16_counter = TIM3_GetCounter() + 6000; while(TIM3_GetCounter() < ui16_counter) ;

works ok if initial timer values are < (65535-6000) - values above that the loop won't wait at all...