fix blue LED lights up all the time #672

added an instant start communication (once NTP is synced)
This commit is contained in:
lumapu 2023-02-10 17:18:00 +01:00
parent e03464dabc
commit a157f2b97b
7 changed files with 30 additions and 17 deletions

View file

@ -118,6 +118,8 @@ class HmRadio {
DPRINTLN(DBG_INFO, String(rf24AmpPowerNames[ampPwr]));
mNrf24.setPALevel(ampPwr & 0x03);
mNrf24.startListening();
if(mNrf24.isChipConnected()) {
DPRINTLN(DBG_INFO, F("Radio Config:"));
mNrf24.printPrettyDetails();
@ -138,7 +140,6 @@ class HmRadio {
// start listening on the default RX channel
mRxChIdx = 0;
mNrf24.setChannel(mRfChLst[mRxChIdx]);
mNrf24.startListening();
//uint32_t debug_ms = millis();
uint16_t cnt = 300; // that is 60 times 5 channels
@ -160,7 +161,6 @@ class HmRadio {
}
// not finished but time is over
//DBGPRINTLN("RX not finished: 300 time used: " + String(millis()-debug_ms)+ " ms");
mNrf24.stopListening();
return true;
}
@ -299,6 +299,7 @@ class HmRadio {
dumpBuf(mTxBuf, len);
}
mNrf24.stopListening();
mNrf24.setChannel(mRfChLst[mTxChIdx]);
mNrf24.openWritingPipe(reinterpret_cast<uint8_t*>(&invId));
mNrf24.startWrite(mTxBuf, len, false); // false = request ACK response