Hi,
Is it possible to be notified when the device is entering/exiting idle? All I can see is that idle thread calling k_cpu_idle which doesn't appear to have any hooks? I see you can enable CONFIG_SYS_POWER_DEEP_SLEEP_STATES, and CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1 which does call functions when exiting and entering, but that calls nrf_regulators_system_off(NRF_REGULATORS) which is not ideal as the only wake up sources are then external.
Essentially I want to know the system is entering idle so I can power down any external devices that aren't needed, and power them back up when exiting idle.
The only thing I can think of doing is modifying the power.c file in zephyr\soc\arm\nordic_nrf\nrf91\power.c and adding a new power state to sys_set_power_state(), which just calls k_cpu_idle(). Is there a better way to do this? I'd prefer not to have to change that any library files...
Kind regards,
Thomas