@startuml

:zboss_main_loop_iteration();

if (scheduler_queue_empty?) then (yes)
if (inactivity_time > sleep_threshold) then (yes)
:zb_schedule(ZB_COMMON_SIGNAL_CAN_SLEEP);
else (no)
endif
else (no)
endif

stop

@enduml