1
0
Fork 0

Always run subsequent upload in fast_mode after bootloader upgrade

This commit is contained in:
Shawn Nock 2019-06-18 15:10:14 -04:00
parent ed9e766423
commit 5b9a07c92f
1 changed files with 3 additions and 1 deletions

View File

@ -405,6 +405,7 @@ void do_upload(char *filename, bool fast_mode){
void fix_and_upload(char *filename) {
char *version = get_version();
bool has_new_bootloader = false;
if (version && !strcmp(version, "0.3.2.0") ) {
// Upload bootloader update payload
printf("Bootloader update required, uploading...\n");
@ -424,11 +425,12 @@ void fix_and_upload(char *filename) {
printf("Reseting into new bootloader\n");
gpio_ble_req_bootloader();
usleep(50000);
has_new_bootloader = true;
}
// Do the update
printf("Writing %s into slot 1\n", filename);
do_upload(filename, image_get_fast_mode());
do_upload(filename, image_get_fast_mode() || has_new_bootloader); // If we just updated the BL, it supports fast
}
void image_main(int fd, int argc, char **argv){