This reverts commit5cc8ca59a3. Revert "Sync Wio lr1110 refresh with master (#4251)" This reverts commitd97e6b86b8. Revert "update SD_FLASH_SIZE to 0x27000 (#4232)" This reverts commit2df8093fef.
34 lines
749 B
C++
34 lines
749 B
C++
#pragma once
|
|
#include "configuration.h"
|
|
|
|
#include "meshtastic/powermon.pb.h"
|
|
|
|
#ifndef MESHTASTIC_EXCLUDE_POWERMON
|
|
#define USE_POWERMON // FIXME turn this only for certain builds
|
|
#endif
|
|
|
|
/**
|
|
* The singleton class for monitoring power consumption of device
|
|
* subsystems/modes.
|
|
*
|
|
* For more information see the PowerMon docs.
|
|
*/
|
|
class PowerMon
|
|
{
|
|
uint64_t states = 0UL;
|
|
|
|
public:
|
|
PowerMon() {}
|
|
|
|
// Mark entry/exit of a power consuming state
|
|
void setState(_meshtastic_PowerMon_State state, const char *reason = "");
|
|
void clearState(_meshtastic_PowerMon_State state, const char *reason = "");
|
|
|
|
private:
|
|
// Emit the coded log message
|
|
void emitLog(const char *reason);
|
|
};
|
|
|
|
extern PowerMon *powerMon;
|
|
|
|
void powerMonInit(); |