mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
Fixes #1241 - Revert "Bootloader now accessible with left OR right trim inwards"
This reverts commit 54447a45a0
.
This commit is contained in:
parent
72dc022dc9
commit
e50d9c0edf
1 changed files with 21 additions and 19 deletions
|
@ -100,28 +100,30 @@ void _bootStart()
|
||||||
bwdt_reset();
|
bwdt_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((GPIOC->IDR & 0x00000002) == 0) || ((GPIOE->IDR & 0x00000008) == 0)) {
|
if ((GPIOE->IDR & 0x00000008) == 0) {
|
||||||
// Bootloader needed
|
if ((GPIOC->IDR & 0x00000002) == 0) {
|
||||||
const uint8_t *src;
|
// Bootloader needed
|
||||||
uint8_t *dest;
|
const uint8_t *src;
|
||||||
uint32_t size;
|
uint8_t *dest;
|
||||||
|
uint32_t size;
|
||||||
|
|
||||||
bwdt_reset();
|
bwdt_reset();
|
||||||
size = sizeof(BootCode);
|
size = sizeof(BootCode);
|
||||||
src = BootCode;
|
src = BootCode;
|
||||||
dest = (uint8_t *) 0x20000000;
|
dest = (uint8_t *) 0x20000000;
|
||||||
|
|
||||||
|
for (; size; size -= 1) {
|
||||||
|
*dest++ = *src++;
|
||||||
|
}
|
||||||
|
// Could check for a valid copy to RAM here
|
||||||
|
// Go execute bootloader
|
||||||
|
bwdt_reset();
|
||||||
|
|
||||||
|
uint32_t address = *(uint32_t *) 0x20000004;
|
||||||
|
|
||||||
|
((void (*)(void)) (address))(); // Go execute the loaded application
|
||||||
|
|
||||||
for (; size; size -= 1) {
|
|
||||||
*dest++ = *src++;
|
|
||||||
}
|
}
|
||||||
// Could check for a valid copy to RAM here
|
|
||||||
// Go execute bootloader
|
|
||||||
bwdt_reset();
|
|
||||||
|
|
||||||
uint32_t address = *(uint32_t *) 0x20000004;
|
|
||||||
|
|
||||||
((void (*)(void)) (address))(); // Go execute the loaded application
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// run_application() ;
|
// run_application() ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue