1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

LP-595 Add delay to ensure USB_Connected is detected - Back to common BL logic

This commit is contained in:
Laurent Lalanne 2018-04-12 19:06:53 +02:00
parent 1ab7956c1a
commit 90e75f0061

View File

@ -76,6 +76,8 @@ int main()
PIOS_Board_Init();
PIOS_IAP_Init();
PIOS_DELAY_WaitmS(500);
USB_connected = PIOS_USB_CableConnected(0);
if (PIOS_IAP_CheckRequest() == TRUE) {
@ -165,7 +167,7 @@ int main()
if (stopwatch > 50 * 1000 * 1000) {
stopwatch = 0;
}
if ((stopwatch > 6 * 1000 * 1000) && ((DeviceState == BLidle) /*|| (DeviceState == DFUidle && !USB_connected)*/)) {
if ((stopwatch > 6 * 1000 * 1000) && ((DeviceState == BLidle) || (DeviceState == DFUidle && !USB_connected))) {
JumpToApp = TRUE;
}
@ -199,7 +201,6 @@ void jump_to_app()
Jump_To_Application();
} else {
DeviceState = failed_jump;
JumpToApp = FALSE;
return;
}
}