diff options
-rw-r--r-- | chip/it83xx/system.c | 7 | ||||
-rw-r--r-- | chip/mec1322/system.c | 6 | ||||
-rw-r--r-- | chip/npcx/system.c | 6 | ||||
-rw-r--r-- | chip/nrf51/system.c | 6 | ||||
-rw-r--r-- | chip/stm32/system.c | 7 |
5 files changed, 17 insertions, 15 deletions
diff --git a/chip/it83xx/system.c b/chip/it83xx/system.c index e81d84f423..94ef635f91 100644 --- a/chip/it83xx/system.c +++ b/chip/it83xx/system.c @@ -36,9 +36,6 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds) void system_hibernate(uint32_t seconds, uint32_t microseconds) { - if (board_hibernate) - board_hibernate(); - #ifdef CONFIG_HOSTCMD_PD /* Inform the PD MCU that we are going to hibernate. */ host_command_pd_request_hibernate(); @@ -48,6 +45,10 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) /* Flush console before hibernating */ cflush(); + + if (board_hibernate) + board_hibernate(); + /* chip specific standby mode */ __enter_hibernate(seconds, microseconds); } diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index f7fa770388..c199332f57 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -190,9 +190,6 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) { int i; - if (board_hibernate) - board_hibernate(); - #ifdef CONFIG_HOSTCMD_PD /* Inform the PD MCU that we are going to hibernate. */ host_command_pd_request_hibernate(); @@ -202,6 +199,9 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) cflush(); + if (board_hibernate) + board_hibernate(); + /* Disable interrupts */ interrupt_disable(); for (i = 0; i <= 92; ++i) { diff --git a/chip/npcx/system.c b/chip/npcx/system.c index 55c248d602..6cd805d9f9 100644 --- a/chip/npcx/system.c +++ b/chip/npcx/system.c @@ -476,12 +476,12 @@ void system_enable_hib_interrupt(void) void system_hibernate(uint32_t seconds, uint32_t microseconds) { - if (board_hibernate) - board_hibernate(); - /* Flush console before hibernating */ cflush(); + if (board_hibernate) + board_hibernate(); + #if SUPPORT_HIB /* Add additional hibernate operations here */ __enter_hibernate(seconds, microseconds); diff --git a/chip/nrf51/system.c b/chip/nrf51/system.c index 7c6e6b1347..94c36202e4 100644 --- a/chip/nrf51/system.c +++ b/chip/nrf51/system.c @@ -33,12 +33,12 @@ const char *system_get_chip_revision(void) void system_hibernate(uint32_t seconds, uint32_t microseconds) { - if (board_hibernate) - board_hibernate(); - /* Flush console before hibernating */ cflush(); + if (board_hibernate) + board_hibernate(); + /* chip specific standby mode */ CPRINTS("TODO: implement %s()", __func__); } diff --git a/chip/stm32/system.c b/chip/stm32/system.c index 85b3ad9012..682020b344 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -105,9 +105,6 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds) void system_hibernate(uint32_t seconds, uint32_t microseconds) { - if (board_hibernate) - board_hibernate(); - #ifdef CONFIG_HOSTCMD_PD /* Inform the PD MCU that we are going to hibernate. */ host_command_pd_request_hibernate(); @@ -117,6 +114,10 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) /* Flush console before hibernating */ cflush(); + + if (board_hibernate) + board_hibernate(); + /* chip specific standby mode */ __enter_hibernate(seconds, microseconds); } |