#include #include #include #include "bootloader.h" /* Start Bootloader from Application * See * http://www.pjrc.com/teensy/jump_to_bootloader.html * http://www.fourwalledcubicle.com/files/LUFA/Doc/120219/html/_page__software_bootloader_start.html */ // TODO: support usbasp /* Boot Section Size in bytes * Teensy halfKay 512 * Atmel DFU loader 4096 * LUFA bootloader 4096 */ #ifndef BOOT_SIZE #define BOOT_SIZE 512 #endif #define FLASH_SIZE (FLASHEND + 1) #define BOOTLOADER_START (FLASHEND - BOOT_SIZE) void bootloader_jump(void) { cli(); // //Teensy // #if defined(__AVR_AT90USB162__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) // disable watchdog, if enabled // disable all peripherals UDCON = 1; USBCON = (1<