mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
get ttgo building again
This commit is contained in:
parent
493d7e33c6
commit
0158fcf352
@ -100,7 +100,7 @@ void NodeDB::loadFromDisk()
|
|||||||
DEBUG_MSG("Loading saved preferences\n");
|
DEBUG_MSG("Loading saved preferences\n");
|
||||||
pb_istream_t stream = {&readcb, &f, DeviceState_size};
|
pb_istream_t stream = {&readcb, &f, DeviceState_size};
|
||||||
|
|
||||||
scratch = DeviceState_init_zero;
|
memset(&scratch, 0, sizeof(scratch));
|
||||||
if (!pb_decode(&stream, DeviceState_fields, &scratch))
|
if (!pb_decode(&stream, DeviceState_fields, &scratch))
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Error: can't decode protobuf %s\n", PB_GET_ERROR(&stream));
|
DEBUG_MSG("Error: can't decode protobuf %s\n", PB_GET_ERROR(&stream));
|
||||||
|
@ -38,11 +38,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
// Select which T-Beam board is being used. Only uncomment one. Note: these options now come from platformio standard build file flags
|
// Select which T-Beam board is being used. Only uncomment one. Note: these options now come from platformio standard build file flags
|
||||||
//#ifdef ARDUINO_T_Beam
|
//#ifdef ARDUINO_T_Beam
|
||||||
//#define T_BEAM_V10 // AKA Rev1 (second board released)
|
#define T_BEAM_V10 // AKA Rev1 (second board released)
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
//#ifdef ARDUINO_HELTEC_WIFI_LORA_32_V2
|
//#ifdef ARDUINO_HELTEC_WIFI_LORA_32_V2
|
||||||
#define HELTEC_LORA32
|
// #define HELTEC_LORA32
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
// If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled)
|
// If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled)
|
||||||
|
21
src/main.ino
21
src/main.ino
@ -390,6 +390,27 @@ void loop()
|
|||||||
{
|
{
|
||||||
// blink the axp led
|
// blink the axp led
|
||||||
axp.setChgLEDMode(ledon ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
|
axp.setChgLEDMode(ledon ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
|
||||||
|
|
||||||
|
if (pmu_irq)
|
||||||
|
{
|
||||||
|
pmu_irq = false;
|
||||||
|
axp.readIRQ();
|
||||||
|
if (axp.isChargingIRQ())
|
||||||
|
{
|
||||||
|
baChStatus = "Charging";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
baChStatus = "No Charging";
|
||||||
|
}
|
||||||
|
if (axp.isVbusRemoveIRQ())
|
||||||
|
{
|
||||||
|
baChStatus = "No Charging";
|
||||||
|
}
|
||||||
|
// This is not a GPIO actually connected on the tbeam board
|
||||||
|
// digitalWrite(2, !digitalRead(2));
|
||||||
|
axp.clearIRQ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -280,8 +280,6 @@ static void screen_print(const char *text, uint8_t x, uint8_t y, uint8_t alignme
|
|||||||
dispdev.drawString(x, y, text);
|
dispdev.drawString(x, y, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void screen_print(const char *text)
|
void screen_print(const char *text)
|
||||||
{
|
{
|
||||||
DEBUG_MSG("Screen: %s\n", text);
|
DEBUG_MSG("Screen: %s\n", text);
|
||||||
@ -345,33 +343,11 @@ uint32_t screen_loop()
|
|||||||
if (!disp)
|
if (!disp)
|
||||||
return 30 * 1000;
|
return 30 * 1000;
|
||||||
|
|
||||||
#ifdef T_BEAM_V10
|
if (wakeScreen)
|
||||||
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";
|
|
||||||
}
|
|
||||||
// This is not a GPIO actually connected on the tbeam board
|
|
||||||
// digitalWrite(2, !digitalRead(2));
|
|
||||||
axp.clearIRQ();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(wakeScreen) {
|
|
||||||
screen_on(); // make sure the screen is not asleep
|
screen_on(); // make sure the screen is not asleep
|
||||||
wakeScreen = false;
|
wakeScreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool showingBootScreen = true;
|
static bool showingBootScreen = true;
|
||||||
|
|
||||||
@ -389,8 +365,9 @@ if(wakeScreen) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show the bluetooth PIN screen
|
// Show the bluetooth PIN screen
|
||||||
void screen_start_bluetooth(uint32_t pin) {
|
void screen_start_bluetooth(uint32_t pin)
|
||||||
static FrameCallback btFrames[] = { drawFrameBluetooth };
|
{
|
||||||
|
static FrameCallback btFrames[] = {drawFrameBluetooth};
|
||||||
|
|
||||||
snprintf(btPIN, sizeof(btPIN), "%06d", pin);
|
snprintf(btPIN, sizeof(btPIN), "%06d", pin);
|
||||||
|
|
||||||
@ -405,14 +382,16 @@ void screen_start_bluetooth(uint32_t pin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// restore our regular frame list
|
// restore our regular frame list
|
||||||
void screen_set_frames() {
|
void screen_set_frames()
|
||||||
|
{
|
||||||
DEBUG_MSG("showing standard frames\n");
|
DEBUG_MSG("showing standard frames\n");
|
||||||
ui.setFrames(nonBootFrames, frameCount - 1);
|
ui.setFrames(nonBootFrames, frameCount - 1);
|
||||||
showingBluetooth = false;
|
showingBluetooth = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// handle press of the button
|
/// handle press of the button
|
||||||
void screen_press() {
|
void screen_press()
|
||||||
|
{
|
||||||
// screen_start_bluetooth(123456);
|
// screen_start_bluetooth(123456);
|
||||||
|
|
||||||
// Once the user presses a button, stop auto scrolling between screens
|
// Once the user presses a button, stop auto scrolling between screens
|
||||||
|
Loading…
Reference in New Issue
Block a user