UnlockFlash called only one time (or it reboots at the 2nd time)
This commit is contained in:
@@ -694,7 +694,13 @@ void flashBootloader(const char * filename)
|
|||||||
UINT count;
|
UINT count;
|
||||||
lcd_rect(3, 6*FH+4, 204, 7);
|
lcd_rect(3, 6*FH+4, 204, 7);
|
||||||
watchdogSetTimeout(1000/*10s*/);
|
watchdogSetTimeout(1000/*10s*/);
|
||||||
unlockFlash();
|
|
||||||
|
static uint8_t unlocked = 0;
|
||||||
|
if (!unlocked) {
|
||||||
|
unlocked = 1;
|
||||||
|
unlockFlash();
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
|
for (int i=0; i<BOOTLOADER_SIZE; i+=1024) {
|
||||||
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
|
if (f_read(&file, buffer, 1024, &count) != FR_OK || count != 1024) {
|
||||||
// TODO popup error
|
// TODO popup error
|
||||||
|
|||||||
Reference in New Issue
Block a user