mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Use common NRF52 begin() and deduplicate() startup reason init
Use a common begin() method that can be called from derived classes to contain the shared initialization code. Signed-off-by: Frieder Schrempf <frieder@fris.de>
This commit is contained in:
parent
87b0e432bb
commit
93d1560d14
41 changed files with 26 additions and 128 deletions
|
|
@ -20,8 +20,7 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason)
|
|||
}
|
||||
|
||||
void HeltecMeshPocket::begin() {
|
||||
// for future use, sub-classes SHOULD call this from their begin()
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
NRF52Board::begin();
|
||||
Serial.begin(115200);
|
||||
pinMode(PIN_VBAT_READ, INPUT);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,14 +10,8 @@
|
|||
#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range
|
||||
|
||||
class HeltecMeshPocket : public NRF52Board {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
|
||||
public:
|
||||
void begin();
|
||||
uint8_t getStartupReason() const override { return startup_reason; }
|
||||
|
||||
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
int adcvalue = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue