power: policy: cc13x2_cc26x2: guard references to sleep states

Use of macros such as SYS_POWER_STATE_SLEEP_2 needs to be guarded by
making sure CONFIG_SYS_POWER_SLEEP_STATES is defined.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This commit is contained in:
Vincent Wan 2020-03-27 20:57:15 -07:00 committed by Kumar Gala
commit 8cf74c8e02

View file

@ -143,5 +143,9 @@ enum power_states sys_pm_policy_next_state(s32_t ticks)
__weak bool sys_pm_policy_low_power_devices(enum power_states pm_state) __weak bool sys_pm_policy_low_power_devices(enum power_states pm_state)
{ {
#ifdef CONFIG_SYS_POWER_SLEEP_STATES
return (pm_state == SYS_POWER_STATE_SLEEP_2); return (pm_state == SYS_POWER_STATE_SLEEP_2);
#else
return false;
#endif
} }