|
@ -20,52 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
#include "config/all.h"
|
|
|
#include "config/all.h"
|
|
|
#include <EEPROM.h>
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
// METHODS
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
unsigned long _loopDelay = 0; |
|
|
unsigned long _loopDelay = 0; |
|
|
|
|
|
|
|
|
void hardwareSetup() { |
|
|
|
|
|
|
|
|
|
|
|
EEPROM.begin(EEPROM_SIZE); |
|
|
|
|
|
|
|
|
|
|
|
#if DEBUG_SERIAL_SUPPORT
|
|
|
|
|
|
DEBUG_PORT.begin(SERIAL_BAUDRATE); |
|
|
|
|
|
#if DEBUG_ESP_WIFI
|
|
|
|
|
|
DEBUG_PORT.setDebugOutput(true); |
|
|
|
|
|
#endif
|
|
|
|
|
|
#elif defined(SERIAL_BAUDRATE)
|
|
|
|
|
|
Serial.begin(SERIAL_BAUDRATE); |
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if SPIFFS_SUPPORT
|
|
|
|
|
|
SPIFFS.begin(); |
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void hardwareLoop() { |
|
|
|
|
|
|
|
|
|
|
|
// Heartbeat
|
|
|
|
|
|
#if HEARTBEAT_ENABLED
|
|
|
|
|
|
static unsigned long last = 0; |
|
|
|
|
|
if ((last == 0) || (millis() - last > HEARTBEAT_INTERVAL)) { |
|
|
|
|
|
last = millis(); |
|
|
|
|
|
heartbeat(); |
|
|
|
|
|
} |
|
|
|
|
|
#endif // HEARTBEAT_ENABLED
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
// -----------------------------------------------------------------------------
|
|
|
// BOOTING
|
|
|
// BOOTING
|
|
|
// -----------------------------------------------------------------------------
|
|
|
// -----------------------------------------------------------------------------
|
|
|