mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
stm32f: stm32f0: guard hibernate function with CONFIG_HIBERNATE
If CONFIG_HIBERNATE is explicitly undefined for a platform, we shouldn't try to hibernate. BUG=chrome-os-partner:32727 TEST=None BRANCH=None Change-Id: Id0f93a3a694065478373e364d82589ff08e7d980 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/222013 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
1eec1e3cd4
commit
7f55a51ced
@@ -161,6 +161,7 @@ static void config_hispeed_clock(void)
|
||||
;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HIBERNATE
|
||||
void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
{
|
||||
if (seconds || microseconds)
|
||||
@@ -180,6 +181,7 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOW_POWER_IDLE
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ static void config_hispeed_clock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HIBERNATE
|
||||
void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
{
|
||||
uint32_t rtc, rtcss;
|
||||
@@ -281,6 +282,7 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOW_POWER_IDLE
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ static int bkpdata_write(enum bkpdata_index index, uint16_t value)
|
||||
|
||||
void __no_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
{
|
||||
#ifdef CONFIG_COMMON_RUNTIME
|
||||
/*
|
||||
* Hibernate not implemented on this platform.
|
||||
*
|
||||
@@ -88,6 +89,7 @@ void __no_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
cprints(CC_SYSTEM, "hibernate not supported, so rebooting");
|
||||
cflush();
|
||||
system_reset(SYSTEM_RESET_HARD);
|
||||
#endif
|
||||
}
|
||||
|
||||
void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
|
||||
|
||||
Reference in New Issue
Block a user