Improved ESP8266 support for HMS version (same code base: only ESP32 supports HMS!)

This commit is contained in:
lumapu 2023-04-25 20:37:43 +02:00
parent 8c67f59eed
commit 27f16c4e91
5 changed files with 39 additions and 19 deletions

View file

@ -61,22 +61,20 @@ void app::setup() {
mMiPayload.enableSerialDebug(mConfig->serial.debug);
mMiPayload.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1));
if(!mNrfRadio.isChipConnected())
DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
}
//if(mConfig->cmt.enabled) {
#if defined(ESP32)
mHmsPayload.setup(this, &mSys, &mCmtRadio, &mStat, 5, &mTimestamp);
mHmsPayload.enableSerialDebug(mConfig->serial.debug);
mHmsPayload.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1));
//}
#endif
/*DBGPRINTLN("--- after payload");
DBGPRINTLN(String(ESP.getFreeHeap()));
DBGPRINTLN(String(ESP.getHeapFragmentation()));
DBGPRINTLN(String(ESP.getMaxFreeBlockSize()));*/
//if (!mSys.Radio.isChipConnected())
// DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
if(mConfig->nrf.enabled) {
if (!mSys.Radio.isChipConnected())
DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
}
// when WiFi is in client mode, then enable mqtt broker
#if !defined(AP_ONLY)
@ -371,10 +369,12 @@ void app::tickMidnight(void) {
//-----------------------------------------------------------------------------
void app::tickSend(void) {
/*if(!mNrfRadio.isChipConnected()) {
DPRINTLN(DBG_WARN, F("NRF24 not connected!"));
return;
}*/
if(mConfig->nrf.enabled) {
if(!mNrfRadio.isChipConnected()) {
DPRINTLN(DBG_WARN, F("NRF24 not connected!"));
return;
}
}
if (mIVCommunicationOn) {
if (!mNrfRadio.mBufCtrl.empty()) {
if (mConfig->serial.debug) {