mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
As all NRF52 boards now have OTA support, let's remove the subclass and integrate it into the base class. Signed-off-by: Frieder Schrempf <frieder@fris.de>
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <MeshCore.h>
|
|
#include <Arduino.h>
|
|
#include <helpers/NRF52Board.h>
|
|
|
|
// built-ins
|
|
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
|
|
|
|
#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT
|
|
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
|
|
|
|
#define PIN_VBAT_READ (4)
|
|
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
|
|
|
class TechoBoard : public NRF52BoardDCDC {
|
|
public:
|
|
TechoBoard() : NRF52Board("TECHO_OTA") {}
|
|
void begin();
|
|
uint16_t getBattMilliVolts() override;
|
|
|
|
const char* getManufacturerName() const override {
|
|
return "LilyGo T-Echo";
|
|
}
|
|
|
|
void powerOff() override {
|
|
#ifdef LED_RED
|
|
digitalWrite(LED_RED, HIGH);
|
|
#endif
|
|
#ifdef LED_GREEN
|
|
digitalWrite(LED_GREEN, HIGH);
|
|
#endif
|
|
#ifdef LED_BLUE
|
|
digitalWrite(LED_BLUE, HIGH);
|
|
#endif
|
|
#ifdef DISP_BACKLIGHT
|
|
digitalWrite(DISP_BACKLIGHT, LOW);
|
|
#endif
|
|
#ifdef PIN_PWR_EN
|
|
digitalWrite(PIN_PWR_EN, LOW);
|
|
#endif
|
|
sd_power_system_off();
|
|
}
|
|
};
|