mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-17 07:54:17 +01:00
Merged in LP-595_PikoBLX_firmware_rescue (pull request #508)
LP-595 Add delay to ensure USB_Connected is detected - Back to common BL logic Approved-by: Eric Price
This commit is contained in:
commit
814b675a20
@ -76,6 +76,10 @@ int main()
|
|||||||
PIOS_Board_Init();
|
PIOS_Board_Init();
|
||||||
PIOS_IAP_Init();
|
PIOS_IAP_Init();
|
||||||
|
|
||||||
|
// Without vsense pin, need to wait for correct PIOS_USB_CableConnected detection.
|
||||||
|
// This break DSM binding process but allows firmware rescue.
|
||||||
|
PIOS_DELAY_WaitmS(500);
|
||||||
|
|
||||||
USB_connected = PIOS_USB_CableConnected(0);
|
USB_connected = PIOS_USB_CableConnected(0);
|
||||||
|
|
||||||
if (PIOS_IAP_CheckRequest() == TRUE) {
|
if (PIOS_IAP_CheckRequest() == TRUE) {
|
||||||
@ -165,7 +169,7 @@ int main()
|
|||||||
if (stopwatch > 50 * 1000 * 1000) {
|
if (stopwatch > 50 * 1000 * 1000) {
|
||||||
stopwatch = 0;
|
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;
|
JumpToApp = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +203,6 @@ void jump_to_app()
|
|||||||
Jump_To_Application();
|
Jump_To_Application();
|
||||||
} else {
|
} else {
|
||||||
DeviceState = failed_jump;
|
DeviceState = failed_jump;
|
||||||
JumpToApp = FALSE;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,10 @@ int main()
|
|||||||
PIOS_Board_Init();
|
PIOS_Board_Init();
|
||||||
PIOS_IAP_Init();
|
PIOS_IAP_Init();
|
||||||
|
|
||||||
|
// Without vsense pin, need to wait for correct PIOS_USB_CableConnected detection.
|
||||||
|
// This break DSM binding process but allows firmware rescue.
|
||||||
|
PIOS_DELAY_WaitmS(500);
|
||||||
|
|
||||||
USB_connected = PIOS_USB_CableConnected(0);
|
USB_connected = PIOS_USB_CableConnected(0);
|
||||||
|
|
||||||
if (PIOS_IAP_CheckRequest() == TRUE) {
|
if (PIOS_IAP_CheckRequest() == TRUE) {
|
||||||
@ -165,7 +169,7 @@ int main()
|
|||||||
if (stopwatch > 50 * 1000 * 1000) {
|
if (stopwatch > 50 * 1000 * 1000) {
|
||||||
stopwatch = 0;
|
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;
|
JumpToApp = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +203,6 @@ void jump_to_app()
|
|||||||
Jump_To_Application();
|
Jump_To_Application();
|
||||||
} else {
|
} else {
|
||||||
DeviceState = failed_jump;
|
DeviceState = failed_jump;
|
||||||
JumpToApp = FALSE;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,10 @@ int main()
|
|||||||
PIOS_Board_Init();
|
PIOS_Board_Init();
|
||||||
PIOS_IAP_Init();
|
PIOS_IAP_Init();
|
||||||
|
|
||||||
|
// Without vsense pin, need to wait for correct PIOS_USB_CableConnected detection.
|
||||||
|
// This break DSM binding process but allows firmware rescue.
|
||||||
|
PIOS_DELAY_WaitmS(500);
|
||||||
|
|
||||||
USB_connected = PIOS_USB_CableConnected(0);
|
USB_connected = PIOS_USB_CableConnected(0);
|
||||||
|
|
||||||
if (PIOS_IAP_CheckRequest() == TRUE) {
|
if (PIOS_IAP_CheckRequest() == TRUE) {
|
||||||
@ -165,7 +169,7 @@ int main()
|
|||||||
if (stopwatch > 50 * 1000 * 1000) {
|
if (stopwatch > 50 * 1000 * 1000) {
|
||||||
stopwatch = 0;
|
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;
|
JumpToApp = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +203,6 @@ void jump_to_app()
|
|||||||
Jump_To_Application();
|
Jump_To_Application();
|
||||||
} else {
|
} else {
|
||||||
DeviceState = failed_jump;
|
DeviceState = failed_jump;
|
||||||
JumpToApp = FALSE;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user