variants: Thinknode M3/M6: Use common Nrf52Board class

Signed-off-by: Frieder Schrempf <frieder@fris.de>
This commit is contained in:
Frieder Schrempf 2025-12-22 16:25:35 +01:00
parent 57fa1ba854
commit 578d55b28a
No known key found for this signature in database
GPG key ID: E7DD51F45F833802
4 changed files with 16 additions and 163 deletions

View file

@ -1,13 +1,13 @@
#pragma once
#include <MeshCore.h>
#include <Arduino.h>
#include <MeshCore.h>
#include <helpers/NRF52Board.h>
#define ADC_FACTOR ((1000.0*ADC_MULTIPLIER*AREF_VOLTAGE)/ADC_MAX)
class ThinknodeM3Board : public mesh::MainBoard {
class ThinknodeM3Board : public Nrf52BoardDCDC {
protected:
uint8_t startup_reason;
uint8_t btn_prev_state;
public:
@ -27,12 +27,10 @@ public:
return (uint16_t)((float)adcvalue * ADC_FACTOR);
}
uint8_t getStartupReason() const override { return startup_reason; }
#if defined(P_LORA_TX_LED)
#if !defined(P_LORA_TX_LED_ON)
#define P_LORA_TX_LED_ON HIGH
#endif
#if defined(P_LORA_TX_LED)
#if !defined(P_LORA_TX_LED_ON)
#define P_LORA_TX_LED_ON HIGH
#endif
void onBeforeTransmit() override {
digitalWrite(P_LORA_TX_LED, P_LORA_TX_LED_ON); // turn TX LED on
}
@ -56,13 +54,5 @@ public:
return 0;
}
void powerOff() override {
sd_power_system_off();
}
void reboot() override {
NVIC_SystemReset();
}
// bool startOTAUpdate(const char* id, char reply[]) override;
void powerOff() override { sd_power_system_off(); }
};