summaryrefslogtreecommitdiff
path: root/chip/stm32/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/system.c')
-rw-r--r--chip/stm32/system.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/chip/stm32/system.c b/chip/stm32/system.c
index 5e486ea20b..b1daf1ce4c 100644
--- a/chip/stm32/system.c
+++ b/chip/stm32/system.c
@@ -9,6 +9,7 @@
#include "console.h"
#include "cpu.h"
#include "flash.h"
+#include "host_command.h"
#include "registers.h"
#include "panic.h"
#include "system.h"
@@ -104,6 +105,13 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
void system_hibernate(uint32_t seconds, uint32_t microseconds)
{
+#ifdef CONFIG_HOSTCMD_PD
+ /* Inform the PD MCU that we are going to hibernate. */
+ host_command_pd_request_hibernate();
+ /* Wait to ensure exchange with PD before hibernating. */
+ msleep(100);
+#endif
+
/* Flush console before hibernating */
cflush();
/* chip specific standby mode */