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

X-Lite bootloader

This commit is contained in:
Bertrand Songis 2018-04-04 16:01:15 +02:00
parent 1b005c83eb
commit fabee0e675

View file

@ -18,11 +18,14 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "opentx.h" #include "opentx.h"
#include "stamp.h"
#include "boot.h" #include "boot.h"
#include "bin_files.h" #include "bin_files.h"
#if defined(PCBXLITE)
#define BOOTLOADER_KEYS 0x0f
#else
#define BOOTLOADER_KEYS 0x42
#endif
#define APP_START_ADDRESS (uint32_t)(FIRMWARE_ADDRESS + BOOTLOADER_SIZE) #define APP_START_ADDRESS (uint32_t)(FIRMWARE_ADDRESS + BOOTLOADER_SIZE)
#if defined(EEPROM) #if defined(EEPROM)
@ -63,9 +66,6 @@ uint32_t eepromAddress = 0;
uint32_t eepromWritten = 0; uint32_t eepromWritten = 0;
#endif #endif
//TCHAR backupFilename[_MAX_LFN+1];
//uint32_t Master_frequency;
volatile uint8_t Tenms = 1; volatile uint8_t Tenms = 1;
FlashCheckRes Valid; FlashCheckRes Valid;
@ -171,8 +171,6 @@ int menuFlashFile(uint32_t index, event_t event)
return -1; return -1;
} }
extern Key keys[];
static uint32_t PowerUpDelay; static uint32_t PowerUpDelay;
void flashWriteBlock() void flashWriteBlock()
@ -228,7 +226,7 @@ int main()
} }
// LHR & RHL trims not pressed simultanously // LHR & RHL trims not pressed simultanously
if (readTrims() != 0x42) { if (readTrims() != BOOTLOADER_KEYS) {
// Start main application // Start main application
jumpTo(APP_START_ADDRESS); jumpTo(APP_START_ADDRESS);
} }