Skip to content
Open
2 changes: 1 addition & 1 deletion src/helpers/NRF52Board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ float NRF52Board::getMCUTemperature() {
return temp * 0.25f; // Convert to *C
}

bool NRF52BoardOTA::startOTAUpdate(const char *id, char reply[]) {
bool NRF52Board::startOTAUpdate(const char *id, char reply[]) {
// Config the peripheral connection with maximum bandwidth
// more SRAM required by SoftDevice
// Note: All config***() function must be called before begin()
Expand Down
12 changes: 3 additions & 9 deletions src/helpers/NRF52Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
class NRF52Board : public mesh::MainBoard {
protected:
uint8_t startup_reason;
char *ota_name;

public:
NRF52Board(char *otaname) : ota_name(name) {}
virtual void begin();
virtual uint8_t getStartupReason() const override { return startup_reason; }
virtual float getMCUTemperature() override;
virtual void reboot() override { NVIC_SystemReset(); }
virtual bool startOTAUpdate(const char *id, char reply[]) override;
};

/*
Expand All @@ -27,13 +30,4 @@ class NRF52BoardDCDC : virtual public NRF52Board {
public:
virtual void begin() override;
};

class NRF52BoardOTA : virtual public NRF52Board {
private:
char *ota_name;

public:
NRF52BoardOTA(char *name) : ota_name(name) {}
virtual bool startOTAUpdate(const char *id, char reply[]) override;
};
#endif
4 changes: 2 additions & 2 deletions variants/heltec_mesh_solar/MeshSolarBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#define SX126X_DIO2_AS_RF_SWITCH true
#define SX126X_DIO3_TCXO_VOLTAGE 1.8

class MeshSolarBoard : public NRF52BoardOTA {
class MeshSolarBoard : public NRF52BoardDCDC {
public:
MeshSolarBoard() : NRF52BoardOTA("MESH_SOLAR_OTA") {}
MeshSolarBoard() : NRF52Board("MESH_SOLAR_OTA") {}
void begin();

uint16_t getBattMilliVolts() override {
Expand Down
4 changes: 2 additions & 2 deletions variants/heltec_t114/T114Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#define PIN_BAT_CTL 6
#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range

class T114Board : public NRF52BoardOTA {
class T114Board : public NRF52BoardDCDC {
public:
T114Board() : NRF52BoardOTA("T114_OTA") {}
T114Board() : NRF52Board("T114_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
4 changes: 2 additions & 2 deletions variants/ikoka_handheld_nrf/IkokaNrf52Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#ifdef IKOKA_NRF52

class IkokaNrf52Board : public NRF52BoardOTA {
class IkokaNrf52Board : public NRF52BoardDCDC {
public:
IkokaNrf52Board() : NRF52BoardOTA("XIAO_NRF52_OTA") {}
IkokaNrf52Board() : NRF52Board("XIAO_NRF52_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
4 changes: 2 additions & 2 deletions variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#ifdef XIAO_NRF52

class IkokaNanoNRFBoard : public NRF52BoardOTA {
class IkokaNanoNRFBoard : public NRF52BoardDCDC {
public:
IkokaNanoNRFBoard() : NRF52BoardOTA("XIAO_NRF52_OTA") {}
IkokaNanoNRFBoard() : NRF52Board("XIAO_NRF52_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
4 changes: 2 additions & 2 deletions variants/ikoka_stick_nrf/IkokaStickNRFBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#ifdef XIAO_NRF52

class IkokaStickNRFBoard : public NRF52BoardOTA {
class IkokaStickNRFBoard : public NRF52BoardDCDC {
public:
IkokaStickNRFBoard() : NRF52BoardOTA("XIAO_NRF52_OTA") {}
IkokaStickNRFBoard() : NRF52Board("XIAO_NRF52_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
4 changes: 2 additions & 2 deletions variants/keepteen_lt1/KeepteenLT1Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#include <Arduino.h>
#include <helpers/NRF52Board.h>

class KeepteenLT1Board : public NRF52BoardOTA {
class KeepteenLT1Board : public NRF52Board {
protected:
uint8_t btn_prev_state;

public:
KeepteenLT1Board() : NRF52BoardOTA("KeepteenLT1_OTA") {}
KeepteenLT1Board() : NRF52Board("KeepteenLT1_OTA") {}
void begin();

#define BATTERY_SAMPLES 8
Expand Down
4 changes: 2 additions & 2 deletions variants/lilygo_techo/TechoBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)

class TechoBoard : public NRF52BoardOTA {
class TechoBoard : public NRF52BoardDCDC {
public:
TechoBoard() : NRF52BoardOTA("TECHO_OTA") {}
TechoBoard() : NRF52Board("TECHO_OTA") {}
void begin();
uint16_t getBattMilliVolts() override;

Expand Down
4 changes: 2 additions & 2 deletions variants/lilygo_techo_lite/TechoBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)

class TechoBoard : public NRF52BoardOTA {
class TechoBoard : public NRF52BoardDCDC {
public:
TechoBoard() : NRF52BoardOTA("TECHO_OTA") {}
TechoBoard() : NRF52Board("TECHO_OTA") {}
void begin();
uint16_t getBattMilliVolts() override;

Expand Down
4 changes: 2 additions & 2 deletions variants/mesh_pocket/MeshPocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#define PIN_BAT_CTL 34
#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range

class HeltecMeshPocket : public NRF52BoardOTA {
class HeltecMeshPocket : public NRF52BoardDCDC {
public:
HeltecMeshPocket() : NRF52BoardOTA("MESH_POCKET_OTA") {}
HeltecMeshPocket() : NRF52Board("MESH_POCKET_OTA") {}
void begin();

uint16_t getBattMilliVolts() override {
Expand Down
4 changes: 2 additions & 2 deletions variants/minewsemi_me25ls01/MinewsemiME25LS01Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#define PIN_VBAT_READ BATTERY_PIN
#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking

class MinewsemiME25LS01Board : public NRF52BoardOTA {
class MinewsemiME25LS01Board : public NRF52BoardDCDC {
protected:
uint8_t btn_prev_state;

public:
MinewsemiME25LS01Board() : NRF52BoardOTA("Minewsemi_OTA") {}
MinewsemiME25LS01Board() : NRF52Board("Minewsemi_OTA") {}
void begin();

#define BATTERY_SAMPLES 8
Expand Down
1 change: 1 addition & 0 deletions variants/nano_g2_ultra/nano-g2.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

class NanoG2Ultra : public NRF52Board {
public:
NanoG2Ultra() : NRF52Board("Nano_G2_OTA") {}
void begin();
uint16_t getBattMilliVolts() override;
bool startOTAUpdate(const char *id, char reply[]) override;
Expand Down
4 changes: 2 additions & 2 deletions variants/promicro/PromicroBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#define PIN_VBAT_READ 17
#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking

class PromicroBoard : public NRF52BoardOTA {
class PromicroBoard : public NRF52BoardDCDC {
protected:
uint8_t btn_prev_state;
float adc_mult = ADC_MULTIPLIER;

public:
PromicroBoard() : NRF52BoardOTA("ProMicro_OTA") {}
PromicroBoard() : NRF52Board("ProMicro_OTA") {}
void begin();

#define BATTERY_SAMPLES 8
Expand Down
4 changes: 2 additions & 2 deletions variants/rak4631/RAK4631Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#define PIN_VBAT_READ 5
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)

class RAK4631Board : public NRF52BoardDCDC, public NRF52BoardOTA {
class RAK4631Board : public NRF52BoardDCDC {
public:
RAK4631Board() : NRF52BoardOTA("RAK4631_OTA") {}
RAK4631Board() : NRF52Board("RAK4631_OTA") {}
void begin();

#define BATTERY_SAMPLES 8
Expand Down
4 changes: 2 additions & 2 deletions variants/rak_wismesh_tag/RAKWismeshTagBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#define PIN_VBAT_READ 5
#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000)

class RAKWismeshTagBoard : public NRF52BoardDCDC, public NRF52BoardOTA {
class RAKWismeshTagBoard : public NRF52BoardDCDC {
public:
RAKWismeshTagBoard() : NRF52BoardOTA("WISMESHTAG_OTA") {}
RAKWismeshTagBoard() : NRF52Board("WISMESHTAG_OTA") {}
void begin();

#if defined(P_LORA_TX_LED) && defined(LED_STATE_ON)
Expand Down
4 changes: 2 additions & 2 deletions variants/sensecap_solar/SenseCapSolarBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <Arduino.h>
#include <helpers/NRF52Board.h>

class SenseCapSolarBoard : public NRF52BoardOTA {
class SenseCapSolarBoard : public NRF52BoardDCDC {
public:
SenseCapSolarBoard() : NRF52BoardOTA("SENSECAP_SOLAR_OTA") {}
SenseCapSolarBoard() : NRF52Board("SENSECAP_SOLAR_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
3 changes: 2 additions & 1 deletion variants/t1000-e/T1000eBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class T1000eBoard : public NRF52BoardDCDC {
uint8_t btn_prev_state;

public:
T1000eBoard() : NRF52Board("T1000E_OTA") {}
void begin();

uint16_t getBattMilliVolts() override {
Expand Down Expand Up @@ -91,4 +92,4 @@ class T1000eBoard : public NRF52BoardDCDC {
}

// bool startOTAUpdate(const char* id, char reply[]) override;
};
};
4 changes: 2 additions & 2 deletions variants/thinknode_m1/ThinkNodeM1Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#define PIN_VBAT_READ (4)
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)

class ThinkNodeM1Board : public NRF52BoardOTA {
class ThinkNodeM1Board : public NRF52Board {
public:
ThinkNodeM1Board() : NRF52BoardOTA("THINKNODE_M1_OTA") {}
ThinkNodeM1Board() : NRF52Board("THINKNODE_M1_OTA") {}
void begin();
uint16_t getBattMilliVolts() override;

Expand Down
4 changes: 2 additions & 2 deletions variants/wio-tracker-l1/WioTrackerL1Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#include <Arduino.h>
#include <helpers/NRF52Board.h>

class WioTrackerL1Board : public NRF52BoardDCDC, public NRF52BoardOTA {
class WioTrackerL1Board : public NRF52BoardDCDC {
protected:
uint8_t btn_prev_state;

public:
WioTrackerL1Board() : NRF52BoardOTA("WioTrackerL1 OTA") {}
WioTrackerL1Board() : NRF52Board("WioTrackerL1 OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down
1 change: 1 addition & 0 deletions variants/wio_wm1110/WioWM1110Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class WioWM1110Board : public NRF52BoardDCDC {
public:
WioWM1110Board() : NRF52Board("WioWM1110 OTA") {}
void begin();

#if defined(LED_GREEN)
Expand Down
4 changes: 2 additions & 2 deletions variants/xiao_nrf52/XiaoNrf52Board.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#ifdef XIAO_NRF52

class XiaoNrf52Board : public NRF52BoardDCDC, public NRF52BoardOTA {
class XiaoNrf52Board : public NRF52BoardDCDC {
public:
XiaoNrf52Board() : NRF52BoardOTA("XIAO_NRF52_OTA") {}
XiaoNrf52Board() : NRF52Board("XIAO_NRF52_OTA") {}
void begin();

#if defined(P_LORA_TX_LED)
Expand Down