Browse Source

MI - fix MQTT version

+ changed rx/tx logic (times + debug output)
pull/846/head
rejoe2 2 years ago
committed by GitHub
parent
commit
e8e216cd69
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/hm/hmRadio.h
  2. 2
      src/hm/miPayload.h

9
src/hm/hmRadio.h

@ -155,10 +155,14 @@ class HmRadio {
uint32_t startMicros = micros(); uint32_t startMicros = micros();
uint32_t loopMillis = millis(); uint32_t loopMillis = millis();
while (millis()-loopMillis < 410) {
while (micros()-startMicros < 5110) { // listen 5110us to each channel uint32_t timeslot = 4088;//5110; //3066; //6132;//4088;
uint64_t tsCnt = 0;
while (millis()-loopMillis < 200) {
while (micros()-startMicros < timeslot) { // listen timeslot us to each channel
if (mIrqRcvd) { if (mIrqRcvd) {
mIrqRcvd = false; mIrqRcvd = false;
DBGPRINTLN("*** time: " + String(tsCnt*(uint64_t)timeslot + (uint64_t)(micros()-startMicros)) + " ***");
if (getReceived()) { // everything received if (getReceived()) { // everything received
return true; return true;
} }
@ -170,6 +174,7 @@ class HmRadio {
if(++mRxChIdx >= RF_CHANNELS) if(++mRxChIdx >= RF_CHANNELS)
mRxChIdx = 0; mRxChIdx = 0;
mNrf24.setChannel(mRfChLst[mRxChIdx]); mNrf24.setChannel(mRfChLst[mRxChIdx]);
tsCnt++;
yield(); yield();
} }
// not finished but time is over // not finished but time is over

2
src/hm/miPayload.h

@ -751,7 +751,7 @@ const byteAssign_t InfoAssignment[] = {
iv->setQueuedCmdFinished(); iv->setQueuedCmdFinished();
mStat->rxSuccess++; mStat->rxSuccess++;
yield(); yield();
notify(mPayload[iv->id].txCmd); notify(RealTimeRunData_Debug); //iv->type == INV_TYPE_4CH ? 0x36 : 0x09 );
} }
bool build(uint8_t id, bool *complete) { bool build(uint8_t id, bool *complete) {

Loading…
Cancel
Save