Added restart handler module.
This commit is contained in:
parent
69c0ed3694
commit
727138415e
3 changed files with 22 additions and 1 deletions
|
|
@ -16,8 +16,9 @@ target_sources(app PRIVATE
|
|||
src/factory_reset.c
|
||||
src/prst_zb_attrs.c
|
||||
src/prst_zb_soil_moisture_defs.c
|
||||
src/restart_handler.c
|
||||
)
|
||||
|
||||
add_subdirectory(../../prstlib prstlib)
|
||||
target_include_directories(app PRIVATE ../../prstlib/include)
|
||||
target_link_libraries(app PUBLIC prstlib)
|
||||
target_link_libraries(app PUBLIC prstlib)
|
||||
|
|
|
|||
14
code/nrf-connect/samples/zigbee/src/restart_handler.c
Normal file
14
code/nrf-connect/samples/zigbee/src/restart_handler.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zigbee/zigbee_app_utils.h>
|
||||
|
||||
#include "restart_handler.h"
|
||||
|
||||
LOG_MODULE_REGISTER(restart_handler, CONFIG_LOG_DEFAULT_LEVEL);
|
||||
|
||||
static void restart_network_steering_cb(struct k_timer *timer) {
|
||||
LOG_DBG("Restart handler expired. Restarting network steering.");
|
||||
user_input_indicate();
|
||||
}
|
||||
|
||||
K_TIMER_DEFINE(restart_timer, restart_network_steering_cb, NULL);
|
||||
6
code/nrf-connect/samples/zigbee/src/restart_handler.h
Normal file
6
code/nrf-connect/samples/zigbee/src/restart_handler.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef _PRST_ZB_RESTART_HANDLER_H_
|
||||
#define _PRST_ZB_RESTART_HANDLER_H_
|
||||
|
||||
static const int PRST_ZB_RESET_TIMEOUT = 5 * 60;
|
||||
|
||||
#endif // _PRST_ZB_RESTART_HANDLER_H_
|
||||
Loading…
Add table
Reference in a new issue