From b3980122bb576e7c1cf259e38d53ea7201653645 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 16 Sep 2019 18:42:50 +0900 Subject: [PATCH] core: Fix comment and remove unused code --- tmk_core/common/avr/bootloader.c | 115 ++++--------------------------- 1 file changed, 15 insertions(+), 100 deletions(-) diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index 8d6de1a0..31d9a3ba 100644 --- a/tmk_core/common/avr/bootloader.c +++ b/tmk_core/common/avr/bootloader.c @@ -16,8 +16,8 @@ * AVR Boot section size are defined by setting BOOTSZ fuse in fact. Consult with your MCU datasheet. * Note that 'Word'(2 bytes) size and address are used in datasheet while TMK uses 'Byte'. * - * * Size of Bootloaders in bytes: + * Atmel DFU loader(ATmega32U2) 4096 * Atmel DFU loader(ATmega32U4) 4096 * Atmel DFU loader(AT90USB128) 8192 * LUFA bootloader(ATmega32U4) 4096 @@ -27,33 +27,19 @@ * Teensy++ halfKay(AT90USB128) 1024 * * - * AVR Boot section is located at the end of Flash memory like the followings. - * - * - * byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-4KB | | 128KB-8KB - * 0x6000 +---------------+ 0x1FC00 +---------------+ - * | Bootloader | 4KB | Bootloader | 8KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ - * + * AVR Boot section is located at the end of Flash memory. * - * byte Teensy(ATMega32u4) byte Teensy++(AT90SUB128) - * 0x0000 +---------------+ 0x00000 +---------------+ - * | | | | - * | | | | - * | Application | | Application | - * | | | | - * = = = = - * | | 32KB-512B | | 128KB-1KB - * 0x7E00 +---------------+ 0x1FC00 +---------------+ - * | Bootloader | 512B | Bootloader | 1KB - * 0x7FFF +---------------+ 0x1FFFF +---------------+ + * byte ATMega32u4 with 4096-byte Boot section + * 0x0000 +---------------+ + * | | + * | | + * | Application | 28KB + * | | + * = = + * | | + * 0x7000 +---------------+ <---- BOOTLOADER_START + * | Bootloader | 4KB BOOTLOADER_SIZE + * 0x7FFF +---------------+ <---- FLASHEND */ #ifndef BOOTLOADER_SIZE #warning To use bootloader_jump() you need to define BOOTLOADER_SIZE in config.h. @@ -64,8 +50,8 @@ #define BOOTLOADER_START (FLASH_SIZE - BOOTLOADER_SIZE) -/* - * Entering the Bootloader via Software +/* + * Entering the Bootloader via Software * http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html */ #define BOOTLOADER_RESET_KEY 0xB007B007 @@ -127,74 +113,3 @@ void bootloader_jump_after_watchdog_reset(void) ((void (*)(void))(BOOTLOADER_START/2))(); } } - - -#if 0 -/* Jumping To The Bootloader - * http://www.pjrc.com/teensy/jump_to_bootloader.html - * - * This method doen't work when using LUFA. idk why. - * - needs to initialize more regisers or interrupt setting? - */ -void bootloader_jump(void) { -#ifdef PROTOCOL_LUFA - USB_Disable(); - cli(); - _delay_ms(2000); -#endif - -#ifdef PROTOCOL_PJRC - cli(); - UDCON = 1; - USBCON = (1<