mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
Merge pull request #3002 from entr0p1/feat/nrf52-pwrmgt-v2_3-prep1
nRF52840 Power Management Stage 1 (Boot Lock) - v2.3 preparation work
This commit is contained in:
@@ -26,15 +26,15 @@ struct PowerMgtConfig {
|
||||
#endif
|
||||
|
||||
class NRF52Board : public mesh::MainBoard {
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
void initPowerMgr();
|
||||
#endif
|
||||
private:
|
||||
bool pwrmgt_initialised = false;
|
||||
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
char *ota_name;
|
||||
|
||||
#ifdef NRF52_POWER_MANAGEMENT
|
||||
void pwrmgtInit();
|
||||
uint32_t reset_reason; // RESETREAS register value
|
||||
uint8_t shutdown_reason; // GPREGRET value (why we entered last SYSTEMOFF)
|
||||
uint16_t boot_voltage_mv; // Battery voltage at boot (millivolts)
|
||||
@@ -42,6 +42,7 @@ protected:
|
||||
bool checkBootVoltage(const PowerMgtConfig* config);
|
||||
void enterSystemOff(uint8_t reason);
|
||||
void configureVoltageWake(uint8_t ain_channel, uint8_t refsel);
|
||||
void pwrmgtWakeArmVbus();
|
||||
virtual void initiateShutdown(uint8_t reason);
|
||||
#endif
|
||||
|
||||
@@ -66,6 +67,10 @@ public:
|
||||
uint8_t getShutdownReason() const override { return shutdown_reason; }
|
||||
const char* getResetReasonString(uint32_t reason) override;
|
||||
const char* getShutdownReasonString(uint8_t reason) override;
|
||||
bool isPwrMgtInitialised() const override { return pwrmgt_initialised; }
|
||||
#ifdef PWRMGT_LPCOMP_AIN
|
||||
bool getWakeLpcompSupported() const override { return true; }
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user