Make sure that long reads are aborted early if the connection times out while waiting...
[pub/USBasp.git] / LUFA / ManPages / SoftwareBootloaderJump.txt
index afdc0b3..3f6e305 100644 (file)
  *  #define MAGIC_BOOT_KEY            0xDC42ACCA\r
  *  #define BOOTLOADER_START_ADDRESS  ({FLASH_SIZE_BYTES} - {BOOTLOADER_SEC_SIZE_BYTES})\r
  *  \r
- *  int Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3);\r
- *  int Bootloader_Jump_Check(void)\r
+ *  void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3);\r
+ *  void Bootloader_Jump_Check(void)\r
  *  {\r
- *      // If the bootloader key is correct, clear it and jump to the bootloader\r
- *      if (Boot_Key == MAGIC_BOOT_KEY)\r
+ *      // If the reset source was the bootloader and the key is correct, clear it and jump to the bootloader\r
+ *      if ((MCUSR & (1<<WDRF)) && (Boot_Key == MAGIC_BOOT_KEY))\r
  *      {\r
  *          Boot_Key = 0;\r
  *          ((void (*)(void))BOOTLOADER_START_ADDRESS)(); \r