Fixed api of restart watchdog.
This commit is contained in:
parent
ce748c4759
commit
3aa33cdd89
3 changed files with 7 additions and 11 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue