I use the "zb_sleep_now()" function in the main loop, which greatly reduces the start current. The device wakes up apparently due to the RTC2 interrupt used by the zigbee stack in sleep mode. When connecting USB, I do not use sleep and, accordingly, I block the call to the "zb_sleep_now()" function. Is it possible to somehow configure the stack so that the "zb_sleep_now()" call is processed in the ZB_COMMON_SIGNAL_CAN_SLEEP callback. If you set the sleep time to 0 ("zb_sleep_set_threshold (0)"), then the device still goes to sleep only after connecting to the network. Or is the solution using "zb_sleep_now()" in the main loop ok?
while(1)
{
nrfx_wdt_channel_feed(m_channel_id);
zboss_main_loop_iteration();
if (m_usb_connected==true)
{
while (app_usbd_event_queue_process())
{
/* Nothing to do */
}
}
else
{
zb_sleep_now();
}
UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
}