mirror of
https://github.com/Dasharo/zephyr.git
synced 2026-03-06 14:57:20 -08:00
power: Add an assert for an unexpected condition
Exit latency time should never be greater than the residency time. Just add an assert in case the policy does not properly handle it. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
committed by
Anas Nashif
parent
fba5779a8d
commit
11ac18abc2
@@ -182,6 +182,14 @@ enum pm_state pm_system_suspend(int32_t ticks)
|
||||
post_ops_done = 0;
|
||||
|
||||
if (ticks != K_TICKS_FOREVER) {
|
||||
/*
|
||||
* Just a sanity check in case the policy manager does not
|
||||
* handle this error condition properly.
|
||||
*/
|
||||
__ASSERT(z_power_state.min_residency_us >=
|
||||
z_power_state.exit_latency_us,
|
||||
"min_residency_us < exit_latency_us");
|
||||
|
||||
/*
|
||||
* We need to set the timer to interrupt a little bit early to
|
||||
* accommodate the time required by the CPU to fully wake up.
|
||||
|
||||
Reference in New Issue
Block a user