mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 15:20:39 +01:00
[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:
@@ -19,3 +19,16 @@ void standby() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
namespace Power {
|
||||
|
||||
void configWakeUp() {
|
||||
Device::WakeUp::onOnOffKeyDown();
|
||||
Device::WakeUp::onUSBPlugging();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user