fix heltec build (and fix formatting)

This commit is contained in:
geeksville 2020-07-01 10:08:38 -07:00
parent a7456a1126
commit a4f53270e8

View File

@ -37,8 +37,8 @@
#include "main.h"
#include "screen.h"
#include "sleep.h"
#include <Wire.h>
#include <OneButton.h>
#include <Wire.h>
// #include <driver/rtc_io.h>
#ifndef NO_ESP32
@ -139,10 +139,12 @@ Periodic ledPeriodic(ledBlinker);
#ifdef BUTTON_PIN_ALT
OneButton userButtonAlt;
#endif
void userButtonPressed() {
void userButtonPressed()
{
powerFSM.trigger(EVENT_PRESS);
}
void userButtonPressedLong(){
void userButtonPressedLong()
{
screen.adjustBrightness();
}
@ -229,6 +231,10 @@ void setup()
ssd1306_found = false; // forget we even have the hardware
esp32Setup();
#endif
#ifdef TBEAM_V10
// Currently only the tbeam has a PMU
power = new Power();
power->setup();
power->setStatusHandler(powerStatus);
@ -306,7 +312,6 @@ void setup()
// This must be _after_ service.init because we need our preferences loaded from flash to have proper timeout values
PowerFSM_setup(); // we will transition to ON in a couple of seconds, FIXME, only do this for cold boots, not waking from SDS
// setBluetoothEnable(false); we now don't start bluetooth until we enter the proper state
setCPUFast(false); // 80MHz is fine for our slow peripherals
}
@ -352,6 +357,8 @@ void loop()
#ifndef NO_ESP32
esp32Loop();
#endif
#ifdef TBEAM_V10
power->loop();
#endif