|
@ -15,11 +15,11 @@ |
|
|
app::app() : Main() { |
|
|
app::app() : Main() { |
|
|
DPRINTLN(DBG_VERBOSE, F("app::app():Main")); |
|
|
DPRINTLN(DBG_VERBOSE, F("app::app():Main")); |
|
|
mSendTicker = 0xffff; |
|
|
mSendTicker = 0xffff; |
|
|
mSendInterval = 0; |
|
|
mSendInterval = MIN_SEND_INTERVAL; |
|
|
mMqttTicker = 0xffff; |
|
|
mMqttTicker = 0xffff; |
|
|
mMqttInterval = 0; |
|
|
mMqttInterval = MIN_MQTT_INTERVAL; |
|
|
mSerialTicker = 0xffff; |
|
|
mSerialTicker = 0xffff; |
|
|
mSerialInterval = 0; |
|
|
mSerialInterval = MIN_SERIAL_INTERVAL; |
|
|
mMqttActive = false; |
|
|
mMqttActive = false; |
|
|
|
|
|
|
|
|
mTicker = 0; |
|
|
mTicker = 0; |
|
@ -65,8 +65,8 @@ void app::setup(uint32_t timeout) { |
|
|
|
|
|
|
|
|
if(mSettingsValid) { |
|
|
if(mSettingsValid) { |
|
|
mEep->read(ADDR_INV_INTERVAL, &mSendInterval); |
|
|
mEep->read(ADDR_INV_INTERVAL, &mSendInterval); |
|
|
if(mSendInterval < 5) |
|
|
if(mSendInterval < MIN_SEND_INTERVAL) |
|
|
mSendInterval = 5; |
|
|
mSendInterval = MIN_SEND_INTERVAL; |
|
|
mSendTicker = mSendInterval; |
|
|
mSendTicker = mSendInterval; |
|
|
|
|
|
|
|
|
// inverter
|
|
|
// inverter
|
|
@ -114,12 +114,12 @@ void app::setup(uint32_t timeout) { |
|
|
// serial console
|
|
|
// serial console
|
|
|
uint8_t tmp; |
|
|
uint8_t tmp; |
|
|
mEep->read(ADDR_SER_INTERVAL, &mSerialInterval); |
|
|
mEep->read(ADDR_SER_INTERVAL, &mSerialInterval); |
|
|
|
|
|
if(mSerialInterval < MIN_SERIAL_INTERVAL) |
|
|
|
|
|
mSerialInterval = MIN_SERIAL_INTERVAL; |
|
|
mEep->read(ADDR_SER_ENABLE, &tmp); |
|
|
mEep->read(ADDR_SER_ENABLE, &tmp); |
|
|
mSerialValues = (tmp == 0x01); |
|
|
mSerialValues = (tmp == 0x01); |
|
|
mEep->read(ADDR_SER_DEBUG, &tmp); |
|
|
mEep->read(ADDR_SER_DEBUG, &tmp); |
|
|
mSerialDebug = (tmp == 0x01); |
|
|
mSerialDebug = (tmp == 0x01); |
|
|
if(mSerialInterval < 1) |
|
|
|
|
|
mSerialInterval = 1; |
|
|
|
|
|
mSys->Radio.mSerialDebug = mSerialDebug; |
|
|
mSys->Radio.mSerialDebug = mSerialDebug; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,8 +138,8 @@ void app::setup(uint32_t timeout) { |
|
|
|
|
|
|
|
|
if(mqttAddr[0] > 0) { |
|
|
if(mqttAddr[0] > 0) { |
|
|
mMqttActive = true; |
|
|
mMqttActive = true; |
|
|
if(mMqttInterval < 1) |
|
|
if(mMqttInterval < MIN_MQTT_INTERVAL) |
|
|
mMqttInterval = 10; |
|
|
mMqttInterval = MIN_MQTT_INTERVAL; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
mMqttInterval = 0xffff; |
|
|
mMqttInterval = 0xffff; |
|
|