mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-17 00:15:15 +02:00
fix blue LED lights up all the time #672
added an instant start communication (once NTP is synced)
This commit is contained in:
parent
e03464dabc
commit
a157f2b97b
7 changed files with 30 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue