Control added

This commit is contained in:
Bertrand Songis
2019-03-26 14:28:23 +01:00
parent db316af98d
commit 46c883b3b8
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -42,7 +42,13 @@ class ModuleFifo : public Fifo<uint8_t, PXX2_FRAME_MAXLENGTH> {
uint32_t next = nextIndex(ridx);
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
return false;
}
+2
View File
@@ -127,6 +127,8 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_OK;
moduleSettings[module].mode = MODULE_MODE_NORMAL;
POPUP_INFORMATION(STR_REG_OK);
} else {
TRACE("KO %s %s", &frame[4], reusableBuffer.moduleSetup.pxx2.registerRxName);
}
}
break;