[ion] Implement different Power::configWakeUp for N0100 and N0110

WakeUp::onChargingEvent can't work on N0100 because of a hardware
limitation
This commit is contained in:
Émilie Feral
2019-06-19 09:33:08 -04:00
parent bd5d94ba6c
commit fa13305d36
3 changed files with 20 additions and 7 deletions

View File

@@ -19,3 +19,16 @@ void standby() {
}
}
namespace Ion {
namespace Device {
namespace Power {
void configWakeUp() {
Device::WakeUp::onOnOffKeyDown();
Device::WakeUp::onUSBPlugging();
}
}
}
}

View File

@@ -1,6 +1,7 @@
#include <drivers/board.h>
#include <drivers/power.h>
#include <drivers/keyboard.h>
#include <drivers/wakeup.h>
#include <regs/regs.h>
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;

View File

@@ -10,7 +10,6 @@
#include <drivers/power.h>
#include <drivers/usb.h>
#include <drivers/reset.h>
#include <drivers/wakeup.h>
#include <regs/regs.h>
#include <regs/config/pwr.h>
#include <regs/config/rcc.h>
@@ -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