1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

Add some random to REGISTER command

This commit is contained in:
Bertrand Songis 2019-03-14 16:06:26 +01:00
parent 6cbffc1ad0
commit a59776a8e8
3 changed files with 4 additions and 1 deletions

View file

@ -329,6 +329,7 @@ void runPopupRegister(event_t event)
}
else if (reusableBuffer.moduleSetup.pxx2.registerStep >= REGISTER_RX_NAME_RECEIVED && menuHorizontalPosition == 0) {
// [Enter] pressed
reusableBuffer.moduleSetup.pxx2.registerLoopIndex = get_tmr10ms();
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_SELECTED;
backupEditMode = EDIT_MODIFY_FIELD; // so that the [Register] button blinks and the REGISTER process can continue
}
@ -1363,7 +1364,7 @@ void menuModelSetup(event_t event)
moduleSettings[moduleIdx].mode = MODULE_MODE_SHARE;
reusableBuffer.moduleSetup.pxx2.shareReceiverIndex = receiverIdx;
s_editMode = 0;
POPUP_INFORMATION("Model shared");
POPUP_INFORMATION("Receiver shared");
}
}
}

View file

@ -1129,6 +1129,7 @@ union ReusableBuffer
uint8_t registerPopupHorizontalPosition;
int8_t registerPopupEditMode;
char registerRxName[PXX2_LEN_RX_NAME];
uint8_t registerLoopIndex;
char bindCandidateReceiversNames[PXX2_MAX_RECEIVERS_PER_MODULE][PXX2_LEN_RX_NAME + 1];
uint8_t bindCandidateReceiversCount;
uint8_t bindReceiverId;

View file

@ -139,6 +139,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.registerLoopIndex);
}
else {
Pxx2Transport::addByte(0);