Browse Source

Do not init Serial based on SERIAL_BAUDRATE (#787)

rfm69
Xose Pérez 6 years ago
parent
commit
8189f90686
3 changed files with 21 additions and 9 deletions
  1. +2
    -1
      code/espurna/config/hardware.h
  2. +1
    -1
      code/espurna/rfbridge.ino
  3. +18
    -7
      code/espurna/system.ino

+ 2
- 1
code/espurna/config/hardware.h View File

@ -1554,7 +1554,8 @@
// Remove UART noise on serial line
#define TERMINAL_SUPPORT 0
#define DEBUG_SERIAL_SUPPORT 0
#define SERIAL_BAUDRATE 115200
// -----------------------------------------------------------------------------
// Tonbux Powerstrip02
// -----------------------------------------------------------------------------


+ 1
- 1
code/espurna/rfbridge.ino View File

@ -522,7 +522,7 @@ void rfbSetup() {
wsOnActionRegister(_rfbWebSocketOnAction);
#endif
// Register oop
// Register loop
espurnaRegisterLoop(rfbLoop);
}


+ 18
- 7
code/espurna/system.ino View File

@ -130,6 +130,22 @@ void systemLoop() {
}
void _systemSetupSpecificHardware() {
//The ESPLive has an ADC MUX which needs to be configured.
#if defined(MANCAVEMADE_ESPLIVE)
pinMode(16, OUTPUT);
digitalWrite(16, HIGH); //Defualt CT input (pin B, solder jumper B)
#endif
// These devices use the hardware UART
// to communicate to secondary microcontrollers
#if defined(ITEAD_SONOFF_RFBRIDGE) || defined(ITEAD_SONOFF_DUAL) || defined(STM_RELAY)
Serial.begin(SERIAL_BAUDRATE);
#endif
}
void systemSetup() {
EEPROM.begin(EEPROM_SIZE);
@ -139,8 +155,6 @@ void systemSetup() {
#if DEBUG_ESP_WIFI
DEBUG_PORT.setDebugOutput(true);
#endif
#elif defined(SERIAL_BAUDRATE)
Serial.begin(SERIAL_BAUDRATE);
#endif
#if SPIFFS_SUPPORT
@ -152,11 +166,8 @@ void systemSetup() {
systemCheck(false);
#endif
#if defined(ESPLIVE)
//The ESPLive has an ADC MUX which needs to be configured.
pinMode(16, OUTPUT);
digitalWrite(16, HIGH); //Defualt CT input (pin B, solder jumper B)
#endif
// Init device-specific hardware
_systemSetupSpecificHardware();
// Cache loop delay value to speed things (recommended max 250ms)
_loop_delay = atol(getSetting("loopDelay", LOOP_DELAY_TIME).c_str());


Loading…
Cancel
Save