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:
@@ -5,8 +5,7 @@
|
||||
#include <bluefruit.h>
|
||||
|
||||
void T1000eBoard::begin() {
|
||||
// for future use, sub-classes SHOULD call this from their begin()
|
||||
startup_reason = BD_STARTUP_NORMAL;
|
||||
NRF52Board::begin();
|
||||
btn_prev_state = HIGH;
|
||||
|
||||
// Enable DC/DC converter for improved power efficiency
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
class T1000eBoard : public NRF52Board {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
uint8_t btn_prev_state;
|
||||
|
||||
public:
|
||||
@@ -34,8 +33,6 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t getStartupReason() const override { return startup_reason; }
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Seeed Tracker T1000-e";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user