Rev1 updates

This commit is contained in:
Kyle Gabriel 2019-08-25 13:56:43 -04:00
parent 36eacfc4a2
commit ba4c897cee
3 changed files with 23 additions and 2 deletions

View File

@ -129,4 +129,5 @@ void ttn_register(void (*callback)(uint8_t message));
#ifdef T_BEAM_V10 #ifdef T_BEAM_V10
#define GPS_POWER_CTRL_CH 3 #define GPS_POWER_CTRL_CH 3
#define LORA_POWER_CTRL_CH 2 #define LORA_POWER_CTRL_CH 2
#define PMU_IRQ 35
#endif #endif

View File

@ -26,6 +26,11 @@
#ifdef T_BEAM_V10 #ifdef T_BEAM_V10
#include "axp20x.h" #include "axp20x.h"
#define AXP192_SLAVE_ADDRESS 0x34
AXP20X_Class axp;
bool axp192_found = false;
bool pmu_irq = false;
String baChStatus = "No charging";
#endif #endif
// Message counter, stored in RTC memory, survives deep sleep // Message counter, stored in RTC memory, survives deep sleep
@ -184,8 +189,6 @@ void setup() {
} else { } else {
Serial.println("AXP192 not found"); Serial.println("AXP192 not found");
} }
Serial1.begin(GPS_BANUD_RATE, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
#endif #endif
// Buttons & LED // Buttons & LED

View File

@ -103,6 +103,23 @@ void screen_setup() {
} }
void screen_loop() { 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(); display->clear();
_screen_header(); _screen_header();
display->drawLogBuffer(0, SCREEN_HEADER_HEIGHT); display->drawLogBuffer(0, SCREEN_HEADER_HEIGHT);