Rev1 updates
This commit is contained in:
parent
36eacfc4a2
commit
ba4c897cee
@ -129,4 +129,5 @@ void ttn_register(void (*callback)(uint8_t message));
|
||||
#ifdef T_BEAM_V10
|
||||
#define GPS_POWER_CTRL_CH 3
|
||||
#define LORA_POWER_CTRL_CH 2
|
||||
#define PMU_IRQ 35
|
||||
#endif
|
||||
|
@ -26,6 +26,11 @@
|
||||
|
||||
#ifdef T_BEAM_V10
|
||||
#include "axp20x.h"
|
||||
#define AXP192_SLAVE_ADDRESS 0x34
|
||||
AXP20X_Class axp;
|
||||
bool axp192_found = false;
|
||||
bool pmu_irq = false;
|
||||
String baChStatus = "No charging";
|
||||
#endif
|
||||
|
||||
// Message counter, stored in RTC memory, survives deep sleep
|
||||
@ -184,8 +189,6 @@ void setup() {
|
||||
} else {
|
||||
Serial.println("AXP192 not found");
|
||||
}
|
||||
|
||||
Serial1.begin(GPS_BANUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
|
||||
#endif
|
||||
|
||||
// Buttons & LED
|
||||
|
@ -103,6 +103,23 @@ void screen_setup() {
|
||||
}
|
||||
|
||||
void screen_loop() {
|
||||
#ifdef T_BEAM_V10
|
||||
if (axp192_found && pmu_irq) {
|
||||
pmu_irq = false;
|
||||
axp.readIRQ();
|
||||
if (axp.isChargingIRQ()) {
|
||||
baChStatus = "Charging";
|
||||
} else {
|
||||
baChStatus = "No Charging";
|
||||
}
|
||||
if (axp.isVbusRemoveIRQ()) {
|
||||
baChStatus = "No Charging";
|
||||
}
|
||||
digitalWrite(2, !digitalRead(2));
|
||||
axp.clearIRQ();
|
||||
}
|
||||
#endif
|
||||
|
||||
display->clear();
|
||||
_screen_header();
|
||||
display->drawLogBuffer(0, SCREEN_HEADER_HEIGHT);
|
||||
|
Loading…
Reference in New Issue
Block a user