Frans-Willem / TSDZ2-Clean-EBike

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

[FEATURE] Watchdog & Uart watchdog #6

Open Frans-Willem opened 5 years ago

Frans-Willem commented 5 years ago

There's some code in watchdog.c, but it's not actually called.

On top of that, seeing as the display is vital to the motor, I think we should add a timeout/watchdog that kills the motor if we're not receiving anything from the display for more than 500ms or so.

benno90 commented 4 years ago

To shut down the controller if the connection to the display is lost makes sense to me.

Regarding the watchdog: I have noticed that the reset is done in the motor pwm interrupt. Lets say the code hangs somewhere in an endless loop, the interrupt will be executed anyway at fixed time intervals and thus reset the watchdog. As I have experienced a situation where the motor would not stop anymore, I think the watchdog should be activated and the reset should be moved to the main loop.

shadow974 commented 4 years ago

Hm, we already got this discussion @ endless-sphere long time ago, but i want to re-think it one more time. Why is the display essential to the function of the motor?