Control added
This commit is contained in:
@@ -42,7 +42,13 @@ class ModuleFifo : public Fifo<uint8_t, PXX2_FRAME_MAXLENGTH> {
|
|||||||
|
|
||||||
uint32_t next = nextIndex(ridx);
|
uint32_t next = nextIndex(ridx);
|
||||||
uint8_t len = fifo[next];
|
uint8_t len = fifo[next];
|
||||||
if (unsigned(len + 4 /* 2 bytes header + 2 bytes CRC */) > size()) {
|
|
||||||
|
if (len > 40) {
|
||||||
|
clear();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size() < unsigned(len + 4 /* 2 bytes header + 2 bytes CRC */)) {
|
||||||
// frame not fully received
|
// frame not fully received
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
|
|||||||
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_OK;
|
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_OK;
|
||||||
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
||||||
POPUP_INFORMATION(STR_REG_OK);
|
POPUP_INFORMATION(STR_REG_OK);
|
||||||
|
} else {
|
||||||
|
TRACE("KO %s %s", &frame[4], reusableBuffer.moduleSetup.pxx2.registerRxName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user