From 27aa35bf4008c9bbd52a945d7b2944ec27dffdd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 11 Jun 2019 14:23:44 -0400 Subject: [PATCH] [ion] Don't forget to shutdown External Flash when sleeping/stoping/standingby --- ion/src/device/bench/command/sleep.cpp | 1 + ion/src/device/bench/command/standby.cpp | 4 +++- ion/src/device/bench/command/stop.cpp | 1 + ion/src/device/n0100/drivers/power.cpp | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ion/src/device/bench/command/sleep.cpp b/ion/src/device/bench/command/sleep.cpp index 825d6e4d6..674659449 100644 --- a/ion/src/device/bench/command/sleep.cpp +++ b/ion/src/device/bench/command/sleep.cpp @@ -17,6 +17,7 @@ void Sleep(const char * input) { Device::Power::sleepConfiguration(); Device::Board::shutdownPeripherals(); Device::WakeUp::onUSBPlugging(); + Device::ExternalFlash::shutdown(); Device::Board::shutdownClocks(); Device::Power::enterLowPowerMode(); Device::Board::setStandardFrequency(Device::Board::Frequency::High); diff --git a/ion/src/device/bench/command/standby.cpp b/ion/src/device/bench/command/standby.cpp index 6dd975c2d..c16473da1 100644 --- a/ion/src/device/bench/command/standby.cpp +++ b/ion/src/device/bench/command/standby.cpp @@ -15,7 +15,9 @@ void Standby(const char * input) { } reply(sOK); Device::Power::standbyConfiguration(); - Device::Board::shutdown(); + Device::Board::shutdownPeripherals(); + Device::ExternalFlash::shutdown(); + Device::Board::shutdownClocks(); Device::Power::enterLowPowerMode(); assert(false); } diff --git a/ion/src/device/bench/command/stop.cpp b/ion/src/device/bench/command/stop.cpp index 71067dc43..635615f2c 100644 --- a/ion/src/device/bench/command/stop.cpp +++ b/ion/src/device/bench/command/stop.cpp @@ -17,6 +17,7 @@ void Stop(const char * input) { Device::Power::stopConfiguration(); Device::Board::shutdownPeripherals(); Device::WakeUp::onUSBPlugging(); + Device::ExternalFlash::shutdown(); Device::Board::shutdownClocks(); Device::Power::enterLowPowerMode(); Device::Board::initClocks(); diff --git a/ion/src/device/n0100/drivers/power.cpp b/ion/src/device/n0100/drivers/power.cpp index 8d95f0fa2..3e63dea75 100644 --- a/ion/src/device/n0100/drivers/power.cpp +++ b/ion/src/device/n0100/drivers/power.cpp @@ -2,6 +2,7 @@ #include #include #include +#include namespace Ion { namespace Power { @@ -11,6 +12,7 @@ void standby() { Device::Power::stopConfiguration(); Device::Board::shutdownPeripherals(); Device::WakeUp::onOnOffKeyDown(); + Device::ExternalFlash::shutdown(); Device::Board::shutdownClocks(); Device::Power::enterLowPowerMode(); Device::Reset::core();