summaryrefslogtreecommitdiff
path: root/Bootloaders/HID
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2012-07-16 17:11:14 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2012-07-16 17:11:14 +0000
commit2eb47bea14a5c98eddcedbc4ff38583d9bfbb1d3 (patch)
tree867b4e0576c989fdca82469a3b644275204c864c /Bootloaders/HID
parenta0a30d5afb506b55655de244f1c7f6b1857279d8 (diff)
Tag for the LUFA-120730-BETA release.LUFA-120730-BETA
git-svn-id: http://lufa-lib.googlecode.com/svn/tags/LUFA-120730-BETA@2407 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Bootloaders/HID')
-rw-r--r--Bootloaders/HID/BootloaderHID.c2
-rw-r--r--Bootloaders/HID/BootloaderHID.h8
-rw-r--r--Bootloaders/HID/makefile41
3 files changed, 25 insertions, 26 deletions
diff --git a/Bootloaders/HID/BootloaderHID.c b/Bootloaders/HID/BootloaderHID.c
index acc351a3..c32dddc1 100644
--- a/Bootloaders/HID/BootloaderHID.c
+++ b/Bootloaders/HID/BootloaderHID.c
@@ -46,7 +46,7 @@ static bool RunBootloader = true;
* low when the application attempts to start via a watchdog reset, the bootloader will re-start. If set to the value
* \ref MAGIC_BOOT_KEY the special init function \ref Application_Jump_Check() will force the application to start.
*/
-uint32_t MagicBootKey ATTR_NO_INIT;
+uint16_t MagicBootKey ATTR_NO_INIT;
/** Special startup routine to check if the bootloader was started via a watchdog reset, and if the magic application
diff --git a/Bootloaders/HID/BootloaderHID.h b/Bootloaders/HID/BootloaderHID.h
index af2812a7..e83aad33 100644
--- a/Bootloaders/HID/BootloaderHID.h
+++ b/Bootloaders/HID/BootloaderHID.h
@@ -30,11 +30,11 @@
/** \file
*
- * Header file for TeensyHID.c.
+ * Header file for BootloaderHID.c.
*/
-#ifndef _TEENSYHID_H_
-#define _TEENSYHID_H_
+#ifndef _BOOTLOADERHID_H_
+#define _BOOTLOADERHID_H_
/* Includes: */
#include <avr/io.h>
@@ -53,7 +53,7 @@
#define COMMAND_STARTAPPLICATION 0xFFFF
/** Magic bootloader key to unlock forced application start mode. */
- #define MAGIC_BOOT_KEY 0xDC42CACA
+ #define MAGIC_BOOT_KEY 0xDC42
/* Function Prototypes: */
static void SetupHardware(void);
diff --git a/Bootloaders/HID/makefile b/Bootloaders/HID/makefile
index 9e33f7bf..b6477f96 100644
--- a/Bootloaders/HID/makefile
+++ b/Bootloaders/HID/makefile
@@ -9,20 +9,6 @@
# LUFA Project Makefile.
# --------------------------------------
-# Starting byte address of the bootloader, as a byte address - computed via the formula
-# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024)
-#
-# Note that the bootloader size and start address given in AVRStudio is in words and not
-# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
-FLASH_SIZE_KB = 128
-BOOT_SECTION_SIZE_KB = 8
-
-# Formulas used to calculate the starting address of the Bootloader section, and the User Application
-# API jump table (for more information on the latter, see the bootloader documentation). These formulas
-# should not need to be altered - modify the FLASH_SIZE_KB and BOOT_SECTION_KB values above instead.
-BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
-BOOT_API_TABLESTART = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - 96)" | bc)
-
MCU = at90usb1287
ARCH = AVR8
BOARD = USBKEY
@@ -31,16 +17,29 @@ F_USB = $(F_CPU)
OPTIMIZATION = s
TARGET = BootloaderHID
SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB)
-LUFA_PATH = ../../LUFA/
+LUFA_PATH = ../../LUFA
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
-LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START)
+LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET)
+
+# Flash size and bootloader section sizes of the target, in KB. These must
+# match the target's total FLASH size and the bootloader size set in the
+# device's fuses.
+FLASH_SIZE_KB := 128
+BOOT_SECTION_SIZE_KB := 8
+
+# Bootloader address calculation formulas (requires the "bc" unix utility)
+# Do not modify these macros, but rather modify the depedant values above.
+BOOT_START_OFFSET = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc)
+BOOT_SEC_OFFSET = 0x$(shell echo "obase=16; (($(FLASH_SIZE_KB) * 1024) - $(strip $(1)))" | bc)
# Default target
all:
# Include LUFA build script makefiles
-include $(LUFA_PATH)/Build/lufa.core.in
-include $(LUFA_PATH)/Build/lufa.sources.in
-include $(LUFA_PATH)/Build/lufa.build.in
-include $(LUFA_PATH)/Build/lufa.doxygen.in
-include $(LUFA_PATH)/Build/lufa.avrdude.in
+include $(LUFA_PATH)/Build/lufa_core.mk
+include $(LUFA_PATH)/Build/lufa_sources.mk
+include $(LUFA_PATH)/Build/lufa_build.mk
+include $(LUFA_PATH)/Build/lufa_cppcheck.mk
+include $(LUFA_PATH)/Build/lufa_doxygen.mk
+include $(LUFA_PATH)/Build/lufa_avrdude.mk
+include $(LUFA_PATH)/Build/lufa_atprogram.mk