- Check, if reset vector points to an application before leaving the
Bootloader after 5 seconds timeout
- Bugfix wrong test of reset vector from mainline
Delay_MS(1);
if (i++ > 5000)
{
- break;
+ if (pgm_read_word_near(0) != 0xFFFF)
+ break;
+ else
+ i = 0;
}
}
else
else // Start via jump
{
/* Set the flag to terminate the bootloader at next opportunity if a valid application has been loaded */
- if (pgm_read_word_near(0) == 0xFFFF)
+ if (pgm_read_word_near(0) != 0xFFFF)
RunBootloader = false;
}
}