diff --git a/code/nrf-connect/samples/zigbee/src/main.c b/code/nrf-connect/samples/zigbee/src/main.c index 8b8537b..16ee57b 100644 --- a/code/nrf-connect/samples/zigbee/src/main.c +++ b/code/nrf-connect/samples/zigbee/src/main.c @@ -36,8 +36,6 @@ static void led_flashing_cb(struct k_timer *timer) { K_TIMER_DEFINE(led_flashing_timer, led_flashing_cb, /*stop_fn=*/NULL); -extern struct k_timer restart_timer; - ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST( identify_attr_list, &dev_ctx.identify_attr.identify_time); @@ -135,12 +133,12 @@ void zboss_signal_handler(zb_bufid_t bufid) { LOG_DBG("Steering successful. Status: %d", status); prst_led_flash(/*times=*/3); k_timer_stop(&led_flashing_timer); - k_timer_stop(&restart_timer); + prst_restart_watchdog_stop(); prst_led_off(); } else { LOG_DBG("Steering failed. Status: %d", status); prst_led_flash(7); - k_timer_start(&restart_timer, K_SECONDS(PRST_ZB_RESET_TIMEOUT), K_MSEC(0)); + prst_restart_watchdog_start(); k_timer_stop(&led_flashing_timer); // Power saving prst_led_off(); } diff --git a/code/nrf-connect/samples/zigbee/src/restart_handler.c b/code/nrf-connect/samples/zigbee/src/restart_handler.c index 85c4c6a..b864f69 100644 --- a/code/nrf-connect/samples/zigbee/src/restart_handler.c +++ b/code/nrf-connect/samples/zigbee/src/restart_handler.c @@ -14,10 +14,10 @@ static void restart_network_steering_cb(struct k_timer *timer) { K_TIMER_DEFINE(restart_timer, restart_network_steering_cb, NULL); -static void prst_restart_watchdog_start() { - k_timer_start(&restart_timer, K_SECONDS(PRST_ZB_RESET_TIMEOUT), K_MSEC(0)); +void prst_restart_watchdog_start() { + k_timer_start(&restart_timer, K_SECONDS(CONFIG_PRST_ZB_RESTART_WATCHDOG_TIMEOUT_SEC), K_MSEC(0)); } -static void prst_restart_watchdog_stop() { +void prst_restart_watchdog_stop() { k_timer_stop(&restart_timer); } diff --git a/code/nrf-connect/samples/zigbee/src/restart_handler.h b/code/nrf-connect/samples/zigbee/src/restart_handler.h index 9c4e6a5..5c3a8ad 100644 --- a/code/nrf-connect/samples/zigbee/src/restart_handler.h +++ b/code/nrf-connect/samples/zigbee/src/restart_handler.h @@ -1,9 +1,7 @@ #ifndef _PRST_ZB_RESTART_HANDLER_H_ #define _PRST_ZB_RESTART_HANDLER_H_ -static const int PRST_ZB_RESET_TIMEOUT = 5 * 60; - -static void prst_restart_watchdog_start; -static void prst_restart_watchdog_stop; +void prst_restart_watchdog_start(); +void prst_restart_watchdog_stop(); #endif // _PRST_ZB_RESTART_HANDLER_H_