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:
@@ -21,7 +21,7 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
||||
}
|
||||
|
||||
void WioWM1110Board::begin() {
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
NRF52Board::begin();
|
||||
|
||||
// Enable DC/DC converter for improved power efficiency
|
||||
uint8_t sd_enabled = 0;
|
||||
|
||||
@@ -12,12 +12,8 @@
|
||||
#define Serial Serial1
|
||||
|
||||
class WioWM1110Board : public NRF52Board {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
|
||||
public:
|
||||
void begin();
|
||||
uint8_t getStartupReason() const override { return startup_reason; }
|
||||
|
||||
#if defined(LED_GREEN)
|
||||
void onBeforeTransmit() override {
|
||||
|
||||
Reference in New Issue
Block a user