Skip to content

Commit

Permalink
Fix WDT reset when trying to terminate a NULL pointer LED thread
Browse files Browse the repository at this point in the history
Fix: Fix a (Watchdog Timer) reboot when reinstalling Refloat (in case
 LEDs are disabled)
  • Loading branch information
lukash committed Apr 13, 2024
1 parent d00981c commit ce277c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions refloat/refloat/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2670,8 +2670,12 @@ static void stop(void *arg) {
VESC_IF->imu_set_read_callback(NULL);
VESC_IF->set_app_data_handler(NULL);
VESC_IF->conf_custom_clear_configs();
VESC_IF->request_terminate(d->led_thread);
VESC_IF->request_terminate(d->main_thread);
if (d->led_thread) {
VESC_IF->request_terminate(d->led_thread);
}
if (d->main_thread) {
VESC_IF->request_terminate(d->main_thread);
}
log_msg("Terminating.");
leds_destroy(&d->leds);
VESC_IF->free(d);
Expand Down

0 comments on commit ce277c7

Please sign in to comment.