From: tmk Date: Sat, 30 Jun 2012 02:19:07 +0000 (+0900) Subject: Fix bootloader.c X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=f427529a30487de45ebfbe6fbba9c290738878ab;p=max%2Ftmk_keyboard.git Fix bootloader.c --- diff --git a/common/bootloader.c b/common/bootloader.c index 5cbfc72e..cb971c70 100644 --- a/common/bootloader.c +++ b/common/bootloader.c @@ -1,22 +1,56 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. +#include +#include +#include +#include "bootloader.h" -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +/* 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 + */ -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ +/* Boot Section Size in bytes + * Teensy halfKay 512 + * Atmel DFU loader 4096 + * LUFA bootloader 4096 + */ +#ifndef BOOT_SIZE +#define BOOT_SIZE 512 +#endif -#include "bootloader.h" +#define FLASH_SIZE (FLASHEND + 1) +#define BOOTLOADER_START (FLASHEND - BOOT_SIZE) +void bootloader_jump(void) { + cli(); + // disable watchdog, if enabled + // disable all peripherals + UDCON = 1; + USBCON = (1< -#include -#include -#include "bootloader.h" - -void bootloader_jump(void) { - cli(); - // disable watchdog, if enabled - // disable all peripherals - UDCON = 1; - USBCON = (1<