Remove NRF52BoardOTA class and integrate it into NRF52Board

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>
This commit is contained in:
Frieder Schrempf 2025-12-20 10:44:13 +01:00
parent 686d887f72
commit 4f46ec75dd
No known key found for this signature in database
GPG key ID: E7DD51F45F833802
22 changed files with 45 additions and 50 deletions

View file

@ -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()

View file

@ -8,12 +8,15 @@
class NRF52Board : public mesh::MainBoard {
protected:
uint8_t startup_reason;
char *ota_name;
public:
NRF52Board(char *otaname) : ota_name(otaname) {}
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;
};
/*
@ -25,15 +28,7 @@ public:
*/
class NRF52BoardDCDC : virtual public NRF52Board {
public:
NRF52BoardDCDC() {}
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