mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 21:35:27 +03:00
Popup displayed if the ACCESS module is not up to date
This commit is contained in:
parent
6acd4201dd
commit
7f06c06e84
3 changed files with 17 additions and 2 deletions
|
@ -569,8 +569,10 @@ void flightReset(uint8_t check=true);
|
||||||
|
|
||||||
PACK(struct GlobalData {
|
PACK(struct GlobalData {
|
||||||
uint8_t unexpectedShutdown:1;
|
uint8_t unexpectedShutdown:1;
|
||||||
uint8_t externalAntennaEnabled: 1;
|
uint8_t externalAntennaEnabled:1;
|
||||||
uint8_t spare:6;
|
uint8_t authenticationCount:2;
|
||||||
|
uint8_t authenticationPopup:1;
|
||||||
|
uint8_t spare:3;
|
||||||
});
|
});
|
||||||
|
|
||||||
extern GlobalData globalData;
|
extern GlobalData globalData;
|
||||||
|
|
|
@ -307,6 +307,9 @@ static void enablePulsesInternalModule(uint8_t protocol)
|
||||||
#if defined(PXX2)
|
#if defined(PXX2)
|
||||||
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
|
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
|
||||||
intmoduleSerialStart(PXX2_HIGHSPEED_BAUDRATE, true, USART_Parity_No, USART_StopBits_1, USART_WordLength_8b);
|
intmoduleSerialStart(PXX2_HIGHSPEED_BAUDRATE, true, USART_Parity_No, USART_StopBits_1, USART_WordLength_8b);
|
||||||
|
#if defined(HARDWARE_INTERNAL_MODULE) && defined(INTERNAL_MODULE_PXX2) && defined(ACCESS_LIB)
|
||||||
|
globalData.authenticationCount = 0;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,16 @@ void processAuthenticationFrame(uint8_t module, uint8_t * frame)
|
||||||
intmoduleSendBuffer(pxx2.getData(), pxx2.getSize());
|
intmoduleSendBuffer(pxx2.getData(), pxx2.getSize());
|
||||||
// we remain in AUTHENTICATION mode to avoid a CHANNELS frame is sent at the end of the mixing process
|
// we remain in AUTHENTICATION mode to avoid a CHANNELS frame is sent at the end of the mixing process
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!globalData.authenticationPopup) {
|
||||||
|
if (globalData.authenticationCount >= 2) {
|
||||||
|
globalData.authenticationPopup = 1;
|
||||||
|
POPUP_WARNING(STR_MODULE_UPGRADE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
globalData.authenticationCount += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define processAuthenticationFrame(module, frame)
|
#define processAuthenticationFrame(module, frame)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue