From fa13305d36a807bca9e93a1ff36f55f7e8a9bcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 19 Jun 2019 09:33:08 -0400 Subject: [PATCH] [ion] Implement different Power::configWakeUp for N0100 and N0110 WakeUp::onChargingEvent can't work on N0100 because of a hardware limitation --- ion/src/device/n0100/drivers/power.cpp | 13 +++++++++++++ ion/src/device/n0110/drivers/power.cpp | 7 +++++++ ion/src/device/shared/drivers/power.cpp | 7 ------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ion/src/device/n0100/drivers/power.cpp b/ion/src/device/n0100/drivers/power.cpp index 71da7453d..4f7a5b8fd 100644 --- a/ion/src/device/n0100/drivers/power.cpp +++ b/ion/src/device/n0100/drivers/power.cpp @@ -19,3 +19,16 @@ void standby() { } } + +namespace Ion { +namespace Device { +namespace Power { + +void configWakeUp() { + Device::WakeUp::onOnOffKeyDown(); + Device::WakeUp::onUSBPlugging(); +} + +} +} +} diff --git a/ion/src/device/n0110/drivers/power.cpp b/ion/src/device/n0110/drivers/power.cpp index 22a8aff86..f8f657dea 100644 --- a/ion/src/device/n0110/drivers/power.cpp +++ b/ion/src/device/n0110/drivers/power.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include namespace Ion { @@ -24,6 +25,12 @@ namespace Ion { namespace Device { namespace Power { +void configWakeUp() { + Device::WakeUp::onOnOffKeyDown(); + Device::WakeUp::onUSBPlugging(); + Device::WakeUp::onChargingEvent(); +} + // Public Power methods using namespace Device::Regs; diff --git a/ion/src/device/shared/drivers/power.cpp b/ion/src/device/shared/drivers/power.cpp index 05c82bf3b..dbff399a5 100644 --- a/ion/src/device/shared/drivers/power.cpp +++ b/ion/src/device/shared/drivers/power.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -125,12 +124,6 @@ void __attribute__((noinline)) internalFlashStandby() { Device::Reset::coreWhilePlugged(); } -void configWakeUp() { - Device::WakeUp::onOnOffKeyDown(); - Device::WakeUp::onUSBPlugging(); - Device::WakeUp::onChargingEvent(); -} - void stopConfiguration() { PWR.CR()->setMRUDS(true); // Main regulator in Low Voltage and Flash memory in Deep Sleep mode when the device is in Stop mode PWR.CR()->setLPUDS(true); // Low-power regulator in under-drive mode if LPDS bit is set and Flash memory in power-down when the device is in Stop under-drive mode