samples: nrf: system_off: Fix force state usage
The sample cannot spin in an infinity loop because the idle thread will not run and consequently the forced state will not be used. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
ba02864d41
commit
49520eea57
|
@ -93,6 +93,12 @@ void main(void)
|
|||
*/
|
||||
pm_state_force(0u, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
|
||||
|
||||
/* Now we need to go sleep. This will let the idle thread runs and
|
||||
* the pm subsystem will use the forced state. To confirm that the
|
||||
* forced state is used, lets set the same timeout used previously.
|
||||
*/
|
||||
k_sleep(K_SECONDS(SLEEP_S));
|
||||
|
||||
printk("ERROR: System off failed\n");
|
||||
while (true) {
|
||||
/* spin to avoid fall-off behavior */
|
||||
|
|
Loading…
Reference in a new issue