Register Loop Index now retrieven from RX at Register (not always 0)

This commit is contained in:
Bertrand Songis
2019-04-11 22:01:31 +02:00
parent 8ec2155be6
commit bd75629423
4 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -380,11 +380,11 @@ void runPopupRegister(event_t event)
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4, STR_REG_ID);
editName(WARNING_LINE_X + 8*FW, WARNING_LINE_Y - 4, g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID, event, menuVerticalPosition == ITEM_REGISTER_PASSWORD);
// module index
// loop index (will be removed in future)
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4 + FH, "UID");
lcdDrawNumber(WARNING_LINE_X + 8*FW, WARNING_LINE_Y - 4 + FH, reusableBuffer.moduleSetup.pxx2.registerModuleIndex, menuVerticalPosition == ITEM_REGISTER_MODULE_INDEX ? (s_editMode ? INVERS + BLINK : INVERS) : 0);
lcdDrawNumber(WARNING_LINE_X + 8*FW, WARNING_LINE_Y - 4 + FH, reusableBuffer.moduleSetup.pxx2.registerLoopIndex, menuVerticalPosition == ITEM_REGISTER_MODULE_INDEX ? (s_editMode ? INVERS + BLINK : INVERS) : 0);
if (menuVerticalPosition == ITEM_REGISTER_MODULE_INDEX && s_editMode) {
CHECK_INCDEC_MODELVAR_ZERO(event, reusableBuffer.moduleSetup.pxx2.registerModuleIndex, 7);
CHECK_INCDEC_MODELVAR_ZERO(event, reusableBuffer.moduleSetup.pxx2.registerLoopIndex, 7);
}
// RX name
+1 -1
View File
@@ -1142,7 +1142,7 @@ union ReusableBuffer
uint8_t registerPopupHorizontalPosition;
int8_t registerPopupEditMode;
char registerRxName[PXX2_LEN_RX_NAME];
uint8_t registerModuleIndex;
uint8_t registerLoopIndex; // will be removed later
char bindCandidateReceiversNames[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME + 1];
uint8_t bindCandidateReceiversCount;
uint8_t bindReceiverIndex;
+1 -1
View File
@@ -160,7 +160,7 @@ void Pxx2Pulses::setupRegisterFrame(uint8_t module)
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
Pxx2Transport::addByte(zchar2char(g_model.modelRegistrationID[i]));
}
Pxx2Transport::addByte(reusableBuffer.moduleSetup.pxx2.registerModuleIndex);
Pxx2Transport::addByte(reusableBuffer.moduleSetup.pxx2.registerLoopIndex);
}
else {
Pxx2Transport::addByte(0);
+1
View File
@@ -109,6 +109,7 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
if (reusableBuffer.moduleSetup.pxx2.registerStep == REGISTER_START) {
// RX_NAME follows, we store it for the next step
str2zchar(reusableBuffer.moduleSetup.pxx2.registerRxName, (const char *)&frame[4], PXX2_LEN_RX_NAME);
reusableBuffer.moduleSetup.pxx2.registerLoopIndex = frame[12];
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_RECEIVED;
}
break;