OpenSourceEBike / TSDZ2-Smart-EBike

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

Fixing no power when integrated lights are on #142

Closed NicobobinusX closed 4 years ago

NicobobinusX commented 4 years ago

My attempt to apply the fix suggested by djwlindenaar in "https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/pull/128" to the current V1.0 code. Seems to run smoothly and performance appears equivalent whether lights are on or off.

Compared with another fix of updating line 485 to "if (ui8_g_duty_cycle > 10)", I found this version to feel more responsive.

Other past issues where similar issues are referenced:

  1. https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/139
  2. https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/71
  3. https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/94
  4. https://github.com/OpenSource-EBike-firmware/Color_LCD/issues/104
NicobobinusX commented 4 years ago

Used #128 as a reference, updating variables to be consistent with V1.0 code. #128 code referenced: image

casainho commented 4 years ago

Thank you for your contribution.