Default config for ESP32

This commit is contained in:
Gunnar Skjold
2020-03-24 20:26:13 +01:00
parent 73d00f786a
commit 8c75a9530e
2 changed files with 11 additions and 3 deletions

View File

@@ -56,6 +56,14 @@ SoftwareSerial *hanSerial = new SoftwareSerial(D1);
HardwareSerial *hanSerial = &Serial2;
// Default build for ESP32
#elif defined(ESP32)
#define LED_PIN INVALID_BUTTON_PIN
#define LED_ACTIVE_HIGH 1
#define AP_BUTTON_PIN INVALID_BUTTON_PIN
HardwareSerial *hanSerial = &Serial2;
// Default build settings
#else
#define LED_PIN 2

View File

@@ -97,7 +97,7 @@ void setup() {
if (vcc > 0 && vcc < 3.1) {
if(Debug.isActive(RemoteDebug::INFO)) {
debugI("Votltage is too low, sleeping");
Debug.flush();
Serial.flush();
}
ESP.deepSleep(10000000); //Deep sleep to allow output cap to charge up
}
@@ -160,7 +160,7 @@ void setup() {
if(flashed) {
if(Debug.isActive(RemoteDebug::INFO)) {
debugI("Firmware update complete, restarting");
Debug.flush();
Serial.flush();
}
#if defined(ESP8266)
ESP.reset();
@@ -202,7 +202,7 @@ void setup() {
#else
if(Debug.isActive(RemoteDebug::DEBUG)) {
debugD("HAN has hardware serial");
Debug.flush();
Serial.flush();
}
if(config.getMeterType() == 3) {
hanSerial->begin(2400, SERIAL_8N1);