mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-26 12:13:10 +00:00
Default config for ESP32
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user