1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00

UnlockFlash called only one time (or it reboots at the 2nd time)

This commit is contained in:
bsongis 2014-04-08 22:10:12 +02:00
parent 31183cb840
commit a84427e260

View file

@ -694,7 +694,13 @@ void flashBootloader(const char * filename)
UINT count;
lcd_rect(3, 6*FH+4, 204, 7);
watchdogSetTimeout(1000/*10s*/);
unlockFlash();
static uint8_t unlocked = 0;
if (!unlocked) {
unlocked = 1;
unlockFlash();
}
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
// TODO popup error