Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions variants/t1000-e/T1000eBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class T1000eBoard : public NRF52BoardDCDC {
public:
T1000eBoard() : NRF52Board("T1000E_OTA") {}
void begin();
bool isExternalPowered() override {
#ifdef CHARGER_INSERT_DETECT
return digitalRead(CHARGER_INSERT_DETECT) == CHARGER_INSERT_ACTIVE || NRF52Board::isExternalPowered();
#else
return NRF52Board::isExternalPowered();
#endif
}

uint16_t getBattMilliVolts() override {
#ifdef BATTERY_PIN
Expand Down
8 changes: 4 additions & 4 deletions variants/t1000-e/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const uint32_t g_ADigitalPinMap[PINS_COUNT + 1] =
2, // P0.02, AIN0 BATTERY_PIN
3, // P0.03
4, // P0.04, SENSOR_EN
5, // P0.05, EXT_PWR_DETEC
5, // P0.05, CHARGER_INSERT_DETECT
6, // P0.06, PIN_BUTTON1
7, // P0.07, LORA_BUSY
8, // P0.08, GPS_VRTC_EN
Expand Down Expand Up @@ -45,7 +45,7 @@ const uint32_t g_ADigitalPinMap[PINS_COUNT + 1] =
32, // P1.00
33, // P1.01, LORA_DIO_1
34, // P1.02
35, // P1.03, EXT_CHRG_DETECT
35, // P1.03, CHARGER_STATE_DETECT
36, // P1.04
37, // P1.05, LR1110_EN
38, // P1.06, 3V3_EN PWR TO SENSORS
Expand All @@ -69,8 +69,8 @@ void initVariant()
pinMode(BATTERY_PIN, INPUT);
pinMode(TEMP_SENSOR, INPUT);
pinMode(LUX_SENSOR, INPUT);
pinMode(EXT_CHRG_DETECT, INPUT);
pinMode(EXT_PWR_DETECT, INPUT);
pinMode(CHARGER_STATE_DETECT, INPUT);
pinMode(CHARGER_INSERT_DETECT, INPUT);
pinMode(GPS_RESETB, INPUT);
pinMode(PIN_BUTTON1, INPUT);

Expand Down
7 changes: 4 additions & 3 deletions variants/t1000-e/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
#define BATTERY_IMMUTABLE
#define ADC_MULTIPLIER (2.0F)

#define EXT_CHRG_DETECT (35) // P1.3
#define EXT_PWR_DETECT (5) // P0.5
#define CHARGER_STATE_DETECT (35) // P1.3 Charger State
#define CHARGER_INSERT_DETECT (5) // P0.5 Charger insert detect
#define CHARGER_INSERT_ACTIVE HIGH

#define ADC_RESOLUTION (14)
#define BATTERY_SENSE_RES (12)
Expand Down Expand Up @@ -133,4 +134,4 @@
// Buzzer

#define BUZZER_EN (37) // P1.5
#define BUZZER_PIN (25) // P0.25
#define BUZZER_PIN (25) // P0.25
Loading