]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge branch 'master' into fix_line_endings
authorFred Sundvik <fsundvik@gmail.com>
Sat, 27 Aug 2016 18:01:46 +0000 (21:01 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sat, 27 Aug 2016 18:01:46 +0000 (21:01 +0300)
40 files changed:
.gitattributes
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
keyboards/chibios_test/ld/MKL26Z64.ld
keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
keyboards/chibios_test/teensy_lc_onekey/chconf.h
keyboards/chibios_test/teensy_lc_onekey/halconf.h
keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
keyboards/gh60/Makefile
keyboards/gh60/config.h
keyboards/gh60/gh60.c
keyboards/gh60/gh60.h
keyboards/gh60/keymaps/robotmaxtron/Makefile
keyboards/gh60/keymaps/robotmaxtron/config.h
keyboards/gh60/pinout.txt
keyboards/gh60/readme.md
keyboards/infinity_chibios/chconf.h
keyboards/infinity_chibios/halconf.h
keyboards/infinity_chibios/mcuconf.h
tmk_core/common/avr/xprintf.S
tmk_core/common/avr/xprintf.h
tmk_core/protocol/iwrap/suart.S
tmk_core/protocol/iwrap/suart.h
tmk_core/protocol/iwrap/wd.h
tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/asf.xml
tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/asf.xml
tmk_core/protocol/lufa/LUFA-git/Bootloaders/HID/asf.xml
tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/BootloaderAPITable.S
tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/asf.xml
tmk_core/protocol/lufa/LUFA-git/Bootloaders/MassStorage/makefile
tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/BootloaderAPITable.S
tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/asf.xml
tmk_core/protocol/lufa/LUFA-git/Bootloaders/Printer/makefile
tmk_core/protocol/lufa/LUFA-git/LUFA/Build/HID_EEPROM_Loader/makefile
tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/DeviceTemplate/asf.xml
tmk_core/protocol/lufa/LUFA-git/LUFA/CodeTemplates/HostTemplate/asf.xml
tmk_core/protocol/lufa/LUFA-git/LUFA/DoxygenPages/BuildSystem.txt

index 8fd1fd7525a7f2209234a6ac03701e94e4255b7e..92dfc3c617709e2666e384a0c5945c84f0b569b1 100644 (file)
@@ -91,3 +91,4 @@ GRAPHICS
 
 # hex files
 *.hex binary
+*.eep binary
index 31319ef57528338e51c6749ef46e88e73ad6bf9e..2809c9d184ed1a982dff98a14577cc9f70302d48 100644 (file)
@@ -1,49 +1,49 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#include "hal.h"\r
-\r
-/**\r
- * @brief   PAL setup.\r
- * @details Digital I/O ports static configuration as defined in @p board.h.\r
- *          This variable is used by the HAL when initializing the PAL driver.\r
- */\r
-#if HAL_USE_PAL || defined(__DOXYGEN__)\r
-const PALConfig pal_default_config =\r
-{\r
-  {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},\r
-  {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},\r
-  {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},\r
-  {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},\r
-  {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},\r
-};\r
-#endif\r
-\r
-/*\r
- * Early initialization code.\r
- * This initialization must be performed just after stack setup and before\r
- * any other initialization.\r
- */\r
-void __early_init(void) {\r
-\r
-  stm32_clock_init();\r
-}\r
-\r
-/*\r
- * Board-specific initialization code.\r
- */\r
-void boardInit(void) {\r
-}\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#include "hal.h"
+
+/**
+ * @brief   PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ *          This variable is used by the HAL when initializing the PAL driver.
+ */
+#if HAL_USE_PAL || defined(__DOXYGEN__)
+const PALConfig pal_default_config =
+{
+  {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
+  {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
+  {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
+  {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
+  {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
+};
+#endif
+
+/*
+ * Early initialization code.
+ * This initialization must be performed just after stack setup and before
+ * any other initialization.
+ */
+void __early_init(void) {
+
+  stm32_clock_init();
+}
+
+/*
+ * Board-specific initialization code.
+ */
+void boardInit(void) {
+}
index 7253e7782634bf4e4c327598eaa4ba29f21b0b10..b31d74307b3dd93e85f1b22bfbe08cbc67a1626c 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _BOARD_H_\r
-#define _BOARD_H_\r
-\r
-/*\r
- * Setup for a Generic STM32F103 board.\r
- */\r
-\r
-/*\r
- * Board identifier.\r
- */\r
-#define BOARD_GENERIC_STM32_F103\r
-#define BOARD_NAME              "Generic STM32F103x board"\r
-\r
-/*\r
- * Board frequencies.\r
- */\r
-#define STM32_LSECLK            32768\r
-#define STM32_HSECLK            8000000\r
-\r
-/*\r
- * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.\r
- */\r
-#define STM32F103xB\r
-\r
-/*\r
- * IO pins assignments\r
- */\r
-\r
-/* on-board */\r
-\r
-#define GPIOC_LED               13\r
-#define GPIOD_OSC_IN            0\r
-#define GPIOD_OSC_OUT           1\r
-\r
-/* In case your board has a "USB enable" hardware\r
-   controlled by a pin, define it here. (It could be just\r
-   a 1.5k resistor connected to D+ line.)\r
-*/\r
-/*\r
-#define GPIOB_USB_DISC          10\r
-*/\r
-\r
-/*\r
- * I/O ports initial setup, this configuration is established soon after reset\r
- * in the initialization code.\r
- *\r
- * The digits have the following meaning:\r
- *   0 - Analog input.\r
- *   1 - Push Pull output 10MHz.\r
- *   2 - Push Pull output 2MHz.\r
- *   3 - Push Pull output 50MHz.\r
- *   4 - Digital input.\r
- *   5 - Open Drain output 10MHz.\r
- *   6 - Open Drain output 2MHz.\r
- *   7 - Open Drain output 50MHz.\r
- *   8 - Digital input with PullUp or PullDown resistor depending on ODR.\r
- *   9 - Alternate Push Pull output 10MHz.\r
- *   A - Alternate Push Pull output 2MHz.\r
- *   B - Alternate Push Pull output 50MHz.\r
- *   C - Reserved.\r
- *   D - Alternate Open Drain output 10MHz.\r
- *   E - Alternate Open Drain output 2MHz.\r
- *   F - Alternate Open Drain output 50MHz.\r
- * Please refer to the STM32 Reference Manual for details.\r
- */\r
-\r
-/*\r
- * Port A setup.\r
- * Everything input with pull-up except:\r
- * PA2  - Alternate output  (USART2 TX).\r
- * PA3  - Normal input      (USART2 RX).\r
- * PA9  - Alternate output  (USART1 TX).\r
- * PA10 - Normal input      (USART1 RX).\r
- */\r
-#define VAL_GPIOACRL            0x88884B88      /*  PA7...PA0 */\r
-#define VAL_GPIOACRH            0x888884B8      /* PA15...PA8 */\r
-#define VAL_GPIOAODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port B setup.\r
- * Everything input with pull-up except:\r
- * PB10    - Push Pull output  (USB switch).\r
- */\r
-#define VAL_GPIOBCRL            0x88888888      /*  PB7...PB0 */\r
-#define VAL_GPIOBCRH            0x88888388      /* PB15...PB8 */\r
-#define VAL_GPIOBODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port C setup.\r
- * Everything input with pull-up except:\r
- * PC13    - Push Pull output  (LED).\r
- */\r
-#define VAL_GPIOCCRL            0x88888888      /*  PC7...PC0 */\r
-#define VAL_GPIOCCRH            0x88388888      /* PC15...PC8 */\r
-#define VAL_GPIOCODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port D setup.\r
- * Everything input with pull-up except:\r
- * PD0  - Normal input (XTAL).\r
- * PD1  - Normal input (XTAL).\r
- */\r
-#define VAL_GPIODCRL            0x88888844      /*  PD7...PD0 */\r
-#define VAL_GPIODCRH            0x88888888      /* PD15...PD8 */\r
-#define VAL_GPIODODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port E setup.\r
- * Everything input with pull-up except:\r
- */\r
-#define VAL_GPIOECRL            0x88888888      /*  PE7...PE0 */\r
-#define VAL_GPIOECRH            0x88888888      /* PE15...PE8 */\r
-#define VAL_GPIOEODR            0xFFFFFFFF\r
-\r
-/*\r
- * USB bus activation macro, required by the USB driver.\r
- */\r
-/* The point is that most of the generic STM32F103* boards\r
-   have a 1.5k resistor connected on one end to the D+ line\r
-   and on the other end to some pin. Or even a slightly more\r
-   complicated "USB enable" circuit, controlled by a pin.\r
-   That should go here.\r
-\r
-   However on some boards (e.g. one that I have), there's no\r
-   such hardware. In which case it's better to not do anything.\r
-*/\r
-/*\r
-#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);\r
-\r
-/*\r
- * USB bus de-activation macro, required by the USB driver.\r
- */\r
-/*\r
-#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);\r
-\r
-#if !defined(_FROM_ASM_)\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-  void boardInit(void);\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* _FROM_ASM_ */\r
-\r
-#endif /* _BOARD_H_ */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+/*
+ * Setup for a Generic STM32F103 board.
+ */
+
+/*
+ * Board identifier.
+ */
+#define BOARD_GENERIC_STM32_F103
+#define BOARD_NAME              "Generic STM32F103x board"
+
+/*
+ * Board frequencies.
+ */
+#define STM32_LSECLK            32768
+#define STM32_HSECLK            8000000
+
+/*
+ * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
+ */
+#define STM32F103xB
+
+/*
+ * IO pins assignments
+ */
+
+/* on-board */
+
+#define GPIOC_LED               13
+#define GPIOD_OSC_IN            0
+#define GPIOD_OSC_OUT           1
+
+/* In case your board has a "USB enable" hardware
+   controlled by a pin, define it here. (It could be just
+   a 1.5k resistor connected to D+ line.)
+*/
+/*
+#define GPIOB_USB_DISC          10
+*/
+
+/*
+ * I/O ports initial setup, this configuration is established soon after reset
+ * in the initialization code.
+ *
+ * The digits have the following meaning:
+ *   0 - Analog input.
+ *   1 - Push Pull output 10MHz.
+ *   2 - Push Pull output 2MHz.
+ *   3 - Push Pull output 50MHz.
+ *   4 - Digital input.
+ *   5 - Open Drain output 10MHz.
+ *   6 - Open Drain output 2MHz.
+ *   7 - Open Drain output 50MHz.
+ *   8 - Digital input with PullUp or PullDown resistor depending on ODR.
+ *   9 - Alternate Push Pull output 10MHz.
+ *   A - Alternate Push Pull output 2MHz.
+ *   B - Alternate Push Pull output 50MHz.
+ *   C - Reserved.
+ *   D - Alternate Open Drain output 10MHz.
+ *   E - Alternate Open Drain output 2MHz.
+ *   F - Alternate Open Drain output 50MHz.
+ * Please refer to the STM32 Reference Manual for details.
+ */
+
+/*
+ * Port A setup.
+ * Everything input with pull-up except:
+ * PA2  - Alternate output  (USART2 TX).
+ * PA3  - Normal input      (USART2 RX).
+ * PA9  - Alternate output  (USART1 TX).
+ * PA10 - Normal input      (USART1 RX).
+ */
+#define VAL_GPIOACRL            0x88884B88      /*  PA7...PA0 */
+#define VAL_GPIOACRH            0x888884B8      /* PA15...PA8 */
+#define VAL_GPIOAODR            0xFFFFFFFF
+
+/*
+ * Port B setup.
+ * Everything input with pull-up except:
+ * PB10    - Push Pull output  (USB switch).
+ */
+#define VAL_GPIOBCRL            0x88888888      /*  PB7...PB0 */
+#define VAL_GPIOBCRH            0x88888388      /* PB15...PB8 */
+#define VAL_GPIOBODR            0xFFFFFFFF
+
+/*
+ * Port C setup.
+ * Everything input with pull-up except:
+ * PC13    - Push Pull output  (LED).
+ */
+#define VAL_GPIOCCRL            0x88888888      /*  PC7...PC0 */
+#define VAL_GPIOCCRH            0x88388888      /* PC15...PC8 */
+#define VAL_GPIOCODR            0xFFFFFFFF
+
+/*
+ * Port D setup.
+ * Everything input with pull-up except:
+ * PD0  - Normal input (XTAL).
+ * PD1  - Normal input (XTAL).
+ */
+#define VAL_GPIODCRL            0x88888844      /*  PD7...PD0 */
+#define VAL_GPIODCRH            0x88888888      /* PD15...PD8 */
+#define VAL_GPIODODR            0xFFFFFFFF
+
+/*
+ * Port E setup.
+ * Everything input with pull-up except:
+ */
+#define VAL_GPIOECRL            0x88888888      /*  PE7...PE0 */
+#define VAL_GPIOECRH            0x88888888      /* PE15...PE8 */
+#define VAL_GPIOEODR            0xFFFFFFFF
+
+/*
+ * USB bus activation macro, required by the USB driver.
+ */
+/* The point is that most of the generic STM32F103* boards
+   have a 1.5k resistor connected on one end to the D+ line
+   and on the other end to some pin. Or even a slightly more
+   complicated "USB enable" circuit, controlled by a pin.
+   That should go here.
+
+   However on some boards (e.g. one that I have), there's no
+   such hardware. In which case it's better to not do anything.
+*/
+/*
+#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
+*/
+#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
+
+/*
+ * USB bus de-activation macro, required by the USB driver.
+ */
+/*
+#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
+*/
+#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
+
+#if !defined(_FROM_ASM_)
+#ifdef __cplusplus
+extern "C" {
+#endif
+  void boardInit(void);
+#ifdef __cplusplus
+}
+#endif
+#endif /* _FROM_ASM_ */
+
+#endif /* _BOARD_H_ */
index d692c0ee460d1e8cc2b316f5d7308929b50ccbee..48e0e51fe670e9c8405538e1fc21b71de0903abf 100644 (file)
@@ -1,5 +1,5 @@
-# List of all the board related files.\r
-BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c\r
-\r
-# Required include directories\r
-BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103\r
+# List of all the board related files.
+BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c
+
+# Required include directories
+BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103
index fb141f888cef12c77e6080e37a5db877b87701e8..c4ca8b874cca1f9a05aab983600861d84336ef34 100644 (file)
-/*\r
- * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com\r
- *           (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining\r
- * a copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in\r
- * all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- */\r
-\r
-/*\r
- * KL26Z64 memory setup.\r
- */\r
-MEMORY\r
-{\r
-  flash0   : org = 0x00000000, len = 0x100\r
-  flash1   : org = 0x00000400, len = 0x10\r
-  flash2   : org = 0x00000410, len = 62k - 0x410\r
-  flash3   : org = 0x0000F800, len = 2k\r
-  flash4   : org = 0x00000000, len = 0\r
-  flash5   : org = 0x00000000, len = 0\r
-  flash6   : org = 0x00000000, len = 0\r
-  flash7   : org = 0x00000000, len = 0\r
-  ram0     : org = 0x1FFFF800, len = 8k\r
-  ram1     : org = 0x00000000, len = 0\r
-  ram2     : org = 0x00000000, len = 0\r
-  ram3     : org = 0x00000000, len = 0\r
-  ram4     : org = 0x00000000, len = 0\r
-  ram5     : org = 0x00000000, len = 0\r
-  ram6     : org = 0x00000000, len = 0\r
-  ram7     : org = 0x00000000, len = 0\r
-}\r
-\r
-/* Flash region for the configuration bytes.*/\r
-SECTIONS\r
-{\r
-  .cfmprotect : ALIGN(4) SUBALIGN(4)\r
-  {\r
-    KEEP(*(.cfmconfig))\r
-  } > flash1\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
-   and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash2);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash2);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash2);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash2);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
-   of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
-   the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash2);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-__eeprom_workarea_start__ = ORIGIN(flash3);\r
-__eeprom_workarea_size__  = LENGTH(flash3);\r
-__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r
+/*
+ * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com
+ *           (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * KL26Z64 memory setup.
+ */
+MEMORY
+{
+  flash0   : org = 0x00000000, len = 0x100
+  flash1   : org = 0x00000400, len = 0x10
+  flash2   : org = 0x00000410, len = 62k - 0x410
+  flash3   : org = 0x0000F800, len = 2k
+  flash4   : org = 0x00000000, len = 0
+  flash5   : org = 0x00000000, len = 0
+  flash6   : org = 0x00000000, len = 0
+  flash7   : org = 0x00000000, len = 0
+  ram0     : org = 0x1FFFF800, len = 8k
+  ram1     : org = 0x00000000, len = 0
+  ram2     : org = 0x00000000, len = 0
+  ram3     : org = 0x00000000, len = 0
+  ram4     : org = 0x00000000, len = 0
+  ram5     : org = 0x00000000, len = 0
+  ram6     : org = 0x00000000, len = 0
+  ram7     : org = 0x00000000, len = 0
+}
+
+/* Flash region for the configuration bytes.*/
+SECTIONS
+{
+  .cfmprotect : ALIGN(4) SUBALIGN(4)
+  {
+    KEEP(*(.cfmconfig))
+  } > flash1
+}
+
+/* For each data/text section two region are defined, a virtual region
+   and a load region (_LMA suffix).*/
+
+/* Flash region to be used for exception vectors.*/
+REGION_ALIAS("VECTORS_FLASH", flash0);
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
+
+/* Flash region to be used for constructors and destructors.*/
+REGION_ALIAS("XTORS_FLASH", flash2);
+REGION_ALIAS("XTORS_FLASH_LMA", flash2);
+
+/* Flash region to be used for code text.*/
+REGION_ALIAS("TEXT_FLASH", flash2);
+REGION_ALIAS("TEXT_FLASH_LMA", flash2);
+
+/* Flash region to be used for read only data.*/
+REGION_ALIAS("RODATA_FLASH", flash2);
+REGION_ALIAS("RODATA_FLASH_LMA", flash2);
+
+/* Flash region to be used for various.*/
+REGION_ALIAS("VARIOUS_FLASH", flash2);
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);
+
+/* Flash region to be used for RAM(n) initialization data.*/
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);
+
+/* RAM region to be used for Main stack. This stack accommodates the processing
+   of all exceptions and interrupts.*/
+REGION_ALIAS("MAIN_STACK_RAM", ram0);
+
+/* RAM region to be used for the process stack. This is the stack used by
+   the main() function.*/
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);
+
+/* RAM region to be used for data segment.*/
+REGION_ALIAS("DATA_RAM", ram0);
+REGION_ALIAS("DATA_RAM_LMA", flash2);
+
+/* RAM region to be used for BSS segment.*/
+REGION_ALIAS("BSS_RAM", ram0);
+
+/* RAM region to be used for the default heap.*/
+REGION_ALIAS("HEAP_RAM", ram0);
+
+__eeprom_workarea_start__ = ORIGIN(flash3);
+__eeprom_workarea_size__  = LENGTH(flash3);
+__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;
+
+/* Generic rules inclusion.*/
+INCLUDE rules.ld
index 00613328ed16dfa482f0060698b9327d5bfe5cb4..f9bfe9c005279cbd0b77e0fe9cb2a125dd7b1eb1 100644 (file)
@@ -1,88 +1,88 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/*\r
- * ST32F103xB memory setup for use with the maplemini bootloader.\r
- * You will have to\r
- *     #define CORTEX_VTOR_INIT 0x5000\r
- * in your projects chconf.h\r
- */\r
-MEMORY\r
-{\r
-    flash0  : org = 0x08002000, len = 128k - 0x2000\r
-    flash1  : org = 0x00000000, len = 0\r
-    flash2  : org = 0x00000000, len = 0\r
-    flash3  : org = 0x00000000, len = 0\r
-    flash4  : org = 0x00000000, len = 0\r
-    flash5  : org = 0x00000000, len = 0\r
-    flash6  : org = 0x00000000, len = 0\r
-    flash7  : org = 0x00000000, len = 0\r
-    ram0    : org = 0x20000000, len = 20k\r
-    ram1    : org = 0x00000000, len = 0\r
-    ram2    : org = 0x00000000, len = 0\r
-    ram3    : org = 0x00000000, len = 0\r
-    ram4    : org = 0x00000000, len = 0\r
-    ram5    : org = 0x00000000, len = 0\r
-    ram6    : org = 0x00000000, len = 0\r
-    ram7    : org = 0x00000000, len = 0\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
-   and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash0);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash0);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash0);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash0);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
-   of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
-   the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash0);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r
+/*
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/*
+ * ST32F103xB memory setup for use with the maplemini bootloader.
+ * You will have to
+ *     #define CORTEX_VTOR_INIT 0x5000
+ * in your projects chconf.h
+ */
+MEMORY
+{
+    flash0  : org = 0x08002000, len = 128k - 0x2000
+    flash1  : org = 0x00000000, len = 0
+    flash2  : org = 0x00000000, len = 0
+    flash3  : org = 0x00000000, len = 0
+    flash4  : org = 0x00000000, len = 0
+    flash5  : org = 0x00000000, len = 0
+    flash6  : org = 0x00000000, len = 0
+    flash7  : org = 0x00000000, len = 0
+    ram0    : org = 0x20000000, len = 20k
+    ram1    : org = 0x00000000, len = 0
+    ram2    : org = 0x00000000, len = 0
+    ram3    : org = 0x00000000, len = 0
+    ram4    : org = 0x00000000, len = 0
+    ram5    : org = 0x00000000, len = 0
+    ram6    : org = 0x00000000, len = 0
+    ram7    : org = 0x00000000, len = 0
+}
+
+/* For each data/text section two region are defined, a virtual region
+   and a load region (_LMA suffix).*/
+
+/* Flash region to be used for exception vectors.*/
+REGION_ALIAS("VECTORS_FLASH", flash0);
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
+
+/* Flash region to be used for constructors and destructors.*/
+REGION_ALIAS("XTORS_FLASH", flash0);
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);
+
+/* Flash region to be used for code text.*/
+REGION_ALIAS("TEXT_FLASH", flash0);
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);
+
+/* Flash region to be used for read only data.*/
+REGION_ALIAS("RODATA_FLASH", flash0);
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);
+
+/* Flash region to be used for various.*/
+REGION_ALIAS("VARIOUS_FLASH", flash0);
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
+
+/* Flash region to be used for RAM(n) initialization data.*/
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
+
+/* RAM region to be used for Main stack. This stack accommodates the processing
+   of all exceptions and interrupts.*/
+REGION_ALIAS("MAIN_STACK_RAM", ram0);
+
+/* RAM region to be used for the process stack. This is the stack used by
+   the main() function.*/
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);
+
+/* RAM region to be used for data segment.*/
+REGION_ALIAS("DATA_RAM", ram0);
+REGION_ALIAS("DATA_RAM_LMA", flash0);
+
+/* RAM region to be used for BSS segment.*/
+REGION_ALIAS("BSS_RAM", ram0);
+
+/* RAM region to be used for the default heap.*/
+REGION_ALIAS("HEAP_RAM", ram0);
+
+/* Generic rules inclusion.*/
+INCLUDE rules.ld
index 3d877aaa2b38bd0abb414b535547bd7f164107da..faca3defdf0e9b5ae523eacc050c0513df2829c1 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-/*\r
- * STM32F0xx drivers configuration.\r
- * The following settings override the default settings present in\r
- * the various device driver implementation headers.\r
- * Note that the settings for each driver only have effect if the whole\r
- * driver is enabled in halconf.h.\r
- *\r
- * IRQ priorities:\r
- * 3...0       Lowest...Highest.\r
- *\r
- * DMA priorities:\r
- * 0...3        Lowest...Highest.\r
- */\r
-\r
-#define STM32F0xx_MCUCONF\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#define STM32_NO_INIT                       FALSE\r
-#define STM32_PVD_ENABLE                    FALSE\r
-#define STM32_PLS                           STM32_PLS_LEV0\r
-#define STM32_HSI_ENABLED                   TRUE\r
-#define STM32_HSI14_ENABLED                 TRUE\r
-#define STM32_HSI48_ENABLED                 FALSE\r
-#define STM32_LSI_ENABLED                   TRUE\r
-#define STM32_HSE_ENABLED                   FALSE\r
-#define STM32_LSE_ENABLED                   FALSE\r
-#define STM32_SW                            STM32_SW_PLL\r
-#define STM32_PLLSRC                        STM32_PLLSRC_HSI_DIV2\r
-#define STM32_PREDIV_VALUE                  1\r
-#define STM32_PLLMUL_VALUE                  12\r
-#define STM32_HPRE                          STM32_HPRE_DIV1\r
-#define STM32_PPRE                          STM32_PPRE_DIV1\r
-#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
-#define STM32_USBSW                         STM32_USBSW_HSI48\r
-#define STM32_CECSW                         STM32_CECSW_HSI\r
-#define STM32_I2C1SW                        STM32_I2C1SW_HSI\r
-#define STM32_USART1SW                      STM32_USART1SW_PCLK\r
-#define STM32_RTCSEL                        STM32_RTCSEL_LSI\r
-\r
-/*\r
- * ADC driver system settings.\r
- */\r
-#define STM32_ADC_USE_ADC1                  FALSE\r
-#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
-#define STM32_ADC_IRQ_PRIORITY              2\r
-#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2\r
-\r
-/*\r
- * EXT driver system settings.\r
- */\r
-#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3\r
-#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3\r
-#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3\r
-#define STM32_EXT_EXTI16_IRQ_PRIORITY       3\r
-#define STM32_EXT_EXTI17_IRQ_PRIORITY       3\r
-\r
-/*\r
- * GPT driver system settings.\r
- */\r
-#define STM32_GPT_USE_TIM1                  FALSE\r
-#define STM32_GPT_USE_TIM2                  FALSE\r
-#define STM32_GPT_USE_TIM3                  FALSE\r
-#define STM32_GPT_USE_TIM14                 FALSE\r
-#define STM32_GPT_TIM1_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM2_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM3_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM14_IRQ_PRIORITY        2\r
-\r
-/*\r
- * I2C driver system settings.\r
- */\r
-#define STM32_I2C_USE_I2C1                  FALSE\r
-#define STM32_I2C_USE_I2C2                  FALSE\r
-#define STM32_I2C_BUSY_TIMEOUT              50\r
-#define STM32_I2C_I2C1_IRQ_PRIORITY         3\r
-#define STM32_I2C_I2C2_IRQ_PRIORITY         3\r
-#define STM32_I2C_USE_DMA                   TRUE\r
-#define STM32_I2C_I2C1_DMA_PRIORITY         1\r
-#define STM32_I2C_I2C2_DMA_PRIORITY         1\r
-#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ICU driver system settings.\r
- */\r
-#define STM32_ICU_USE_TIM1                  FALSE\r
-#define STM32_ICU_USE_TIM2                  FALSE\r
-#define STM32_ICU_USE_TIM3                  FALSE\r
-#define STM32_ICU_TIM1_IRQ_PRIORITY         3\r
-#define STM32_ICU_TIM2_IRQ_PRIORITY         3\r
-#define STM32_ICU_TIM3_IRQ_PRIORITY         3\r
-\r
-/*\r
- * PWM driver system settings.\r
- */\r
-#define STM32_PWM_USE_ADVANCED              FALSE\r
-#define STM32_PWM_USE_TIM1                  FALSE\r
-#define STM32_PWM_USE_TIM2                  FALSE\r
-#define STM32_PWM_USE_TIM3                  FALSE\r
-#define STM32_PWM_TIM1_IRQ_PRIORITY         3\r
-#define STM32_PWM_TIM2_IRQ_PRIORITY         3\r
-#define STM32_PWM_TIM3_IRQ_PRIORITY         3\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define STM32_SERIAL_USE_USART1             FALSE\r
-#define STM32_SERIAL_USE_USART2             FALSE\r
-#define STM32_SERIAL_USART1_PRIORITY        3\r
-#define STM32_SERIAL_USART2_PRIORITY        3\r
-\r
-/*\r
- * SPI driver system settings.\r
- */\r
-#define STM32_SPI_USE_SPI1                  FALSE\r
-#define STM32_SPI_USE_SPI2                  FALSE\r
-#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI1_IRQ_PRIORITY         2\r
-#define STM32_SPI_SPI2_IRQ_PRIORITY         2\r
-#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ST driver system settings.\r
- */\r
-#define STM32_ST_IRQ_PRIORITY               2\r
-#define STM32_ST_USE_TIMER                  2\r
-\r
-/*\r
- * UART driver system settings.\r
- */\r
-#define STM32_UART_USE_USART1               FALSE\r
-#define STM32_UART_USE_USART2               FALSE\r
-#define STM32_UART_USART1_IRQ_PRIORITY      3\r
-#define STM32_UART_USART2_IRQ_PRIORITY      3\r
-#define STM32_UART_USART1_DMA_PRIORITY      0\r
-#define STM32_UART_USART2_DMA_PRIORITY      0\r
-#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
-\r
-/*\r
- * USB driver system settings.\r
- */\r
-#define STM32_USB_USE_USB1                  TRUE\r
-#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
-#define STM32_USB_USB1_LP_IRQ_PRIORITY      3\r
-\r
-#endif /* _MCUCONF_H_ */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#ifndef _MCUCONF_H_
+#define _MCUCONF_H_
+
+/*
+ * STM32F0xx drivers configuration.
+ * The following settings override the default settings present in
+ * the various device driver implementation headers.
+ * Note that the settings for each driver only have effect if the whole
+ * driver is enabled in halconf.h.
+ *
+ * IRQ priorities:
+ * 3...0       Lowest...Highest.
+ *
+ * DMA priorities:
+ * 0...3        Lowest...Highest.
+ */
+
+#define STM32F0xx_MCUCONF
+
+/*
+ * HAL driver system settings.
+ */
+#define STM32_NO_INIT                       FALSE
+#define STM32_PVD_ENABLE                    FALSE
+#define STM32_PLS                           STM32_PLS_LEV0
+#define STM32_HSI_ENABLED                   TRUE
+#define STM32_HSI14_ENABLED                 TRUE
+#define STM32_HSI48_ENABLED                 FALSE
+#define STM32_LSI_ENABLED                   TRUE
+#define STM32_HSE_ENABLED                   FALSE
+#define STM32_LSE_ENABLED                   FALSE
+#define STM32_SW                            STM32_SW_PLL
+#define STM32_PLLSRC                        STM32_PLLSRC_HSI_DIV2
+#define STM32_PREDIV_VALUE                  1
+#define STM32_PLLMUL_VALUE                  12
+#define STM32_HPRE                          STM32_HPRE_DIV1
+#define STM32_PPRE                          STM32_PPRE_DIV1
+#define STM32_ADCSW                         STM32_ADCSW_HSI14
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
+#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
+#define STM32_ADCSW                         STM32_ADCSW_HSI14
+#define STM32_USBSW                         STM32_USBSW_HSI48
+#define STM32_CECSW                         STM32_CECSW_HSI
+#define STM32_I2C1SW                        STM32_I2C1SW_HSI
+#define STM32_USART1SW                      STM32_USART1SW_PCLK
+#define STM32_RTCSEL                        STM32_RTCSEL_LSI
+
+/*
+ * ADC driver system settings.
+ */
+#define STM32_ADC_USE_ADC1                  FALSE
+#define STM32_ADC_ADC1_DMA_PRIORITY         2
+#define STM32_ADC_IRQ_PRIORITY              2
+#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2
+
+/*
+ * EXT driver system settings.
+ */
+#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3
+#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3
+#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3
+#define STM32_EXT_EXTI16_IRQ_PRIORITY       3
+#define STM32_EXT_EXTI17_IRQ_PRIORITY       3
+
+/*
+ * GPT driver system settings.
+ */
+#define STM32_GPT_USE_TIM1                  FALSE
+#define STM32_GPT_USE_TIM2                  FALSE
+#define STM32_GPT_USE_TIM3                  FALSE
+#define STM32_GPT_USE_TIM14                 FALSE
+#define STM32_GPT_TIM1_IRQ_PRIORITY         2
+#define STM32_GPT_TIM2_IRQ_PRIORITY         2
+#define STM32_GPT_TIM3_IRQ_PRIORITY         2
+#define STM32_GPT_TIM14_IRQ_PRIORITY        2
+
+/*
+ * I2C driver system settings.
+ */
+#define STM32_I2C_USE_I2C1                  FALSE
+#define STM32_I2C_USE_I2C2                  FALSE
+#define STM32_I2C_BUSY_TIMEOUT              50
+#define STM32_I2C_I2C1_IRQ_PRIORITY         3
+#define STM32_I2C_I2C2_IRQ_PRIORITY         3
+#define STM32_I2C_USE_DMA                   TRUE
+#define STM32_I2C_I2C1_DMA_PRIORITY         1
+#define STM32_I2C_I2C2_DMA_PRIORITY         1
+#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
+
+/*
+ * ICU driver system settings.
+ */
+#define STM32_ICU_USE_TIM1                  FALSE
+#define STM32_ICU_USE_TIM2                  FALSE
+#define STM32_ICU_USE_TIM3                  FALSE
+#define STM32_ICU_TIM1_IRQ_PRIORITY         3
+#define STM32_ICU_TIM2_IRQ_PRIORITY         3
+#define STM32_ICU_TIM3_IRQ_PRIORITY         3
+
+/*
+ * PWM driver system settings.
+ */
+#define STM32_PWM_USE_ADVANCED              FALSE
+#define STM32_PWM_USE_TIM1                  FALSE
+#define STM32_PWM_USE_TIM2                  FALSE
+#define STM32_PWM_USE_TIM3                  FALSE
+#define STM32_PWM_TIM1_IRQ_PRIORITY         3
+#define STM32_PWM_TIM2_IRQ_PRIORITY         3
+#define STM32_PWM_TIM3_IRQ_PRIORITY         3
+
+/*
+ * SERIAL driver system settings.
+ */
+#define STM32_SERIAL_USE_USART1             FALSE
+#define STM32_SERIAL_USE_USART2             FALSE
+#define STM32_SERIAL_USART1_PRIORITY        3
+#define STM32_SERIAL_USART2_PRIORITY        3
+
+/*
+ * SPI driver system settings.
+ */
+#define STM32_SPI_USE_SPI1                  FALSE
+#define STM32_SPI_USE_SPI2                  FALSE
+#define STM32_SPI_SPI1_DMA_PRIORITY         1
+#define STM32_SPI_SPI2_DMA_PRIORITY         1
+#define STM32_SPI_SPI1_IRQ_PRIORITY         2
+#define STM32_SPI_SPI2_IRQ_PRIORITY         2
+#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
+
+/*
+ * ST driver system settings.
+ */
+#define STM32_ST_IRQ_PRIORITY               2
+#define STM32_ST_USE_TIMER                  2
+
+/*
+ * UART driver system settings.
+ */
+#define STM32_UART_USE_USART1               FALSE
+#define STM32_UART_USE_USART2               FALSE
+#define STM32_UART_USART1_IRQ_PRIORITY      3
+#define STM32_UART_USART2_IRQ_PRIORITY      3
+#define STM32_UART_USART1_DMA_PRIORITY      0
+#define STM32_UART_USART2_DMA_PRIORITY      0
+#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
+
+/*
+ * USB driver system settings.
+ */
+#define STM32_USB_USE_USB1                  TRUE
+#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
+#define STM32_USB_USB1_LP_IRQ_PRIORITY      3
+
+#endif /* _MCUCONF_H_ */
index 626332a6aa28bf10f4d299428cbbeb7c190ad86b..276829216ee8e6e70e5ee228c0a6084259baf6ab 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-#define STM32F103_MCUCONF\r
-\r
-/*\r
- * STM32F103 drivers configuration.\r
- * The following settings override the default settings present in\r
- * the various device driver implementation headers.\r
- * Note that the settings for each driver only have effect if the whole\r
- * driver is enabled in halconf.h.\r
- *\r
- * IRQ priorities:\r
- * 15...0       Lowest...Highest.\r
- *\r
- * DMA priorities:\r
- * 0...3        Lowest...Highest.\r
- */\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#define STM32_NO_INIT                       FALSE\r
-#define STM32_HSI_ENABLED                   TRUE\r
-#define STM32_LSI_ENABLED                   FALSE\r
-#define STM32_HSE_ENABLED                   TRUE\r
-#define STM32_LSE_ENABLED                   FALSE\r
-#define STM32_SW                            STM32_SW_PLL\r
-#define STM32_PLLSRC                        STM32_PLLSRC_HSE\r
-#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1\r
-#define STM32_PLLMUL_VALUE                  9\r
-#define STM32_HPRE                          STM32_HPRE_DIV1\r
-#define STM32_PPRE1                         STM32_PPRE1_DIV2\r
-#define STM32_PPRE2                         STM32_PPRE2_DIV2\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_USB_CLOCK_REQUIRED            TRUE\r
-#define STM32_USBPRE                        STM32_USBPRE_DIV1P5\r
-#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
-#define STM32_RTCSEL                        STM32_RTCSEL_HSEDIV\r
-#define STM32_PVD_ENABLE                    FALSE\r
-#define STM32_PLS                           STM32_PLS_LEV0\r
-\r
-/*\r
- * ADC driver system settings.\r
- */\r
-#define STM32_ADC_USE_ADC1                  FALSE\r
-#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
-#define STM32_ADC_ADC1_IRQ_PRIORITY         6\r
-\r
-/*\r
- * CAN driver system settings.\r
- */\r
-#define STM32_CAN_USE_CAN1                  FALSE\r
-#define STM32_CAN_CAN1_IRQ_PRIORITY         11\r
-\r
-/*\r
- * EXT driver system settings.\r
- */\r
-#define STM32_EXT_EXTI0_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI1_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI2_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI3_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI4_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6\r
-#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6\r
-#define STM32_EXT_EXTI16_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI17_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI18_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI19_IRQ_PRIORITY       6\r
-\r
-/*\r
- * GPT driver system settings.\r
- */\r
-#define STM32_GPT_USE_TIM1                  FALSE\r
-#define STM32_GPT_USE_TIM2                  FALSE\r
-#define STM32_GPT_USE_TIM3                  FALSE\r
-#define STM32_GPT_USE_TIM4                  FALSE\r
-#define STM32_GPT_USE_TIM5                  FALSE\r
-#define STM32_GPT_USE_TIM8                  FALSE\r
-#define STM32_GPT_TIM1_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM2_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM3_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM4_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM5_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * I2C driver system settings.\r
- */\r
-#define STM32_I2C_USE_I2C1                  FALSE\r
-#define STM32_I2C_USE_I2C2                  FALSE\r
-#define STM32_I2C_BUSY_TIMEOUT              50\r
-#define STM32_I2C_I2C1_IRQ_PRIORITY         5\r
-#define STM32_I2C_I2C2_IRQ_PRIORITY         5\r
-#define STM32_I2C_I2C1_DMA_PRIORITY         3\r
-#define STM32_I2C_I2C2_DMA_PRIORITY         3\r
-#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ICU driver system settings.\r
- */\r
-#define STM32_ICU_USE_TIM1                  FALSE\r
-#define STM32_ICU_USE_TIM2                  FALSE\r
-#define STM32_ICU_USE_TIM3                  FALSE\r
-#define STM32_ICU_USE_TIM4                  FALSE\r
-#define STM32_ICU_USE_TIM5                  FALSE\r
-#define STM32_ICU_USE_TIM8                  FALSE\r
-#define STM32_ICU_TIM1_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM2_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM3_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM4_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM5_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * PWM driver system settings.\r
- */\r
-#define STM32_PWM_USE_ADVANCED              FALSE\r
-#define STM32_PWM_USE_TIM1                  FALSE\r
-#define STM32_PWM_USE_TIM2                  FALSE\r
-#define STM32_PWM_USE_TIM3                  FALSE\r
-#define STM32_PWM_USE_TIM4                  FALSE\r
-#define STM32_PWM_USE_TIM5                  FALSE\r
-#define STM32_PWM_USE_TIM8                  FALSE\r
-#define STM32_PWM_TIM1_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM2_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM3_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM4_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM5_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * RTC driver system settings.\r
- */\r
-#define STM32_RTC_IRQ_PRIORITY              15\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define STM32_SERIAL_USE_USART1             FALSE\r
-#define STM32_SERIAL_USE_USART2             FALSE\r
-#define STM32_SERIAL_USE_USART3             FALSE\r
-#define STM32_SERIAL_USE_UART4              FALSE\r
-#define STM32_SERIAL_USE_UART5              FALSE\r
-#define STM32_SERIAL_USART1_PRIORITY        12\r
-#define STM32_SERIAL_USART2_PRIORITY        12\r
-#define STM32_SERIAL_USART3_PRIORITY        12\r
-#define STM32_SERIAL_UART4_PRIORITY         12\r
-#define STM32_SERIAL_UART5_PRIORITY         12\r
-\r
-/*\r
- * SPI driver system settings.\r
- */\r
-#define STM32_SPI_USE_SPI1                  FALSE\r
-#define STM32_SPI_USE_SPI2                  FALSE\r
-#define STM32_SPI_USE_SPI3                  FALSE\r
-#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI3_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI1_IRQ_PRIORITY         10\r
-#define STM32_SPI_SPI2_IRQ_PRIORITY         10\r
-#define STM32_SPI_SPI3_IRQ_PRIORITY         10\r
-#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ST driver system settings.\r
- */\r
-#define STM32_ST_IRQ_PRIORITY               8\r
-#define STM32_ST_USE_TIMER                  2\r
-\r
-/*\r
- * UART driver system settings.\r
- */\r
-#define STM32_UART_USE_USART1               FALSE\r
-#define STM32_UART_USE_USART2               FALSE\r
-#define STM32_UART_USE_USART3               FALSE\r
-#define STM32_UART_USART1_IRQ_PRIORITY      12\r
-#define STM32_UART_USART2_IRQ_PRIORITY      12\r
-#define STM32_UART_USART3_IRQ_PRIORITY      12\r
-#define STM32_UART_USART1_DMA_PRIORITY      0\r
-#define STM32_UART_USART2_DMA_PRIORITY      0\r
-#define STM32_UART_USART3_DMA_PRIORITY      0\r
-#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
-\r
-/*\r
- * USB driver system settings.\r
- */\r
-#define STM32_USB_USE_USB1                  TRUE\r
-#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
-#define STM32_USB_USB1_HP_IRQ_PRIORITY      13\r
-#define STM32_USB_USB1_LP_IRQ_PRIORITY      14\r
-\r
-#endif /* _MCUCONF_H_ */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#ifndef _MCUCONF_H_
+#define _MCUCONF_H_
+
+#define STM32F103_MCUCONF
+
+/*
+ * STM32F103 drivers configuration.
+ * The following settings override the default settings present in
+ * the various device driver implementation headers.
+ * Note that the settings for each driver only have effect if the whole
+ * driver is enabled in halconf.h.
+ *
+ * IRQ priorities:
+ * 15...0       Lowest...Highest.
+ *
+ * DMA priorities:
+ * 0...3        Lowest...Highest.
+ */
+
+/*
+ * HAL driver system settings.
+ */
+#define STM32_NO_INIT                       FALSE
+#define STM32_HSI_ENABLED                   TRUE
+#define STM32_LSI_ENABLED                   FALSE
+#define STM32_HSE_ENABLED                   TRUE
+#define STM32_LSE_ENABLED                   FALSE
+#define STM32_SW                            STM32_SW_PLL
+#define STM32_PLLSRC                        STM32_PLLSRC_HSE
+#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1
+#define STM32_PLLMUL_VALUE                  9
+#define STM32_HPRE                          STM32_HPRE_DIV1
+#define STM32_PPRE1                         STM32_PPRE1_DIV2
+#define STM32_PPRE2                         STM32_PPRE2_DIV2
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4
+#define STM32_USB_CLOCK_REQUIRED            TRUE
+#define STM32_USBPRE                        STM32_USBPRE_DIV1P5
+#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK
+#define STM32_RTCSEL                        STM32_RTCSEL_HSEDIV
+#define STM32_PVD_ENABLE                    FALSE
+#define STM32_PLS                           STM32_PLS_LEV0
+
+/*
+ * ADC driver system settings.
+ */
+#define STM32_ADC_USE_ADC1                  FALSE
+#define STM32_ADC_ADC1_DMA_PRIORITY         2
+#define STM32_ADC_ADC1_IRQ_PRIORITY         6
+
+/*
+ * CAN driver system settings.
+ */
+#define STM32_CAN_USE_CAN1                  FALSE
+#define STM32_CAN_CAN1_IRQ_PRIORITY         11
+
+/*
+ * EXT driver system settings.
+ */
+#define STM32_EXT_EXTI0_IRQ_PRIORITY        6
+#define STM32_EXT_EXTI1_IRQ_PRIORITY        6
+#define STM32_EXT_EXTI2_IRQ_PRIORITY        6
+#define STM32_EXT_EXTI3_IRQ_PRIORITY        6
+#define STM32_EXT_EXTI4_IRQ_PRIORITY        6
+#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
+#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
+#define STM32_EXT_EXTI16_IRQ_PRIORITY       6
+#define STM32_EXT_EXTI17_IRQ_PRIORITY       6
+#define STM32_EXT_EXTI18_IRQ_PRIORITY       6
+#define STM32_EXT_EXTI19_IRQ_PRIORITY       6
+
+/*
+ * GPT driver system settings.
+ */
+#define STM32_GPT_USE_TIM1                  FALSE
+#define STM32_GPT_USE_TIM2                  FALSE
+#define STM32_GPT_USE_TIM3                  FALSE
+#define STM32_GPT_USE_TIM4                  FALSE
+#define STM32_GPT_USE_TIM5                  FALSE
+#define STM32_GPT_USE_TIM8                  FALSE
+#define STM32_GPT_TIM1_IRQ_PRIORITY         7
+#define STM32_GPT_TIM2_IRQ_PRIORITY         7
+#define STM32_GPT_TIM3_IRQ_PRIORITY         7
+#define STM32_GPT_TIM4_IRQ_PRIORITY         7
+#define STM32_GPT_TIM5_IRQ_PRIORITY         7
+#define STM32_GPT_TIM8_IRQ_PRIORITY         7
+
+/*
+ * I2C driver system settings.
+ */
+#define STM32_I2C_USE_I2C1                  FALSE
+#define STM32_I2C_USE_I2C2                  FALSE
+#define STM32_I2C_BUSY_TIMEOUT              50
+#define STM32_I2C_I2C1_IRQ_PRIORITY         5
+#define STM32_I2C_I2C2_IRQ_PRIORITY         5
+#define STM32_I2C_I2C1_DMA_PRIORITY         3
+#define STM32_I2C_I2C2_DMA_PRIORITY         3
+#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
+
+/*
+ * ICU driver system settings.
+ */
+#define STM32_ICU_USE_TIM1                  FALSE
+#define STM32_ICU_USE_TIM2                  FALSE
+#define STM32_ICU_USE_TIM3                  FALSE
+#define STM32_ICU_USE_TIM4                  FALSE
+#define STM32_ICU_USE_TIM5                  FALSE
+#define STM32_ICU_USE_TIM8                  FALSE
+#define STM32_ICU_TIM1_IRQ_PRIORITY         7
+#define STM32_ICU_TIM2_IRQ_PRIORITY         7
+#define STM32_ICU_TIM3_IRQ_PRIORITY         7
+#define STM32_ICU_TIM4_IRQ_PRIORITY         7
+#define STM32_ICU_TIM5_IRQ_PRIORITY         7
+#define STM32_ICU_TIM8_IRQ_PRIORITY         7
+
+/*
+ * PWM driver system settings.
+ */
+#define STM32_PWM_USE_ADVANCED              FALSE
+#define STM32_PWM_USE_TIM1                  FALSE
+#define STM32_PWM_USE_TIM2                  FALSE
+#define STM32_PWM_USE_TIM3                  FALSE
+#define STM32_PWM_USE_TIM4                  FALSE
+#define STM32_PWM_USE_TIM5                  FALSE
+#define STM32_PWM_USE_TIM8                  FALSE
+#define STM32_PWM_TIM1_IRQ_PRIORITY         7
+#define STM32_PWM_TIM2_IRQ_PRIORITY         7
+#define STM32_PWM_TIM3_IRQ_PRIORITY         7
+#define STM32_PWM_TIM4_IRQ_PRIORITY         7
+#define STM32_PWM_TIM5_IRQ_PRIORITY         7
+#define STM32_PWM_TIM8_IRQ_PRIORITY         7
+
+/*
+ * RTC driver system settings.
+ */
+#define STM32_RTC_IRQ_PRIORITY              15
+
+/*
+ * SERIAL driver system settings.
+ */
+#define STM32_SERIAL_USE_USART1             FALSE
+#define STM32_SERIAL_USE_USART2             FALSE
+#define STM32_SERIAL_USE_USART3             FALSE
+#define STM32_SERIAL_USE_UART4              FALSE
+#define STM32_SERIAL_USE_UART5              FALSE
+#define STM32_SERIAL_USART1_PRIORITY        12
+#define STM32_SERIAL_USART2_PRIORITY        12
+#define STM32_SERIAL_USART3_PRIORITY        12
+#define STM32_SERIAL_UART4_PRIORITY         12
+#define STM32_SERIAL_UART5_PRIORITY         12
+
+/*
+ * SPI driver system settings.
+ */
+#define STM32_SPI_USE_SPI1                  FALSE
+#define STM32_SPI_USE_SPI2                  FALSE
+#define STM32_SPI_USE_SPI3                  FALSE
+#define STM32_SPI_SPI1_DMA_PRIORITY         1
+#define STM32_SPI_SPI2_DMA_PRIORITY         1
+#define STM32_SPI_SPI3_DMA_PRIORITY         1
+#define STM32_SPI_SPI1_IRQ_PRIORITY         10
+#define STM32_SPI_SPI2_IRQ_PRIORITY         10
+#define STM32_SPI_SPI3_IRQ_PRIORITY         10
+#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")
+
+/*
+ * ST driver system settings.
+ */
+#define STM32_ST_IRQ_PRIORITY               8
+#define STM32_ST_USE_TIMER                  2
+
+/*
+ * UART driver system settings.
+ */
+#define STM32_UART_USE_USART1               FALSE
+#define STM32_UART_USE_USART2               FALSE
+#define STM32_UART_USE_USART3               FALSE
+#define STM32_UART_USART1_IRQ_PRIORITY      12
+#define STM32_UART_USART2_IRQ_PRIORITY      12
+#define STM32_UART_USART3_IRQ_PRIORITY      12
+#define STM32_UART_USART1_DMA_PRIORITY      0
+#define STM32_UART_USART2_DMA_PRIORITY      0
+#define STM32_UART_USART3_DMA_PRIORITY      0
+#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
+
+/*
+ * USB driver system settings.
+ */
+#define STM32_USB_USE_USB1                  TRUE
+#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE
+#define STM32_USB_USB1_HP_IRQ_PRIORITY      13
+#define STM32_USB_USB1_LP_IRQ_PRIORITY      14
+
+#endif /* _MCUCONF_H_ */
index cb36996c33144933b1462787c22248c6dd23b958..3294ac7eeef438ce9137aed5c71f212b6610350f 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/chconf.h\r
- * @brief   Configuration file template.\r
- * @details A copy of this file must be placed in each project directory, it\r
- *          contains the application specific kernel settings.\r
- *\r
- * @addtogroup config\r
- * @details Kernel related settings and hooks.\r
- * @{\r
- */\r
-\r
-#ifndef CHCONF_H\r
-#define CHCONF_H\r
-\r
-#define _CHIBIOS_RT_CONF_\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name System timers settings\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   System time counter resolution.\r
- * @note    Allowed values are 16 or 32 bits.\r
- */\r
-#define CH_CFG_ST_RESOLUTION                32\r
-\r
-/**\r
- * @brief   System tick frequency.\r
- * @details Frequency of the system timer that drives the system ticks. This\r
- *          setting also defines the system tick time unit.\r
- */\r
-#define CH_CFG_ST_FREQUENCY                 1000\r
-\r
-/**\r
- * @brief   Time delta constant for the tick-less mode.\r
- * @note    If this value is zero then the system uses the classic\r
- *          periodic tick. This value represents the minimum number\r
- *          of ticks that is safe to specify in a timeout directive.\r
- *          The value one is not valid, timeouts are rounded up to\r
- *          this value.\r
- */\r
-#define CH_CFG_ST_TIMEDELTA                 0\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel parameters and options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Round robin interval.\r
- * @details This constant is the number of system ticks allowed for the\r
- *          threads before preemption occurs. Setting this value to zero\r
- *          disables the preemption for threads with equal priority and the\r
- *          round robin becomes cooperative. Note that higher priority\r
- *          threads can still preempt, the kernel is always preemptive.\r
- * @note    Disabling the round robin preemption makes the kernel more compact\r
- *          and generally faster.\r
- * @note    The round robin preemption is not supported in tickless mode and\r
- *          must be set to zero in that case.\r
- */\r
-#define CH_CFG_TIME_QUANTUM                 20\r
-\r
-/**\r
- * @brief   Managed RAM size.\r
- * @details Size of the RAM area to be managed by the OS. If set to zero\r
- *          then the whole available RAM is used. The core memory is made\r
- *          available to the heap allocator and/or can be used directly through\r
- *          the simplified core memory allocator.\r
- *\r
- * @note    In order to let the OS manage the whole RAM the linker script must\r
- *          provide the @p __heap_base__ and @p __heap_end__ symbols.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE.\r
- */\r
-#define CH_CFG_MEMCORE_SIZE                 0\r
-\r
-/**\r
- * @brief   Idle thread automatic spawn suppression.\r
- * @details When this option is activated the function @p chSysInit()\r
- *          does not spawn the idle thread. The application @p main()\r
- *          function becomes the idle thread and must implement an\r
- *          infinite loop.\r
- */\r
-#define CH_CFG_NO_IDLE_THREAD               FALSE\r
-\r
-/* Use __WFI in the idle thread for waiting. Does lower the power\r
- * consumption. */\r
-#define CORTEX_ENABLE_WFI_IDLE              TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Performance options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   OS optimization.\r
- * @details If enabled then time efficient rather than space efficient code\r
- *          is used when two possible implementations exist.\r
- *\r
- * @note    This is not related to the compiler optimization options.\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_OPTIMIZE_SPEED               TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Subsystem options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Time Measurement APIs.\r
- * @details If enabled then the time measurement APIs are included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_TM                       FALSE\r
-\r
-/**\r
- * @brief   Threads registry APIs.\r
- * @details If enabled then the registry APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_REGISTRY                 TRUE\r
-\r
-/**\r
- * @brief   Threads synchronization APIs.\r
- * @details If enabled then the @p chThdWait() function is included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_WAITEXIT                 TRUE\r
-\r
-/**\r
- * @brief   Semaphores APIs.\r
- * @details If enabled then the Semaphores APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES               TRUE\r
-\r
-/**\r
- * @brief   Semaphores queuing mode.\r
- * @details If enabled then the threads are enqueued on semaphores by\r
- *          priority rather than in FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE\r
-\r
-/**\r
- * @brief   Mutexes APIs.\r
- * @details If enabled then the mutexes APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MUTEXES                  TRUE\r
-\r
-/**\r
- * @brief   Enables recursive behavior on mutexes.\r
- * @note    Recursive mutexes are heavier and have an increased\r
- *          memory footprint.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs.\r
- * @details If enabled then the conditional variables APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_CONDVARS                 TRUE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs with timeout.\r
- * @details If enabled then the conditional variables APIs with timeout\r
- *          specification are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_CONDVARS.\r
- */\r
-#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs.\r
- * @details If enabled then the event flags APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_EVENTS                   TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs with timeout.\r
- * @details If enabled then the events APIs with timeout specification\r
- *          are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_EVENTS.\r
- */\r
-#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages APIs.\r
- * @details If enabled then the synchronous messages APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MESSAGES                 TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages queuing mode.\r
- * @details If enabled then messages are served by priority rather than in\r
- *          FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_MESSAGES.\r
- */\r
-#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE\r
-\r
-/**\r
- * @brief   Mailboxes APIs.\r
- * @details If enabled then the asynchronous messages (mailboxes) APIs are\r
- *          included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_MAILBOXES                TRUE\r
-\r
-/**\r
- * @brief   Core Memory Manager APIs.\r
- * @details If enabled then the core memory manager APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMCORE                  TRUE\r
-\r
-/**\r
- * @brief   Heap Allocator APIs.\r
- * @details If enabled then the memory heap allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or\r
- *          @p CH_CFG_USE_SEMAPHORES.\r
- * @note    Mutexes are recommended.\r
- */\r
-#define CH_CFG_USE_HEAP                     TRUE\r
-\r
-/**\r
- * @brief   Memory Pools Allocator APIs.\r
- * @details If enabled then the memory pools allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMPOOLS                 TRUE\r
-\r
-/**\r
- * @brief   Dynamic Threads APIs.\r
- * @details If enabled then the dynamic threads creation APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_WAITEXIT.\r
- * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.\r
- */\r
-#define CH_CFG_USE_DYNAMIC                  TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Debug options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Debug option, kernel statistics.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_STATISTICS                   FALSE\r
-\r
-/**\r
- * @brief   Debug option, system state check.\r
- * @details If enabled the correct call protocol for system APIs is checked\r
- *          at runtime.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_SYSTEM_STATE_CHECK           TRUE\r
-\r
-/**\r
- * @brief   Debug option, parameters checks.\r
- * @details If enabled then the checks on the API functions input\r
- *          parameters are activated.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_CHECKS                TRUE\r
-\r
-/**\r
- * @brief   Debug option, consistency checks.\r
- * @details If enabled then all the assertions in the kernel code are\r
- *          activated. This includes consistency checks inside the kernel,\r
- *          runtime anomalies and port-defined checks.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_ASSERTS               TRUE\r
-\r
-/**\r
- * @brief   Debug option, trace buffer.\r
- * @details If enabled then the trace buffer is activated.\r
- *\r
- * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED\r
-\r
-/**\r
- * @brief   Trace buffer entries.\r
- * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is\r
- *          different from @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_BUFFER_SIZE            128\r
-\r
-/**\r
- * @brief   Debug option, stack checks.\r
- * @details If enabled then a runtime stack check is performed.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    The stack check is performed in a architecture/port dependent way.\r
- *          It may not be implemented or some ports.\r
- * @note    The default failure mode is to halt the system with the global\r
- *          @p panic_msg variable set to @p NULL.\r
- */\r
-#define CH_DBG_ENABLE_STACK_CHECK           TRUE\r
-\r
-/**\r
- * @brief   Debug option, stacks initialization.\r
- * @details If enabled then the threads working area is filled with a byte\r
- *          value when a thread is created. This can be useful for the\r
- *          runtime measurement of the used stack.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_FILL_THREADS                 TRUE\r
-\r
-/**\r
- * @brief   Debug option, threads profiling.\r
- * @details If enabled then a field is added to the @p thread_t structure that\r
- *          counts the system ticks occurred while executing the thread.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    This debug option is not currently compatible with the\r
- *          tickless mode.\r
- */\r
-#define CH_DBG_THREADS_PROFILING            FALSE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel hooks\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Threads descriptor structure extension.\r
- * @details User fields added to the end of the @p thread_t structure.\r
- */\r
-#define CH_CFG_THREAD_EXTRA_FIELDS                                          \\r
-  /* Add threads custom fields here.*/\r
-\r
-/**\r
- * @brief   Threads initialization hook.\r
- * @details User initialization code added to the @p chThdInit() API.\r
- *\r
- * @note    It is invoked from within @p chThdInit() and implicitly from all\r
- *          the threads creation APIs.\r
- */\r
-#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \\r
-  /* Add threads initialization code here.*/                                \\r
-}\r
-\r
-/**\r
- * @brief   Threads finalization hook.\r
- * @details User finalization code added to the @p chThdExit() API.\r
- */\r
-#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \\r
-  /* Add threads finalization code here.*/                                  \\r
-}\r
-\r
-/**\r
- * @brief   Context switch hook.\r
- * @details This hook is invoked just before switching between threads.\r
- */\r
-#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \\r
-  /* Context switch code here.*/                                            \\r
-}\r
-\r
-/**\r
- * @brief   ISR enter hook.\r
- */\r
-#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \\r
-  /* IRQ prologue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   ISR exit hook.\r
- */\r
-#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \\r
-  /* IRQ epilogue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread enter hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to activate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_ENTER_HOOK() {                                          \\r
-  /* Idle-enter code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread leave hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to deactivate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \\r
-  /* Idle-leave code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle Loop hook.\r
- * @details This hook is continuously invoked by the idle thread loop.\r
- */\r
-#define CH_CFG_IDLE_LOOP_HOOK() {                                           \\r
-  /* Idle loop code here.*/                                                 \\r
-}\r
-\r
-/**\r
- * @brief   System tick event hook.\r
- * @details This hook is invoked in the system tick handler immediately\r
- *          after processing the virtual timers queue.\r
- */\r
-#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \\r
-  /* System tick event code here.*/                                         \\r
-}\r
-\r
-/**\r
- * @brief   System halt hook.\r
- * @details This hook is invoked in case to a system halting error before\r
- *          the system is halted.\r
- */\r
-#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \\r
-  /* System halt code here.*/                                               \\r
-}\r
-\r
-/**\r
- * @brief   Trace hook.\r
- * @details This hook is invoked each time a new record is written in the\r
- *          trace buffer.\r
- */\r
-#define CH_CFG_TRACE_HOOK(tep) {                                            \\r
-  /* Trace code here.*/                                                     \\r
-}\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/* Port-specific settings (override port settings defaulted in chcore.h).    */\r
-/*===========================================================================*/\r
-\r
-#endif  /* CHCONF_H */\r
-\r
-/** @} */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/chconf.h
+ * @brief   Configuration file template.
+ * @details A copy of this file must be placed in each project directory, it
+ *          contains the application specific kernel settings.
+ *
+ * @addtogroup config
+ * @details Kernel related settings and hooks.
+ * @{
+ */
+
+#ifndef CHCONF_H
+#define CHCONF_H
+
+#define _CHIBIOS_RT_CONF_
+
+/*===========================================================================*/
+/**
+ * @name System timers settings
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   System time counter resolution.
+ * @note    Allowed values are 16 or 32 bits.
+ */
+#define CH_CFG_ST_RESOLUTION                32
+
+/**
+ * @brief   System tick frequency.
+ * @details Frequency of the system timer that drives the system ticks. This
+ *          setting also defines the system tick time unit.
+ */
+#define CH_CFG_ST_FREQUENCY                 1000
+
+/**
+ * @brief   Time delta constant for the tick-less mode.
+ * @note    If this value is zero then the system uses the classic
+ *          periodic tick. This value represents the minimum number
+ *          of ticks that is safe to specify in a timeout directive.
+ *          The value one is not valid, timeouts are rounded up to
+ *          this value.
+ */
+#define CH_CFG_ST_TIMEDELTA                 0
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel parameters and options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Round robin interval.
+ * @details This constant is the number of system ticks allowed for the
+ *          threads before preemption occurs. Setting this value to zero
+ *          disables the preemption for threads with equal priority and the
+ *          round robin becomes cooperative. Note that higher priority
+ *          threads can still preempt, the kernel is always preemptive.
+ * @note    Disabling the round robin preemption makes the kernel more compact
+ *          and generally faster.
+ * @note    The round robin preemption is not supported in tickless mode and
+ *          must be set to zero in that case.
+ */
+#define CH_CFG_TIME_QUANTUM                 20
+
+/**
+ * @brief   Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ *          then the whole available RAM is used. The core memory is made
+ *          available to the heap allocator and/or can be used directly through
+ *          the simplified core memory allocator.
+ *
+ * @note    In order to let the OS manage the whole RAM the linker script must
+ *          provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note    Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE                 0
+
+/**
+ * @brief   Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ *          does not spawn the idle thread. The application @p main()
+ *          function becomes the idle thread and must implement an
+ *          infinite loop.
+ */
+#define CH_CFG_NO_IDLE_THREAD               FALSE
+
+/* Use __WFI in the idle thread for waiting. Does lower the power
+ * consumption. */
+#define CORTEX_ENABLE_WFI_IDLE              TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Performance options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   OS optimization.
+ * @details If enabled then time efficient rather than space efficient code
+ *          is used when two possible implementations exist.
+ *
+ * @note    This is not related to the compiler optimization options.
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_OPTIMIZE_SPEED               TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Subsystem options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Time Measurement APIs.
+ * @details If enabled then the time measurement APIs are included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_TM                       FALSE
+
+/**
+ * @brief   Threads registry APIs.
+ * @details If enabled then the registry APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_REGISTRY                 TRUE
+
+/**
+ * @brief   Threads synchronization APIs.
+ * @details If enabled then the @p chThdWait() function is included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_WAITEXIT                 TRUE
+
+/**
+ * @brief   Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES               TRUE
+
+/**
+ * @brief   Semaphores queuing mode.
+ * @details If enabled then the threads are enqueued on semaphores by
+ *          priority rather than in FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
+
+/**
+ * @brief   Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MUTEXES                  TRUE
+
+/**
+ * @brief   Enables recursive behavior on mutexes.
+ * @note    Recursive mutexes are heavier and have an increased
+ *          memory footprint.
+ *
+ * @note    The default is @p FALSE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
+
+/**
+ * @brief   Conditional Variables APIs.
+ * @details If enabled then the conditional variables APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_CONDVARS                 TRUE
+
+/**
+ * @brief   Conditional Variables APIs with timeout.
+ * @details If enabled then the conditional variables APIs with timeout
+ *          specification are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_CONDVARS.
+ */
+#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
+
+/**
+ * @brief   Events Flags APIs.
+ * @details If enabled then the event flags APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_EVENTS                   TRUE
+
+/**
+ * @brief   Events Flags APIs with timeout.
+ * @details If enabled then the events APIs with timeout specification
+ *          are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_EVENTS.
+ */
+#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
+
+/**
+ * @brief   Synchronous Messages APIs.
+ * @details If enabled then the synchronous messages APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MESSAGES                 TRUE
+
+/**
+ * @brief   Synchronous Messages queuing mode.
+ * @details If enabled then messages are served by priority rather than in
+ *          FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_MESSAGES.
+ */
+#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
+
+/**
+ * @brief   Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ *          included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES                TRUE
+
+/**
+ * @brief   Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE                  TRUE
+
+/**
+ * @brief   Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
+ *          @p CH_CFG_USE_SEMAPHORES.
+ * @note    Mutexes are recommended.
+ */
+#define CH_CFG_USE_HEAP                     TRUE
+
+/**
+ * @brief   Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS                 TRUE
+
+/**
+ * @brief   Dynamic Threads APIs.
+ * @details If enabled then the dynamic threads creation APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_WAITEXIT.
+ * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
+ */
+#define CH_CFG_USE_DYNAMIC                  TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Debug options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Debug option, kernel statistics.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS                   FALSE
+
+/**
+ * @brief   Debug option, system state check.
+ * @details If enabled the correct call protocol for system APIs is checked
+ *          at runtime.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK           TRUE
+
+/**
+ * @brief   Debug option, parameters checks.
+ * @details If enabled then the checks on the API functions input
+ *          parameters are activated.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS                TRUE
+
+/**
+ * @brief   Debug option, consistency checks.
+ * @details If enabled then all the assertions in the kernel code are
+ *          activated. This includes consistency checks inside the kernel,
+ *          runtime anomalies and port-defined checks.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_ASSERTS               TRUE
+
+/**
+ * @brief   Debug option, trace buffer.
+ * @details If enabled then the trace buffer is activated.
+ *
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
+
+/**
+ * @brief   Trace buffer entries.
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_BUFFER_SIZE            128
+
+/**
+ * @brief   Debug option, stack checks.
+ * @details If enabled then a runtime stack check is performed.
+ *
+ * @note    The default is @p FALSE.
+ * @note    The stack check is performed in a architecture/port dependent way.
+ *          It may not be implemented or some ports.
+ * @note    The default failure mode is to halt the system with the global
+ *          @p panic_msg variable set to @p NULL.
+ */
+#define CH_DBG_ENABLE_STACK_CHECK           TRUE
+
+/**
+ * @brief   Debug option, stacks initialization.
+ * @details If enabled then the threads working area is filled with a byte
+ *          value when a thread is created. This can be useful for the
+ *          runtime measurement of the used stack.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_FILL_THREADS                 TRUE
+
+/**
+ * @brief   Debug option, threads profiling.
+ * @details If enabled then a field is added to the @p thread_t structure that
+ *          counts the system ticks occurred while executing the thread.
+ *
+ * @note    The default is @p FALSE.
+ * @note    This debug option is not currently compatible with the
+ *          tickless mode.
+ */
+#define CH_DBG_THREADS_PROFILING            FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel hooks
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Threads descriptor structure extension.
+ * @details User fields added to the end of the @p thread_t structure.
+ */
+#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
+  /* Add threads custom fields here.*/
+
+/**
+ * @brief   Threads initialization hook.
+ * @details User initialization code added to the @p chThdInit() API.
+ *
+ * @note    It is invoked from within @p chThdInit() and implicitly from all
+ *          the threads creation APIs.
+ */
+#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
+  /* Add threads initialization code here.*/                                \
+}
+
+/**
+ * @brief   Threads finalization hook.
+ * @details User finalization code added to the @p chThdExit() API.
+ */
+#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
+  /* Add threads finalization code here.*/                                  \
+}
+
+/**
+ * @brief   Context switch hook.
+ * @details This hook is invoked just before switching between threads.
+ */
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
+  /* Context switch code here.*/                                            \
+}
+
+/**
+ * @brief   ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
+  /* IRQ prologue code here.*/                                              \
+}
+
+/**
+ * @brief   ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
+  /* IRQ epilogue code here.*/                                              \
+}
+
+/**
+ * @brief   Idle thread enter hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
+  /* Idle-enter code here.*/                                                \
+}
+
+/**
+ * @brief   Idle thread leave hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
+  /* Idle-leave code here.*/                                                \
+}
+
+/**
+ * @brief   Idle Loop hook.
+ * @details This hook is continuously invoked by the idle thread loop.
+ */
+#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
+  /* Idle loop code here.*/                                                 \
+}
+
+/**
+ * @brief   System tick event hook.
+ * @details This hook is invoked in the system tick handler immediately
+ *          after processing the virtual timers queue.
+ */
+#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
+  /* System tick event code here.*/                                         \
+}
+
+/**
+ * @brief   System halt hook.
+ * @details This hook is invoked in case to a system halting error before
+ *          the system is halted.
+ */
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
+  /* System halt code here.*/                                               \
+}
+
+/**
+ * @brief   Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ *          trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) {                                            \
+  /* Trace code here.*/                                                     \
+}
+
+/** @} */
+
+/*===========================================================================*/
+/* Port-specific settings (override port settings defaulted in chcore.h).    */
+/*===========================================================================*/
+
+#endif  /* CHCONF_H */
+
+/** @} */
index b1d2cd5502a83392452513f462495a3f471a1dbb..0436408b09c67c186ba77ea1d0a5e1bbe6dea0b9 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/halconf.h\r
- * @brief   HAL configuration header.\r
- * @details HAL configuration file, this file allows to enable or disable the\r
- *          various device drivers from your application. You may also use\r
- *          this file in order to override the device drivers default settings.\r
- *\r
- * @addtogroup HAL_CONF\r
- * @{\r
- */\r
-\r
-#ifndef _HALCONF_H_\r
-#define _HALCONF_H_\r
-\r
-#include "mcuconf.h"\r
-\r
-/**\r
- * @brief   Enables the PAL subsystem.\r
- */\r
-#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_PAL                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ADC subsystem.\r
- */\r
-#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)\r
-#define HAL_USE_ADC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the CAN subsystem.\r
- */\r
-#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)\r
-#define HAL_USE_CAN                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the DAC subsystem.\r
- */\r
-#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_DAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the EXT subsystem.\r
- */\r
-#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)\r
-#define HAL_USE_EXT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the GPT subsystem.\r
- */\r
-#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)\r
-#define HAL_USE_GPT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2C subsystem.\r
- */\r
-#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2C                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2S subsystem.\r
- */\r
-#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2S                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ICU subsystem.\r
- */\r
-#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)\r
-#define HAL_USE_ICU                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MAC subsystem.\r
- */\r
-#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_MAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MMC_SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_MMC_SPI             FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the PWM subsystem.\r
- */\r
-#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)\r
-#define HAL_USE_PWM                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the RTC subsystem.\r
- */\r
-#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)\r
-#define HAL_USE_RTC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SDC subsystem.\r
- */\r
-#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)\r
-#define HAL_USE_SDC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL              FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL over USB subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL_USB          FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_SPI                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the UART subsystem.\r
- */\r
-#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)\r
-#define HAL_USE_UART                FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the USB subsystem.\r
- */\r
-#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_USB                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the WDG subsystem.\r
- */\r
-#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)\r
-#define HAL_USE_WDG                 FALSE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* USB driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables synchronous APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)\r
-#define USB_USE_WAIT                TRUE\r
-#endif\r
-\r
-#endif /* _HALCONF_H_ */\r
-\r
-/** @} */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/halconf.h
+ * @brief   HAL configuration header.
+ * @details HAL configuration file, this file allows to enable or disable the
+ *          various device drivers from your application. You may also use
+ *          this file in order to override the device drivers default settings.
+ *
+ * @addtogroup HAL_CONF
+ * @{
+ */
+
+#ifndef _HALCONF_H_
+#define _HALCONF_H_
+
+#include "mcuconf.h"
+
+/**
+ * @brief   Enables the PAL subsystem.
+ */
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
+#define HAL_USE_PAL                 TRUE
+#endif
+
+/**
+ * @brief   Enables the ADC subsystem.
+ */
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
+#define HAL_USE_ADC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the CAN subsystem.
+ */
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
+#define HAL_USE_CAN                 FALSE
+#endif
+
+/**
+ * @brief   Enables the DAC subsystem.
+ */
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
+#define HAL_USE_DAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the EXT subsystem.
+ */
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
+#define HAL_USE_EXT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2C subsystem.
+ */
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
+#define HAL_USE_I2C                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2S subsystem.
+ */
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
+#define HAL_USE_I2S                 FALSE
+#endif
+
+/**
+ * @brief   Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MAC subsystem.
+ */
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
+#define HAL_USE_MAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MMC_SPI subsystem.
+ */
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_MMC_SPI             FALSE
+#endif
+
+/**
+ * @brief   Enables the PWM subsystem.
+ */
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
+#define HAL_USE_PWM                 FALSE
+#endif
+
+/**
+ * @brief   Enables the RTC subsystem.
+ */
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
+#define HAL_USE_RTC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL subsystem.
+ */
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL              FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB          FALSE
+#endif
+
+/**
+ * @brief   Enables the SPI subsystem.
+ */
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_SPI                 FALSE
+#endif
+
+/**
+ * @brief   Enables the UART subsystem.
+ */
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
+#define HAL_USE_UART                FALSE
+#endif
+
+/**
+ * @brief   Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB                 TRUE
+#endif
+
+/**
+ * @brief   Enables the WDG subsystem.
+ */
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
+#define HAL_USE_WDG                 FALSE
+#endif
+
+/*===========================================================================*/
+/* USB driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
+#define USB_USE_WAIT                TRUE
+#endif
+
+#endif /* _HALCONF_H_ */
+
+/** @} */
index c636590197be92908698e8375b3c316817acaeb6..2764e88989c1889ad18956b1469f50c1aa0bb9f4 100644 (file)
@@ -1,55 +1,55 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-#define KL2x_MCUCONF\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#if 1\r
-/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */\r
-#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_PEE\r
-#define KINETIS_PLLCLK_FREQUENCY    96000000UL\r
-#define KINETIS_SYSCLK_FREQUENCY    48000000UL\r
-#endif\r
-\r
-#if 0\r
-/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */\r
-#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI\r
-#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */\r
-#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */\r
-#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */\r
-#define KINETIS_CLKDIV1_OUTDIV1     1           /* do not divide system clock */\r
-#endif\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define KINETIS_SERIAL_USE_UART0              TRUE\r
-\r
-/*\r
- * USB driver settings\r
- */\r
-#define KINETIS_USB_USE_USB0                  TRUE\r
-/* Need to redefine this, since the default is for K20x */\r
-/* This is for Teensy LC; you should comment it out (or change to 5)\r
- * for Teensy 3.x */\r
-#define KINETIS_USB_USB0_IRQ_PRIORITY         2\r
-\r
-#endif /* _MCUCONF_H_ */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#ifndef _MCUCONF_H_
+#define _MCUCONF_H_
+
+#define KL2x_MCUCONF
+
+/*
+ * HAL driver system settings.
+ */
+#if 1
+/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */
+#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_PEE
+#define KINETIS_PLLCLK_FREQUENCY    96000000UL
+#define KINETIS_SYSCLK_FREQUENCY    48000000UL
+#endif
+
+#if 0
+/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */
+#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI
+#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */
+#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */
+#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */
+#define KINETIS_CLKDIV1_OUTDIV1     1           /* do not divide system clock */
+#endif
+
+/*
+ * SERIAL driver system settings.
+ */
+#define KINETIS_SERIAL_USE_UART0              TRUE
+
+/*
+ * USB driver settings
+ */
+#define KINETIS_USB_USE_USB0                  TRUE
+/* Need to redefine this, since the default is for K20x */
+/* This is for Teensy LC; you should comment it out (or change to 5)
+ * for Teensy 3.x */
+#define KINETIS_USB_USB0_IRQ_PRIORITY         2
+
+#endif /* _MCUCONF_H_ */
index 4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783..57b2ef62e5f3a43b7338f789a5d4800c577b763d 100644 (file)
@@ -1,3 +1,3 @@
 ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
\ No newline at end of file
+endif
index 4813c4e786ff43012daeffb825534462998f25fc..97753bc069d2f3caba3bc4f1d02457005b5e4f63 100644 (file)
-/*\r
-Copyright 2012 Jun Wako <wakojun@gmail.com>\r
-\r
-This program is free software: you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation, either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program. If not, see <http://www.gnu.org/licenses/>.\r
-*/\r
-\r
-#ifndef CONFIG_H\r
-#define CONFIG_H\r
-\r
-#include "config_common.h"\r
-\r
-/* USB Device descriptor parameter */\r
-#define VENDOR_ID    0xFEED\r
-#define PRODUCT_ID   0x6060\r
-#define DEVICE_VER   0x0001\r
-#define MANUFACTURER    geekhack\r
-#define PRODUCT         GH60\r
-#define DESCRIPTION     t.m.k. keyboard firmware for GH60\r
-\r
-/* key matrix size */\r
-#define MATRIX_ROWS 5\r
-#define MATRIX_COLS 14\r
-\r
-/*\r
- * Keyboard Matrix Assignments\r
- *\r
- * Change this to how you wired your keyboard\r
- * COLS: AVR pins used for columns, left to right\r
- * ROWS: AVR pins used for rows, top to bottom\r
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)\r
- *         ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)\r
- *\r
-*/\r
- #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }\r
-// Rev A\r
-// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }\r
-// Rev B/C\r
-   #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }\r
-#define UNUSED_PINS\r
-\r
-/* COL2ROW or ROW2COL */\r
-#define DIODE_DIRECTION COL2ROW\r
-\r
-/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */\r
-#define DEBOUNCING_DELAY 5\r
-\r
-/* define if matrix has ghost (lacks anti-ghosting diodes) */\r
-//#define MATRIX_HAS_GHOST\r
-\r
-/* number of backlight levels */\r
-#define BACKLIGHT_LEVELS 3\r
-\r
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */\r
-#define LOCKING_SUPPORT_ENABLE\r
-/* Locking resynchronize hack */\r
-#define LOCKING_RESYNC_ENABLE\r
-\r
-/*\r
- * Force NKRO\r
- *\r
- * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved\r
- * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the\r
- * makefile for this to work.)\r
- *\r
- * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)\r
- * until the next keyboard reset.\r
- *\r
- * NKRO may prevent your keystrokes from being detected in the BIOS, but it is\r
- * fully operational during normal computer usage.\r
- *\r
- * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)\r
- * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by\r
- * bootmagic, NKRO mode will always be enabled until it is toggled again during a\r
- * power-up.\r
- *\r
- */\r
-//#define FORCE_NKRO\r
-\r
-/*\r
- * Magic Key Options\r
- *\r
- * Magic keys are hotkey commands that allow control over firmware functions of\r
- * the keyboard. They are best used in combination with the HID Listen program,\r
- * found here: https://www.pjrc.com/teensy/hid_listen.html\r
- *\r
- * The options below allow the magic key functionality to be changed. This is\r
- * useful if your keyboard/keypad is missing keys and you want magic key support.\r
- *\r
- */\r
-\r
-/* key combination for magic key command */\r
-#define IS_COMMAND() ( \\r
-  keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \\r
-)\r
-\r
-/* control how magic key switches layers */\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false\r
-\r
-/* override magic key keymap */\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM\r
-//#define MAGIC_KEY_HELP1     H\r
-//#define MAGIC_KEY_HELP2     SLASH\r
-//#define MAGIC_KEY_DEBUG     D\r
-//#define MAGIC_KEY_DEBUG_MATRIX  X\r
-//#define MAGIC_KEY_DEBUG_KBD   K\r
-//#define MAGIC_KEY_DEBUG_MOUSE  M\r
-//#define MAGIC_KEY_VERSION    V\r
-//#define MAGIC_KEY_STATUS     S\r
-//#define MAGIC_KEY_CONSOLE    C\r
-//#define MAGIC_KEY_LAYER0_ALT1  ESC\r
-//#define MAGIC_KEY_LAYER0_ALT2  GRAVE\r
-//#define MAGIC_KEY_LAYER0     0\r
-//#define MAGIC_KEY_LAYER1     1\r
-//#define MAGIC_KEY_LAYER2     2\r
-//#define MAGIC_KEY_LAYER3     3\r
-//#define MAGIC_KEY_LAYER4     4\r
-//#define MAGIC_KEY_LAYER5     5\r
-//#define MAGIC_KEY_LAYER6     6\r
-//#define MAGIC_KEY_LAYER7     7\r
-//#define MAGIC_KEY_LAYER8     8\r
-//#define MAGIC_KEY_LAYER9     9\r
-//#define MAGIC_KEY_BOOTLOADER   PAUSE\r
-//#define MAGIC_KEY_LOCK      CAPS\r
-//#define MAGIC_KEY_EEPROM     E\r
-//#define MAGIC_KEY_NKRO      N\r
-//#define MAGIC_KEY_SLEEP_LED   Z\r
-\r
-/*\r
- * Feature disable options\r
- * These options are also useful to firmware size reduction.\r
- */\r
-\r
-/* disable debug print */\r
-//#define NO_DEBUG\r
-\r
-/* disable print */\r
-//#define NO_PRINT\r
-\r
-/* disable action features */\r
-//#define NO_ACTION_LAYER\r
-//#define NO_ACTION_TAPPING\r
-//#define NO_ACTION_ONESHOT\r
-//#define NO_ACTION_MACRO\r
-//#define NO_ACTION_FUNCTION\r
-\r
-#endif\r
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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.
+
+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.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID    0xFEED
+#define PRODUCT_ID   0x6060
+#define DEVICE_VER   0x0001
+#define MANUFACTURER    geekhack
+#define PRODUCT         GH60
+#define DESCRIPTION     t.m.k. keyboard firmware for GH60
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 14
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ *         ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+*/
+ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
+// Rev A
+// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
+// Rev B/C
+   #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
+#define UNUSED_PINS
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/*
+ * Force NKRO
+ *
+ * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
+ * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
+ * makefile for this to work.)
+ *
+ * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
+ * until the next keyboard reset.
+ *
+ * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
+ * fully operational during normal computer usage.
+ *
+ * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
+ * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
+ * bootmagic, NKRO mode will always be enabled until it is toggled again during a
+ * power-up.
+ *
+ */
+//#define FORCE_NKRO
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
+#define IS_COMMAND() ( \
+  keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP1     H
+//#define MAGIC_KEY_HELP2     SLASH
+//#define MAGIC_KEY_DEBUG     D
+//#define MAGIC_KEY_DEBUG_MATRIX  X
+//#define MAGIC_KEY_DEBUG_KBD   K
+//#define MAGIC_KEY_DEBUG_MOUSE  M
+//#define MAGIC_KEY_VERSION    V
+//#define MAGIC_KEY_STATUS     S
+//#define MAGIC_KEY_CONSOLE    C
+//#define MAGIC_KEY_LAYER0_ALT1  ESC
+//#define MAGIC_KEY_LAYER0_ALT2  GRAVE
+//#define MAGIC_KEY_LAYER0     0
+//#define MAGIC_KEY_LAYER1     1
+//#define MAGIC_KEY_LAYER2     2
+//#define MAGIC_KEY_LAYER3     3
+//#define MAGIC_KEY_LAYER4     4
+//#define MAGIC_KEY_LAYER5     5
+//#define MAGIC_KEY_LAYER6     6
+//#define MAGIC_KEY_LAYER7     7
+//#define MAGIC_KEY_LAYER8     8
+//#define MAGIC_KEY_LAYER9     9
+//#define MAGIC_KEY_BOOTLOADER   PAUSE
+//#define MAGIC_KEY_LOCK      CAPS
+//#define MAGIC_KEY_EEPROM     E
+//#define MAGIC_KEY_NKRO      N
+//#define MAGIC_KEY_SLEEP_LED   Z
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
index 255d87de996274d1574fd8d757d5ecc9c8eb25dd..f5a158e12f99bd1e2a6d306e232e3d145057f8f8 100644 (file)
@@ -1,25 +1,25 @@
-#include "gh60.h"\r
-\r
-void led_set_kb(uint8_t usb_led) {\r
-       // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here\r
-       \r
-    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {\r
-               gh60_caps_led_on();\r
-               } else {\r
-               gh60_caps_led_off(); \r
-    }\r
-       \r
-    // if (usb_led & (1<<USB_LED_NUM_LOCK)) {\r
-               // gh60_esc_led_on();\r
-               // } else {\r
-               // gh60_esc_led_off(); \r
-    // }\r
-       \r
-    // if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {\r
-               // gh60_fn_led_on();\r
-               // } else {\r
-               // gh60_fn_led_off();   \r
-    // }\r
-\r
-       led_set_user(usb_led);  \r
-}\r
+#include "gh60.h"
+
+void led_set_kb(uint8_t usb_led) {
+       // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
+       
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+               gh60_caps_led_on();
+               } else {
+               gh60_caps_led_off(); 
+    }
+       
+    // if (usb_led & (1<<USB_LED_NUM_LOCK)) {
+               // gh60_esc_led_on();
+               // } else {
+               // gh60_esc_led_off(); 
+    // }
+       
+    // if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
+               // gh60_fn_led_on();
+               // } else {
+               // gh60_fn_led_off();   
+    // }
+
+       led_set_user(usb_led);  
+}
index ca30562a44a94d466da262e87bab81b477d3f099..82624b614844ca4a139696f2960ad4c01d4ef886 100644 (file)
@@ -1,74 +1,74 @@
-#ifndef GH60_H\r
-#define GH60_H\r
-\r
-#include "quantum.h"\r
-#include "led.h"\r
-\r
-/* GH60 LEDs \r
- *   GPIO pads\r
- *   0 F7 WASD LEDs\r
- *   1 F6 ESC LED\r
- *   2 F5 FN LED\r
- *   3 F4 POKER Arrow LEDs\r
- *   B2 Capslock LED\r
- *   B0 not connected\r
- */\r
-inline void gh60_caps_led_on(void)      { DDRB |=  (1<<2); PORTB &= ~(1<<2); }\r
-inline void gh60_poker_leds_on(void)    { DDRF |=  (1<<4); PORTF &= ~(1<<4); }\r
-inline void gh60_fn_led_on(void)       { DDRF |=  (1<<5); PORTF &= ~(1<<5); }\r
-inline void gh60_esc_led_on(void)      { DDRF |=  (1<<6); PORTF &= ~(1<<6); }\r
-inline void gh60_wasd_leds_on(void)            { DDRF |=  (1<<7); PORTF &= ~(1<<7); }\r
-\r
-inline void gh60_caps_led_off(void)     { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }\r
-inline void gh60_poker_leds_off(void)   { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }\r
-inline void gh60_fn_led_off(void)      { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }\r
-inline void gh60_esc_led_off(void)     { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }\r
-inline void gh60_wasd_leds_off(void)           { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }\r
-\r
-/* GH60 keymap definition macro\r
- * K2C, K31 and  K3C are extra keys for ISO\r
- */\r
-#define KEYMAP( \\r
-    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \\r
-    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \\r
-    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \\r
-    K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \\r
-    K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \\r
-) { \\r
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \\r
-    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \\r
-    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \\r
-    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \\r
-    { KC_##K40, KC_##K41, KC_##K42, KC_NO,    KC_NO,    KC_##K45, KC_NO,    KC_NO,    KC_NO,    KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D }  \\r
-}\r
-\r
-/* ANSI valiant. No extra keys for ISO */\r
-#define KEYMAP_ANSI( \\r
-    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \\r
-    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \\r
-    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,      K2D, \\r
-    K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,           K3D, \\r
-    K40, K41, K42,           K45,                     K4A, K4B, K4C, K4D  \\r
-) KEYMAP( \\r
-    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \\r
-    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \\r
-    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO,  K2D, \\r
-    K30, NO,  K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO,  K3D, \\r
-    K40, K41, K42,           K45,                NO,  K4A, K4B, K4C, K4D  \\r
-)\r
-\r
-#define KEYMAP_HHKB( \\r
-    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\\r
-    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \\r
-    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,      K2D, \\r
-    K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,      K3D, K3C, \\r
-    K40, K41, K42,           K45,                     K4A, K4B, K4C, K4D  \\r
-) KEYMAP( \\r
-    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \\r
-    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \\r
-    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO,  K2D, \\r
-    K30, NO,  K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \\r
-    K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \\r
-)\r
-\r
-#endif\r
+#ifndef GH60_H
+#define GH60_H
+
+#include "quantum.h"
+#include "led.h"
+
+/* GH60 LEDs 
+ *   GPIO pads
+ *   0 F7 WASD LEDs
+ *   1 F6 ESC LED
+ *   2 F5 FN LED
+ *   3 F4 POKER Arrow LEDs
+ *   B2 Capslock LED
+ *   B0 not connected
+ */
+inline void gh60_caps_led_on(void)      { DDRB |=  (1<<2); PORTB &= ~(1<<2); }
+inline void gh60_poker_leds_on(void)    { DDRF |=  (1<<4); PORTF &= ~(1<<4); }
+inline void gh60_fn_led_on(void)       { DDRF |=  (1<<5); PORTF &= ~(1<<5); }
+inline void gh60_esc_led_on(void)      { DDRF |=  (1<<6); PORTF &= ~(1<<6); }
+inline void gh60_wasd_leds_on(void)            { DDRF |=  (1<<7); PORTF &= ~(1<<7); }
+
+inline void gh60_caps_led_off(void)     { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
+inline void gh60_poker_leds_off(void)   { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
+inline void gh60_fn_led_off(void)      { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
+inline void gh60_esc_led_off(void)     { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }
+inline void gh60_wasd_leds_off(void)           { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
+
+/* GH60 keymap definition macro
+ * K2C, K31 and  K3C are extra keys for ISO
+ */
+#define KEYMAP( \
+    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
+    K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
+    K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \
+) { \
+    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
+    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
+    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \
+    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \
+    { KC_##K40, KC_##K41, KC_##K42, KC_NO,    KC_NO,    KC_##K45, KC_NO,    KC_NO,    KC_NO,    KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D }  \
+}
+
+/* ANSI valiant. No extra keys for ISO */
+#define KEYMAP_ANSI( \
+    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,      K2D, \
+    K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,           K3D, \
+    K40, K41, K42,           K45,                     K4A, K4B, K4C, K4D  \
+) KEYMAP( \
+    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO,  K2D, \
+    K30, NO,  K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO,  K3D, \
+    K40, K41, K42,           K45,                NO,  K4A, K4B, K4C, K4D  \
+)
+
+#define KEYMAP_HHKB( \
+    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B,      K2D, \
+    K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,      K3D, K3C, \
+    K40, K41, K42,           K45,                     K4A, K4B, K4C, K4D  \
+) KEYMAP( \
+    K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO,  K2D, \
+    K30, NO,  K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
+    K40, K41, K42,           K45,                K49, K4A, K4B, K4C, K4D  \
+)
+
+#endif
index 2e69aee298130c343a163075af3243f81b42eeef..c73cf114172ce101039196cad50aef9af22facd6 100644 (file)
-#----------------------------------------------------------------------------\r
-# On command line:\r
-#\r
-# make all = Make software.\r
-#\r
-# make clean = Clean out built project files.\r
-#\r
-# make coff = Convert ELF to AVR COFF.\r
-#\r
-# make extcoff = Convert ELF to AVR Extended COFF.\r
-#\r
-# make program = Download the hex file to the device.\r
-#                Please customize your programmer settings(PROGRAM_CMD)\r
-#\r
-# make teensy = Download the hex file to the device, using teensy_loader_cli.\r
-#               (must have teensy_loader_cli installed).\r
-#\r
-# make dfu = Download the hex file to the device, using dfu-programmer (must\r
-#            have dfu-programmer installed).\r
-#\r
-# make flip = Download the hex file to the device, using Atmel FLIP (must\r
-#             have Atmel FLIP installed).\r
-#\r
-# make dfu-ee = Download the eeprom file to the device, using dfu-programmer\r
-#               (must have dfu-programmer installed).\r
-#\r
-# make flip-ee = Download the eeprom file to the device, using Atmel FLIP\r
-#                (must have Atmel FLIP installed).\r
-#\r
-# make debug = Start either simulavr or avarice as specified for debugging, \r
-#              with avr-gdb or avr-insight as the front end for debugging.\r
-#\r
-# make filename.s = Just compile filename.c into the assembler code only.\r
-#\r
-# make filename.i = Create a preprocessed source file for use in submitting\r
-#                   bug reports to the GCC project.\r
-#\r
-# To rebuild project do "make clean" then "make all".\r
-#----------------------------------------------------------------------------\r
-\r
-# MCU name\r
-#MCU = at90usb1287\r
-MCU = atmega32u4\r
-\r
-# Processor frequency.\r
-#     This will define a symbol, F_CPU, in all source code files equal to the\r
-#     processor frequency in Hz. You can then use this symbol in your source code to\r
-#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done\r
-#     automatically to create a 32-bit value in your source code.\r
-#\r
-#     This will be an integer division of F_USB below, as it is sourced by\r
-#     F_USB after it has run through any CPU prescalers. Note that this value\r
-#     does not *change* the processor frequency - it should merely be updated to\r
-#     reflect the processor speed set externally so that the code can use accurate\r
-#     software delays.\r
-F_CPU = 16000000\r
-\r
-\r
-#\r
-# LUFA specific\r
-#\r
-# Target architecture (see library "Board Types" documentation).\r
-ARCH = AVR8\r
-\r
-# Input clock frequency.\r
-#     This will define a symbol, F_USB, in all source code files equal to the\r
-#     input clock frequency (before any prescaling is performed) in Hz. This value may\r
-#     differ from F_CPU if prescaling is used on the latter, and is required as the\r
-#     raw input clock is fed directly to the PLL sections of the AVR for high speed\r
-#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'\r
-#     at the end, this will be done automatically to create a 32-bit value in your\r
-#     source code.\r
-#\r
-#     If no clock division is performed on the input clock inside the AVR (via the\r
-#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.\r
-F_USB = $(F_CPU)\r
-\r
-# Interrupt driven control endpoint task(+60)\r
-OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT\r
-\r
-\r
-# Boot Section Size in *bytes*\r
-#   Teensy halfKay   512\r
-#   Teensy++ halfKay 1024\r
-#   Atmel DFU loader 4096\r
-#   LUFA bootloader  4096\r
-#   USBaspLoader     2048\r
-OPT_DEFS += -DBOOTLOADER_SIZE=4096\r
-\r
-\r
-# Build Options\r
-#   comment out to disable the options.\r
-#\r
-BOOTMAGIC_ENABLE ?= yes                # Virtual DIP switch configuration(+1000)\r
-MOUSEKEY_ENABLE ?= yes         # Mouse keys(+4700)\r
-EXTRAKEY_ENABLE ?= yes         # Audio control and System control(+450)\r
-# CONSOLE_ENABLE ?= yes                # Console for debug(+400)\r
-# COMMAND_ENABLE ?= yes                # Commands for debug and configuration\r
-KEYBOARD_LOCK_ENABLE ?= yes    # Allow locking of keyboard via magic key\r
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE\r
-# SLEEP_LED_ENABLE ?= yes      # Breathing sleep LED during USB suspend\r
-NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work\r
-# BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality\r
-# MIDI_ENABLE ?= YES           # MIDI controls\r
-# UNICODE_ENABLE ?= YES                # Unicode\r
-# BLUETOOTH_ENABLE ?= yes      # Enable Bluetooth with the Adafruit EZ-Key HID\r
-RGBLIGHT_ENABLE ?= yes          # Enable RGB Underglow\r
-\r
-ifndef QUANTUM_DIR\r
-       include ../../../../Makefile\r
-endif\r
-\r
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device.
+#                Please customize your programmer settings(PROGRAM_CMD)
+#
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+#               (must have teensy_loader_cli installed).
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+#            have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+#             have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+#               (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+#                (must have Atmel FLIP installed).
+#
+# make debug = Start either simulavr or avarice as specified for debugging, 
+#              with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+#                   bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u4
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE ?= yes                # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes         # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes         # Audio control and System control(+450)
+# CONSOLE_ENABLE ?= yes                # Console for debug(+400)
+# COMMAND_ENABLE ?= yes                # Commands for debug and configuration
+KEYBOARD_LOCK_ENABLE ?= yes    # Allow locking of keyboard via magic key
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+# SLEEP_LED_ENABLE ?= yes      # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+# BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
+# MIDI_ENABLE ?= YES           # MIDI controls
+# UNICODE_ENABLE ?= YES                # Unicode
+# BLUETOOTH_ENABLE ?= yes      # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= yes          # Enable RGB Underglow
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
+
index 8272875ed0efda5df6a1d70df7b56141da7f4ab8..6a29e6b8c264dfd7d623567eafeaea96592c329a 100644 (file)
-/*\r
-Copyright 2012 Jun Wako <wakojun@gmail.com>\r
-\r
-This program is free software: you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation, either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-This program is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with this program. If not, see <http://www.gnu.org/licenses/>.\r
-*/\r
-\r
-#ifndef CONFIG_H\r
-#define CONFIG_H\r
-\r
-#include "config_common.h"\r
-\r
-/* USB Device descriptor parameter */\r
-#define VENDOR_ID    0xFEED\r
-#define PRODUCT_ID   0x6060\r
-#define DEVICE_VER   0x0001\r
-#define MANUFACTURER    geekhack\r
-#define PRODUCT         GH60\r
-#define DESCRIPTION     t.m.k. keyboard firmware for GH60\r
-\r
-/* key matrix size */\r
-#define MATRIX_ROWS 5\r
-#define MATRIX_COLS 14\r
-\r
-/*\r
- * Keyboard Matrix Assignments\r
- *\r
- * Change this to how you wired your keyboard\r
- * COLS: AVR pins used for columns, left to right\r
- * ROWS: AVR pins used for rows, top to bottom\r
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)\r
- *         ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)\r
- *\r
-*/\r
- #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }\r
-// Rev A\r
-// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }\r
-// Rev B/C\r
-   #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }\r
-#define UNUSED_PINS\r
-\r
-/* COL2ROW or ROW2COL */\r
-#define DIODE_DIRECTION COL2ROW\r
-\r
-/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */\r
-#define DEBOUNCING_DELAY 5\r
-\r
-/* define if matrix has ghost (lacks anti-ghosting diodes) */\r
-//#define MATRIX_HAS_GHOST\r
-\r
-/* number of backlight levels */\r
-#define BACKLIGHT_LEVELS 3\r
-\r
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */\r
-#define LOCKING_SUPPORT_ENABLE\r
-/* Locking resynchronize hack */\r
-#define LOCKING_RESYNC_ENABLE\r
-\r
-/*\r
- * Force NKRO\r
- *\r
- * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved\r
- * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the\r
- * makefile for this to work.)\r
- *\r
- * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)\r
- * until the next keyboard reset.\r
- *\r
- * NKRO may prevent your keystrokes from being detected in the BIOS, but it is\r
- * fully operational during normal computer usage.\r
- *\r
- * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)\r
- * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by\r
- * bootmagic, NKRO mode will always be enabled until it is toggled again during a\r
- * power-up.\r
- *\r
- */\r
-//#define FORCE_NKRO\r
-\r
-/*\r
- * Magic Key Options\r
- *\r
- * Magic keys are hotkey commands that allow control over firmware functions of\r
- * the keyboard. They are best used in combination with the HID Listen program,\r
- * found here: https://www.pjrc.com/teensy/hid_listen.html\r
- *\r
- * The options below allow the magic key functionality to be changed. This is\r
- * useful if your keyboard/keypad is missing keys and you want magic key support.\r
- *\r
- */\r
-\r
-/* key combination for magic key command */\r
-#define IS_COMMAND() ( \\r
-  keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \\r
-)\r
-\r
-/* control how magic key switches layers */\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false\r
-\r
-/* override magic key keymap */\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS\r
-//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM\r
-//#define MAGIC_KEY_HELP1     H\r
-//#define MAGIC_KEY_HELP2     SLASH\r
-//#define MAGIC_KEY_DEBUG     D\r
-//#define MAGIC_KEY_DEBUG_MATRIX  X\r
-//#define MAGIC_KEY_DEBUG_KBD   K\r
-//#define MAGIC_KEY_DEBUG_MOUSE  M\r
-//#define MAGIC_KEY_VERSION    V\r
-//#define MAGIC_KEY_STATUS     S\r
-//#define MAGIC_KEY_CONSOLE    C\r
-//#define MAGIC_KEY_LAYER0_ALT1  ESC\r
-//#define MAGIC_KEY_LAYER0_ALT2  GRAVE\r
-//#define MAGIC_KEY_LAYER0     0\r
-//#define MAGIC_KEY_LAYER1     1\r
-//#define MAGIC_KEY_LAYER2     2\r
-//#define MAGIC_KEY_LAYER3     3\r
-//#define MAGIC_KEY_LAYER4     4\r
-//#define MAGIC_KEY_LAYER5     5\r
-//#define MAGIC_KEY_LAYER6     6\r
-//#define MAGIC_KEY_LAYER7     7\r
-//#define MAGIC_KEY_LAYER8     8\r
-//#define MAGIC_KEY_LAYER9     9\r
-//#define MAGIC_KEY_BOOTLOADER   PAUSE\r
-//#define MAGIC_KEY_LOCK      CAPS\r
-//#define MAGIC_KEY_EEPROM     E\r
-//#define MAGIC_KEY_NKRO      N\r
-//#define MAGIC_KEY_SLEEP_LED   Z\r
-\r
-/*\r
- * Feature disable options\r
- * These options are also useful to firmware size reduction.\r
- */\r
-\r
-/* disable debug print */\r
-//#define NO_DEBUG\r
-\r
-/* disable print */\r
-//#define NO_PRINT\r
-\r
-/* disable action features */\r
-//#define NO_ACTION_LAYER\r
-//#define NO_ACTION_TAPPING\r
-//#define NO_ACTION_ONESHOT\r
-//#define NO_ACTION_MACRO\r
-//#define NO_ACTION_FUNCTION\r
-\r
-/*\r
- * RGB Underglow\r
- * These settings are for the F4 by default:\r
- * \r
- *\r
- * #define ws2812_PORTREG  PORTF\r
- * #define ws2812_DDRREG   DDRF\r
- * #define ws2812_pin PF4\r
- * #define RGBLED_NUM 14     // Number of LEDs\r
- * #define RGBLIGHT_HUE_STEP 10\r
- * #define RGBLIGHT_SAT_STEP 17\r
- * #define RGBLIGHT_VAL_STEP 17\r
- *\r
- * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. \r
- * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. \r
- * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c\r
-*/\r
-\r
-/* Deprecated code below\r
-#define ws2812_PORTREG  PORTF \r
-#define ws2812_DDRREG   DDRF\r
-#define ws2812_pin PF4\r
-*/ \r
-#define RGB_DI_PIN F4\r
-#define RGBLIGHT_TIMER\r
-#define RGBLED_NUM 8         // Number of LEDs\r
-#define RGBLIGHT_HUE_STEP 8\r
-#define RGBLIGHT_SAT_STEP 8\r
-#define RGBLIGHT_VAL_STEP 8\r
-#endif\r
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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.
+
+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.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID    0xFEED
+#define PRODUCT_ID   0x6060
+#define DEVICE_VER   0x0001
+#define MANUFACTURER    geekhack
+#define PRODUCT         GH60
+#define DESCRIPTION     t.m.k. keyboard firmware for GH60
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 14
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ *         ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+*/
+ #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
+// Rev A
+// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
+// Rev B/C
+   #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
+#define UNUSED_PINS
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/*
+ * Force NKRO
+ *
+ * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
+ * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
+ * makefile for this to work.)
+ *
+ * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
+ * until the next keyboard reset.
+ *
+ * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
+ * fully operational during normal computer usage.
+ *
+ * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
+ * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
+ * bootmagic, NKRO mode will always be enabled until it is toggled again during a
+ * power-up.
+ *
+ */
+//#define FORCE_NKRO
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
+#define IS_COMMAND() ( \
+  keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP1     H
+//#define MAGIC_KEY_HELP2     SLASH
+//#define MAGIC_KEY_DEBUG     D
+//#define MAGIC_KEY_DEBUG_MATRIX  X
+//#define MAGIC_KEY_DEBUG_KBD   K
+//#define MAGIC_KEY_DEBUG_MOUSE  M
+//#define MAGIC_KEY_VERSION    V
+//#define MAGIC_KEY_STATUS     S
+//#define MAGIC_KEY_CONSOLE    C
+//#define MAGIC_KEY_LAYER0_ALT1  ESC
+//#define MAGIC_KEY_LAYER0_ALT2  GRAVE
+//#define MAGIC_KEY_LAYER0     0
+//#define MAGIC_KEY_LAYER1     1
+//#define MAGIC_KEY_LAYER2     2
+//#define MAGIC_KEY_LAYER3     3
+//#define MAGIC_KEY_LAYER4     4
+//#define MAGIC_KEY_LAYER5     5
+//#define MAGIC_KEY_LAYER6     6
+//#define MAGIC_KEY_LAYER7     7
+//#define MAGIC_KEY_LAYER8     8
+//#define MAGIC_KEY_LAYER9     9
+//#define MAGIC_KEY_BOOTLOADER   PAUSE
+//#define MAGIC_KEY_LOCK      CAPS
+//#define MAGIC_KEY_EEPROM     E
+//#define MAGIC_KEY_NKRO      N
+//#define MAGIC_KEY_SLEEP_LED   Z
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+/*
+ * RGB Underglow
+ * These settings are for the F4 by default:
+ * 
+ *
+ * #define ws2812_PORTREG  PORTF
+ * #define ws2812_DDRREG   DDRF
+ * #define ws2812_pin PF4
+ * #define RGBLED_NUM 14     // Number of LEDs
+ * #define RGBLIGHT_HUE_STEP 10
+ * #define RGBLIGHT_SAT_STEP 17
+ * #define RGBLIGHT_VAL_STEP 17
+ *
+ * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. 
+ * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. 
+ * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c
+*/
+
+/* Deprecated code below
+#define ws2812_PORTREG  PORTF 
+#define ws2812_DDRREG   DDRF
+#define ws2812_pin PF4
+*/ 
+#define RGB_DI_PIN F4
+#define RGBLIGHT_TIMER
+#define RGBLED_NUM 8         // Number of LEDs
+#define RGBLIGHT_HUE_STEP 8
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+#endif
index 3787f938e7883a972ae83c41d0ba01b4af5bd6c7..e9bf1983a5b772d81a4395972e48dee91271a358 100644 (file)
@@ -1,18 +1,18 @@
-    /* Column pin configuration\r
-    * col: 0   1   2   3   4   5   6   7   8   9   10  11  12  13\r
-    * pin: F0  F1  E6  C7  C6  B6  D4  B1  B7  B5  B4  D7  D6  B3  (Rev.C)\r
-    */\r
-     \r
-    /* Row pin configuration\r
-    * row: 0   1   2   3   4\r
-    * pin: D0  D1  D2  D3  D5\r
-    */\r
-     \r
-    GPIO pads\r
-    0 F7 WASD LEDs\r
-    1 F6 ESC LED\r
-    2 F5 FN LED\r
-    3 F4 POKER Arrow LEDs\r
-     \r
-    B2 Capslock LED\r
+    /* Column pin configuration
+    * col: 0   1   2   3   4   5   6   7   8   9   10  11  12  13
+    * pin: F0  F1  E6  C7  C6  B6  D4  B1  B7  B5  B4  D7  D6  B3  (Rev.C)
+    */
+     
+    /* Row pin configuration
+    * row: 0   1   2   3   4
+    * pin: D0  D1  D2  D3  D5
+    */
+     
+    GPIO pads
+    0 F7 WASD LEDs
+    1 F6 ESC LED
+    2 F5 FN LED
+    3 F4 POKER Arrow LEDs
+     
+    B2 Capslock LED
     B0 not connected
\ No newline at end of file
index 20afb0db0775d04599ef47a856f7387bae8cff6d..8c744bfd3c5327e44111cf0dfa23d579614ce878 100644 (file)
@@ -1,62 +1,62 @@
-## gh60 Rev C keyboard firmware\r
-\r
-![gh60 Rev C PCB](gh60revc.jpg)\r
-\r
-    /* Column pin configuration\r
-    * col: 0   1   2   3   4   5   6   7   8   9   10  11  12  13\r
-    * pin: F0  F1  E6  C7  C6  B6  D4  B1  B7  B5  B4  D7  D6  B3  (Rev.C)\r
-    */\r
-     \r
-    /* Row pin configuration\r
-    * row: 0   1   2   3   4\r
-    * pin: D0  D1  D2  D3  D5\r
-    */\r
-     \r
-    GPIO pads\r
-    0 F7 WASD LEDs\r
-    1 F6 ESC LED\r
-    2 F5 FN LED\r
-    3 F4 POKER Arrow LEDs\r
-     \r
-    B2 Capslock LED\r
-    B0 not connected\r
-       \r
-Functions to controls LED clusters\r
-       \r
-    gh60_caps_led_on()\r
-    gh60_poker_leds_on()\r
-    gh60_fn_led_on()\r
-    gh60_esc_led_on()\r
-    gh60_wasd_leds_on()\r
-    \r
-    gh60_caps_led_off()\r
-    gh60_poker_leds_off()\r
-    gh60_fn_led_off()\r
-    gh60_esc_led_off()\r
-    gh60_wasd_leds_off()\r
-       \r
-======================\r
-\r
-## Quantum MK Firmware\r
-\r
-For the full Quantum feature list, see [the parent readme.md](/readme.md).\r
-\r
-## Building\r
-\r
-Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. \r
-\r
-Depending on which keymap you would like to use, you will have to compile slightly differently.\r
-\r
-### Default\r
-To build with the default keymap, simply run `make default`.\r
-\r
-### Other Keymaps\r
-Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.\r
-\r
-To build the firmware binary hex file with a keymap just do `make` with a keymap like this:\r
-\r
-```\r
-$ make [default|jack|<name>]\r
-```\r
-\r
-Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.\r
+## gh60 Rev C keyboard firmware
+
+![gh60 Rev C PCB](gh60revc.jpg)
+
+    /* Column pin configuration
+    * col: 0   1   2   3   4   5   6   7   8   9   10  11  12  13
+    * pin: F0  F1  E6  C7  C6  B6  D4  B1  B7  B5  B4  D7  D6  B3  (Rev.C)
+    */
+     
+    /* Row pin configuration
+    * row: 0   1   2   3   4
+    * pin: D0  D1  D2  D3  D5
+    */
+     
+    GPIO pads
+    0 F7 WASD LEDs
+    1 F6 ESC LED
+    2 F5 FN LED
+    3 F4 POKER Arrow LEDs
+     
+    B2 Capslock LED
+    B0 not connected
+       
+Functions to controls LED clusters
+       
+    gh60_caps_led_on()
+    gh60_poker_leds_on()
+    gh60_fn_led_on()
+    gh60_esc_led_on()
+    gh60_wasd_leds_on()
+    
+    gh60_caps_led_off()
+    gh60_poker_leds_off()
+    gh60_fn_led_off()
+    gh60_esc_led_off()
+    gh60_wasd_leds_off()
+       
+======================
+
+## Quantum MK Firmware
+
+For the full Quantum feature list, see [the parent readme.md](/readme.md).
+
+## Building
+
+Download or clone the whole firmware and navigate to the keyboards/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. 
+
+Depending on which keymap you would like to use, you will have to compile slightly differently.
+
+### Default
+To build with the default keymap, simply run `make default`.
+
+### Other Keymaps
+Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
+
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
+```
+$ make [default|jack|<name>]
+```
+
+Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
index b886c383bb3ec23ecdc873c1ca3ab0933b2145f3..43c845739a6a406b166340c5c39a5deec1f544ae 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/chconf.h\r
- * @brief   Configuration file template.\r
- * @details A copy of this file must be placed in each project directory, it\r
- *          contains the application specific kernel settings.\r
- *\r
- * @addtogroup config\r
- * @details Kernel related settings and hooks.\r
- * @{\r
- */\r
-\r
-#ifndef CHCONF_H\r
-#define CHCONF_H\r
-\r
-#define _CHIBIOS_RT_CONF_\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name System timers settings\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   System time counter resolution.\r
- * @note    Allowed values are 16 or 32 bits.\r
- */\r
-#define CH_CFG_ST_RESOLUTION                32\r
-\r
-/**\r
- * @brief   System tick frequency.\r
- * @details Frequency of the system timer that drives the system ticks. This\r
- *          setting also defines the system tick time unit.\r
- */\r
-#define CH_CFG_ST_FREQUENCY                 1000\r
-\r
-/**\r
- * @brief   Time delta constant for the tick-less mode.\r
- * @note    If this value is zero then the system uses the classic\r
- *          periodic tick. This value represents the minimum number\r
- *          of ticks that is safe to specify in a timeout directive.\r
- *          The value one is not valid, timeouts are rounded up to\r
- *          this value.\r
- */\r
-#define CH_CFG_ST_TIMEDELTA                 0\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel parameters and options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Round robin interval.\r
- * @details This constant is the number of system ticks allowed for the\r
- *          threads before preemption occurs. Setting this value to zero\r
- *          disables the preemption for threads with equal priority and the\r
- *          round robin becomes cooperative. Note that higher priority\r
- *          threads can still preempt, the kernel is always preemptive.\r
- * @note    Disabling the round robin preemption makes the kernel more compact\r
- *          and generally faster.\r
- * @note    The round robin preemption is not supported in tickless mode and\r
- *          must be set to zero in that case.\r
- */\r
-#define CH_CFG_TIME_QUANTUM                 20\r
-\r
-/**\r
- * @brief   Managed RAM size.\r
- * @details Size of the RAM area to be managed by the OS. If set to zero\r
- *          then the whole available RAM is used. The core memory is made\r
- *          available to the heap allocator and/or can be used directly through\r
- *          the simplified core memory allocator.\r
- *\r
- * @note    In order to let the OS manage the whole RAM the linker script must\r
- *          provide the @p __heap_base__ and @p __heap_end__ symbols.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE.\r
- */\r
-#define CH_CFG_MEMCORE_SIZE                 0\r
-\r
-/**\r
- * @brief   Idle thread automatic spawn suppression.\r
- * @details When this option is activated the function @p chSysInit()\r
- *          does not spawn the idle thread. The application @p main()\r
- *          function becomes the idle thread and must implement an\r
- *          infinite loop.\r
- */\r
-#define CH_CFG_NO_IDLE_THREAD               FALSE\r
-\r
-/* Use __WFI in the idle thread for waiting. Does lower the power\r
- * consumption. */\r
-#define CORTEX_ENABLE_WFI_IDLE              TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Performance options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   OS optimization.\r
- * @details If enabled then time efficient rather than space efficient code\r
- *          is used when two possible implementations exist.\r
- *\r
- * @note    This is not related to the compiler optimization options.\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_OPTIMIZE_SPEED               TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Subsystem options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Time Measurement APIs.\r
- * @details If enabled then the time measurement APIs are included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_TM                       FALSE\r
-\r
-/**\r
- * @brief   Threads registry APIs.\r
- * @details If enabled then the registry APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_REGISTRY                 TRUE\r
-\r
-/**\r
- * @brief   Threads synchronization APIs.\r
- * @details If enabled then the @p chThdWait() function is included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_WAITEXIT                 TRUE\r
-\r
-/**\r
- * @brief   Semaphores APIs.\r
- * @details If enabled then the Semaphores APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES               TRUE\r
-\r
-/**\r
- * @brief   Semaphores queuing mode.\r
- * @details If enabled then the threads are enqueued on semaphores by\r
- *          priority rather than in FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE\r
-\r
-/**\r
- * @brief   Mutexes APIs.\r
- * @details If enabled then the mutexes APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MUTEXES                  TRUE\r
-\r
-/**\r
- * @brief   Enables recursive behavior on mutexes.\r
- * @note    Recursive mutexes are heavier and have an increased\r
- *          memory footprint.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs.\r
- * @details If enabled then the conditional variables APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_CONDVARS                 TRUE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs with timeout.\r
- * @details If enabled then the conditional variables APIs with timeout\r
- *          specification are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_CONDVARS.\r
- */\r
-#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs.\r
- * @details If enabled then the event flags APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_EVENTS                   TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs with timeout.\r
- * @details If enabled then the events APIs with timeout specification\r
- *          are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_EVENTS.\r
- */\r
-#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages APIs.\r
- * @details If enabled then the synchronous messages APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MESSAGES                 TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages queuing mode.\r
- * @details If enabled then messages are served by priority rather than in\r
- *          FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_MESSAGES.\r
- */\r
-#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE\r
-\r
-/**\r
- * @brief   Mailboxes APIs.\r
- * @details If enabled then the asynchronous messages (mailboxes) APIs are\r
- *          included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_MAILBOXES                TRUE\r
-\r
-/**\r
- * @brief   Core Memory Manager APIs.\r
- * @details If enabled then the core memory manager APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMCORE                  TRUE\r
-\r
-/**\r
- * @brief   Heap Allocator APIs.\r
- * @details If enabled then the memory heap allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or\r
- *          @p CH_CFG_USE_SEMAPHORES.\r
- * @note    Mutexes are recommended.\r
- */\r
-#define CH_CFG_USE_HEAP                     TRUE\r
-\r
-/**\r
- * @brief   Memory Pools Allocator APIs.\r
- * @details If enabled then the memory pools allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMPOOLS                 TRUE\r
-\r
-/**\r
- * @brief   Dynamic Threads APIs.\r
- * @details If enabled then the dynamic threads creation APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_WAITEXIT.\r
- * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.\r
- */\r
-#define CH_CFG_USE_DYNAMIC                  TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Debug options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Debug option, kernel statistics.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_STATISTICS                   FALSE\r
-\r
-/**\r
- * @brief   Debug option, system state check.\r
- * @details If enabled the correct call protocol for system APIs is checked\r
- *          at runtime.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_SYSTEM_STATE_CHECK           FALSE\r
-\r
-/**\r
- * @brief   Debug option, parameters checks.\r
- * @details If enabled then the checks on the API functions input\r
- *          parameters are activated.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_CHECKS                FALSE\r
-\r
-/**\r
- * @brief   Debug option, consistency checks.\r
- * @details If enabled then all the assertions in the kernel code are\r
- *          activated. This includes consistency checks inside the kernel,\r
- *          runtime anomalies and port-defined checks.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_ASSERTS               FALSE\r
-\r
-/**\r
- * @brief   Debug option, trace buffer.\r
- * @details If enabled then the trace buffer is activated.\r
- *\r
- * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED\r
-\r
-/**\r
- * @brief   Trace buffer entries.\r
- * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is\r
- *          different from @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_BUFFER_SIZE            128\r
-\r
-/**\r
- * @brief   Debug option, stack checks.\r
- * @details If enabled then a runtime stack check is performed.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    The stack check is performed in a architecture/port dependent way.\r
- *          It may not be implemented or some ports.\r
- * @note    The default failure mode is to halt the system with the global\r
- *          @p panic_msg variable set to @p NULL.\r
- */\r
-#define CH_DBG_ENABLE_STACK_CHECK           FALSE\r
-\r
-/**\r
- * @brief   Debug option, stacks initialization.\r
- * @details If enabled then the threads working area is filled with a byte\r
- *          value when a thread is created. This can be useful for the\r
- *          runtime measurement of the used stack.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_FILL_THREADS                 FALSE\r
-\r
-/**\r
- * @brief   Debug option, threads profiling.\r
- * @details If enabled then a field is added to the @p thread_t structure that\r
- *          counts the system ticks occurred while executing the thread.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    This debug option is not currently compatible with the\r
- *          tickless mode.\r
- */\r
-#define CH_DBG_THREADS_PROFILING            FALSE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel hooks\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Threads descriptor structure extension.\r
- * @details User fields added to the end of the @p thread_t structure.\r
- */\r
-#define CH_CFG_THREAD_EXTRA_FIELDS                                          \\r
-  /* Add threads custom fields here.*/\r
-\r
-/**\r
- * @brief   Threads initialization hook.\r
- * @details User initialization code added to the @p chThdInit() API.\r
- *\r
- * @note    It is invoked from within @p chThdInit() and implicitly from all\r
- *          the threads creation APIs.\r
- */\r
-#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \\r
-  /* Add threads initialization code here.*/                                \\r
-}\r
-\r
-/**\r
- * @brief   Threads finalization hook.\r
- * @details User finalization code added to the @p chThdExit() API.\r
- */\r
-#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \\r
-  /* Add threads finalization code here.*/                                  \\r
-}\r
-\r
-/**\r
- * @brief   Context switch hook.\r
- * @details This hook is invoked just before switching between threads.\r
- */\r
-#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \\r
-  /* Context switch code here.*/                                            \\r
-}\r
-\r
-/**\r
- * @brief   ISR enter hook.\r
- */\r
-#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \\r
-  /* IRQ prologue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   ISR exit hook.\r
- */\r
-#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \\r
-  /* IRQ epilogue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread enter hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to activate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_ENTER_HOOK() {                                          \\r
-  /* Idle-enter code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread leave hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to deactivate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \\r
-  /* Idle-leave code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle Loop hook.\r
- * @details This hook is continuously invoked by the idle thread loop.\r
- */\r
-#define CH_CFG_IDLE_LOOP_HOOK() {                                           \\r
-  /* Idle loop code here.*/                                                 \\r
-}\r
-\r
-/**\r
- * @brief   System tick event hook.\r
- * @details This hook is invoked in the system tick handler immediately\r
- *          after processing the virtual timers queue.\r
- */\r
-#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \\r
-  /* System tick event code here.*/                                         \\r
-}\r
-\r
-/**\r
- * @brief   System halt hook.\r
- * @details This hook is invoked in case to a system halting error before\r
- *          the system is halted.\r
- */\r
-#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \\r
-  /* System halt code here.*/                                               \\r
-}\r
-\r
-/**\r
- * @brief   Trace hook.\r
- * @details This hook is invoked each time a new record is written in the\r
- *          trace buffer.\r
- */\r
-#define CH_CFG_TRACE_HOOK(tep) {                                            \\r
-  /* Trace code here.*/                                                     \\r
-}\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/* Port-specific settings (override port settings defaulted in chcore.h).    */\r
-/*===========================================================================*/\r
-\r
-#endif  /* CHCONF_H */\r
-\r
-/** @} */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/chconf.h
+ * @brief   Configuration file template.
+ * @details A copy of this file must be placed in each project directory, it
+ *          contains the application specific kernel settings.
+ *
+ * @addtogroup config
+ * @details Kernel related settings and hooks.
+ * @{
+ */
+
+#ifndef CHCONF_H
+#define CHCONF_H
+
+#define _CHIBIOS_RT_CONF_
+
+/*===========================================================================*/
+/**
+ * @name System timers settings
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   System time counter resolution.
+ * @note    Allowed values are 16 or 32 bits.
+ */
+#define CH_CFG_ST_RESOLUTION                32
+
+/**
+ * @brief   System tick frequency.
+ * @details Frequency of the system timer that drives the system ticks. This
+ *          setting also defines the system tick time unit.
+ */
+#define CH_CFG_ST_FREQUENCY                 1000
+
+/**
+ * @brief   Time delta constant for the tick-less mode.
+ * @note    If this value is zero then the system uses the classic
+ *          periodic tick. This value represents the minimum number
+ *          of ticks that is safe to specify in a timeout directive.
+ *          The value one is not valid, timeouts are rounded up to
+ *          this value.
+ */
+#define CH_CFG_ST_TIMEDELTA                 0
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel parameters and options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Round robin interval.
+ * @details This constant is the number of system ticks allowed for the
+ *          threads before preemption occurs. Setting this value to zero
+ *          disables the preemption for threads with equal priority and the
+ *          round robin becomes cooperative. Note that higher priority
+ *          threads can still preempt, the kernel is always preemptive.
+ * @note    Disabling the round robin preemption makes the kernel more compact
+ *          and generally faster.
+ * @note    The round robin preemption is not supported in tickless mode and
+ *          must be set to zero in that case.
+ */
+#define CH_CFG_TIME_QUANTUM                 20
+
+/**
+ * @brief   Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ *          then the whole available RAM is used. The core memory is made
+ *          available to the heap allocator and/or can be used directly through
+ *          the simplified core memory allocator.
+ *
+ * @note    In order to let the OS manage the whole RAM the linker script must
+ *          provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note    Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE                 0
+
+/**
+ * @brief   Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ *          does not spawn the idle thread. The application @p main()
+ *          function becomes the idle thread and must implement an
+ *          infinite loop.
+ */
+#define CH_CFG_NO_IDLE_THREAD               FALSE
+
+/* Use __WFI in the idle thread for waiting. Does lower the power
+ * consumption. */
+#define CORTEX_ENABLE_WFI_IDLE              TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Performance options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   OS optimization.
+ * @details If enabled then time efficient rather than space efficient code
+ *          is used when two possible implementations exist.
+ *
+ * @note    This is not related to the compiler optimization options.
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_OPTIMIZE_SPEED               TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Subsystem options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Time Measurement APIs.
+ * @details If enabled then the time measurement APIs are included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_TM                       FALSE
+
+/**
+ * @brief   Threads registry APIs.
+ * @details If enabled then the registry APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_REGISTRY                 TRUE
+
+/**
+ * @brief   Threads synchronization APIs.
+ * @details If enabled then the @p chThdWait() function is included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_WAITEXIT                 TRUE
+
+/**
+ * @brief   Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES               TRUE
+
+/**
+ * @brief   Semaphores queuing mode.
+ * @details If enabled then the threads are enqueued on semaphores by
+ *          priority rather than in FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
+
+/**
+ * @brief   Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MUTEXES                  TRUE
+
+/**
+ * @brief   Enables recursive behavior on mutexes.
+ * @note    Recursive mutexes are heavier and have an increased
+ *          memory footprint.
+ *
+ * @note    The default is @p FALSE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
+
+/**
+ * @brief   Conditional Variables APIs.
+ * @details If enabled then the conditional variables APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_CONDVARS                 TRUE
+
+/**
+ * @brief   Conditional Variables APIs with timeout.
+ * @details If enabled then the conditional variables APIs with timeout
+ *          specification are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_CONDVARS.
+ */
+#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE
+
+/**
+ * @brief   Events Flags APIs.
+ * @details If enabled then the event flags APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_EVENTS                   TRUE
+
+/**
+ * @brief   Events Flags APIs with timeout.
+ * @details If enabled then the events APIs with timeout specification
+ *          are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_EVENTS.
+ */
+#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
+
+/**
+ * @brief   Synchronous Messages APIs.
+ * @details If enabled then the synchronous messages APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MESSAGES                 TRUE
+
+/**
+ * @brief   Synchronous Messages queuing mode.
+ * @details If enabled then messages are served by priority rather than in
+ *          FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_MESSAGES.
+ */
+#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
+
+/**
+ * @brief   Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ *          included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES                TRUE
+
+/**
+ * @brief   Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE                  TRUE
+
+/**
+ * @brief   Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
+ *          @p CH_CFG_USE_SEMAPHORES.
+ * @note    Mutexes are recommended.
+ */
+#define CH_CFG_USE_HEAP                     TRUE
+
+/**
+ * @brief   Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS                 TRUE
+
+/**
+ * @brief   Dynamic Threads APIs.
+ * @details If enabled then the dynamic threads creation APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_WAITEXIT.
+ * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
+ */
+#define CH_CFG_USE_DYNAMIC                  TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Debug options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Debug option, kernel statistics.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS                   FALSE
+
+/**
+ * @brief   Debug option, system state check.
+ * @details If enabled the correct call protocol for system APIs is checked
+ *          at runtime.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
+
+/**
+ * @brief   Debug option, parameters checks.
+ * @details If enabled then the checks on the API functions input
+ *          parameters are activated.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS                FALSE
+
+/**
+ * @brief   Debug option, consistency checks.
+ * @details If enabled then all the assertions in the kernel code are
+ *          activated. This includes consistency checks inside the kernel,
+ *          runtime anomalies and port-defined checks.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_ASSERTS               FALSE
+
+/**
+ * @brief   Debug option, trace buffer.
+ * @details If enabled then the trace buffer is activated.
+ *
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
+
+/**
+ * @brief   Trace buffer entries.
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_BUFFER_SIZE            128
+
+/**
+ * @brief   Debug option, stack checks.
+ * @details If enabled then a runtime stack check is performed.
+ *
+ * @note    The default is @p FALSE.
+ * @note    The stack check is performed in a architecture/port dependent way.
+ *          It may not be implemented or some ports.
+ * @note    The default failure mode is to halt the system with the global
+ *          @p panic_msg variable set to @p NULL.
+ */
+#define CH_DBG_ENABLE_STACK_CHECK           FALSE
+
+/**
+ * @brief   Debug option, stacks initialization.
+ * @details If enabled then the threads working area is filled with a byte
+ *          value when a thread is created. This can be useful for the
+ *          runtime measurement of the used stack.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_FILL_THREADS                 FALSE
+
+/**
+ * @brief   Debug option, threads profiling.
+ * @details If enabled then a field is added to the @p thread_t structure that
+ *          counts the system ticks occurred while executing the thread.
+ *
+ * @note    The default is @p FALSE.
+ * @note    This debug option is not currently compatible with the
+ *          tickless mode.
+ */
+#define CH_DBG_THREADS_PROFILING            FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel hooks
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Threads descriptor structure extension.
+ * @details User fields added to the end of the @p thread_t structure.
+ */
+#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
+  /* Add threads custom fields here.*/
+
+/**
+ * @brief   Threads initialization hook.
+ * @details User initialization code added to the @p chThdInit() API.
+ *
+ * @note    It is invoked from within @p chThdInit() and implicitly from all
+ *          the threads creation APIs.
+ */
+#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
+  /* Add threads initialization code here.*/                                \
+}
+
+/**
+ * @brief   Threads finalization hook.
+ * @details User finalization code added to the @p chThdExit() API.
+ */
+#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
+  /* Add threads finalization code here.*/                                  \
+}
+
+/**
+ * @brief   Context switch hook.
+ * @details This hook is invoked just before switching between threads.
+ */
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
+  /* Context switch code here.*/                                            \
+}
+
+/**
+ * @brief   ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
+  /* IRQ prologue code here.*/                                              \
+}
+
+/**
+ * @brief   ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
+  /* IRQ epilogue code here.*/                                              \
+}
+
+/**
+ * @brief   Idle thread enter hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
+  /* Idle-enter code here.*/                                                \
+}
+
+/**
+ * @brief   Idle thread leave hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
+  /* Idle-leave code here.*/                                                \
+}
+
+/**
+ * @brief   Idle Loop hook.
+ * @details This hook is continuously invoked by the idle thread loop.
+ */
+#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
+  /* Idle loop code here.*/                                                 \
+}
+
+/**
+ * @brief   System tick event hook.
+ * @details This hook is invoked in the system tick handler immediately
+ *          after processing the virtual timers queue.
+ */
+#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
+  /* System tick event code here.*/                                         \
+}
+
+/**
+ * @brief   System halt hook.
+ * @details This hook is invoked in case to a system halting error before
+ *          the system is halted.
+ */
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
+  /* System halt code here.*/                                               \
+}
+
+/**
+ * @brief   Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ *          trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) {                                            \
+  /* Trace code here.*/                                                     \
+}
+
+/** @} */
+
+/*===========================================================================*/
+/* Port-specific settings (override port settings defaulted in chcore.h).    */
+/*===========================================================================*/
+
+#endif  /* CHCONF_H */
+
+/** @} */
index 53538de149bd2e05339b1b7550f56d2b8f344fb1..46b37a4f4696c192cd6c9d1ff5c983e4f0b5f0d8 100644 (file)
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/halconf.h\r
- * @brief   HAL configuration header.\r
- * @details HAL configuration file, this file allows to enable or disable the\r
- *          various device drivers from your application. You may also use\r
- *          this file in order to override the device drivers default settings.\r
- *\r
- * @addtogroup HAL_CONF\r
- * @{\r
- */\r
-\r
-#ifndef _HALCONF_H_\r
-#define _HALCONF_H_\r
-\r
-#include "mcuconf.h"\r
-\r
-/**\r
- * @brief   Enables the PAL subsystem.\r
- */\r
-#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_PAL                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ADC subsystem.\r
- */\r
-#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)\r
-#define HAL_USE_ADC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the CAN subsystem.\r
- */\r
-#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)\r
-#define HAL_USE_CAN                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the DAC subsystem.\r
- */\r
-#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_DAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the EXT subsystem.\r
- */\r
-#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)\r
-#define HAL_USE_EXT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the GPT subsystem.\r
- */\r
-#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)\r
-#define HAL_USE_GPT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2C subsystem.\r
- */\r
-#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2C                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2S subsystem.\r
- */\r
-#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2S                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ICU subsystem.\r
- */\r
-#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)\r
-#define HAL_USE_ICU                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MAC subsystem.\r
- */\r
-#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_MAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MMC_SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_MMC_SPI             FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the PWM subsystem.\r
- */\r
-#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)\r
-#define HAL_USE_PWM                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the RTC subsystem.\r
- */\r
-#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)\r
-#define HAL_USE_RTC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SDC subsystem.\r
- */\r
-#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)\r
-#define HAL_USE_SDC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL              FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL over USB subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL_USB          TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_SPI                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the UART subsystem.\r
- */\r
-#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)\r
-#define HAL_USE_UART                FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the USB subsystem.\r
- */\r
-#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_USB                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the WDG subsystem.\r
- */\r
-#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)\r
-#define HAL_USE_WDG                 FALSE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* ADC driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables synchronous APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)\r
-#define ADC_USE_WAIT                TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)\r
-#define ADC_USE_MUTUAL_EXCLUSION    TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* CAN driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Sleep mode related APIs inclusion switch.\r
- */\r
-#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)\r
-#define CAN_USE_SLEEP_MODE          TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* I2C driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables the mutual exclusion APIs on the I2C bus.\r
- */\r
-#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)\r
-#define I2C_USE_MUTUAL_EXCLUSION    TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* MAC driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables an event sources for incoming packets.\r
- */\r
-#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)\r
-#define MAC_USE_ZERO_COPY           FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables an event sources for incoming packets.\r
- */\r
-#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)\r
-#define MAC_USE_EVENTS              TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* MMC_SPI driver related settings.                                          */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Delays insertions.\r
- * @details If enabled this options inserts delays into the MMC waiting\r
- *          routines releasing some extra CPU time for the threads with\r
- *          lower priority, this may slow down the driver a bit however.\r
- *          This option is recommended also if the SPI driver does not\r
- *          use a DMA channel and heavily loads the CPU.\r
- */\r
-#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)\r
-#define MMC_NICE_WAITING            TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* SDC driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Number of initialization attempts before rejecting the card.\r
- * @note    Attempts are performed at 10mS intervals.\r
- */\r
-#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)\r
-#define SDC_INIT_RETRY              100\r
-#endif\r
-\r
-/**\r
- * @brief   Include support for MMC cards.\r
- * @note    MMC support is not yet implemented so this option must be kept\r
- *          at @p FALSE.\r
- */\r
-#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)\r
-#define SDC_MMC_SUPPORT             FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Delays insertions.\r
- * @details If enabled this options inserts delays into the MMC waiting\r
- *          routines releasing some extra CPU time for the threads with\r
- *          lower priority, this may slow down the driver a bit however.\r
- */\r
-#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)\r
-#define SDC_NICE_WAITING            TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* SERIAL driver related settings.                                           */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Default bit rate.\r
- * @details Configuration parameter, this is the baud rate selected for the\r
- *          default configuration.\r
- */\r
-#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)\r
-#define SERIAL_DEFAULT_BITRATE      38400\r
-#endif\r
-\r
-/**\r
- * @brief   Serial buffers size.\r
- * @details Configuration parameter, you can change the depth of the queue\r
- *          buffers depending on the requirements of your application.\r
- * @note    The default is 64 bytes for both the transmission and receive\r
- *          buffers.\r
- */\r
-#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)\r
-#define SERIAL_BUFFERS_SIZE         16\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* SERIAL_USB driver related setting.                                        */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Serial over USB buffers size.\r
- * @details Configuration parameter, the buffer size must be a multiple of\r
- *          the USB data endpoint maximum packet size.\r
- * @note    The default is 64 bytes for both the transmission and receive\r
- *          buffers.\r
- */\r
-#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)\r
-#define SERIAL_USB_BUFFERS_SIZE     256\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* SPI driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables synchronous APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)\r
-#define SPI_USE_WAIT                TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)\r
-#define SPI_USE_MUTUAL_EXCLUSION    TRUE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* USB driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables synchronous APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)\r
-#define USB_USE_WAIT                TRUE\r
-#endif\r
-\r
-#endif /* _HALCONF_H_ */\r
-\r
-/** @} */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/halconf.h
+ * @brief   HAL configuration header.
+ * @details HAL configuration file, this file allows to enable or disable the
+ *          various device drivers from your application. You may also use
+ *          this file in order to override the device drivers default settings.
+ *
+ * @addtogroup HAL_CONF
+ * @{
+ */
+
+#ifndef _HALCONF_H_
+#define _HALCONF_H_
+
+#include "mcuconf.h"
+
+/**
+ * @brief   Enables the PAL subsystem.
+ */
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
+#define HAL_USE_PAL                 TRUE
+#endif
+
+/**
+ * @brief   Enables the ADC subsystem.
+ */
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
+#define HAL_USE_ADC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the CAN subsystem.
+ */
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
+#define HAL_USE_CAN                 FALSE
+#endif
+
+/**
+ * @brief   Enables the DAC subsystem.
+ */
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
+#define HAL_USE_DAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the EXT subsystem.
+ */
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
+#define HAL_USE_EXT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2C subsystem.
+ */
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
+#define HAL_USE_I2C                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2S subsystem.
+ */
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
+#define HAL_USE_I2S                 FALSE
+#endif
+
+/**
+ * @brief   Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MAC subsystem.
+ */
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
+#define HAL_USE_MAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MMC_SPI subsystem.
+ */
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_MMC_SPI             FALSE
+#endif
+
+/**
+ * @brief   Enables the PWM subsystem.
+ */
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
+#define HAL_USE_PWM                 FALSE
+#endif
+
+/**
+ * @brief   Enables the RTC subsystem.
+ */
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
+#define HAL_USE_RTC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL subsystem.
+ */
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL              FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB          TRUE
+#endif
+
+/**
+ * @brief   Enables the SPI subsystem.
+ */
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_SPI                 FALSE
+#endif
+
+/**
+ * @brief   Enables the UART subsystem.
+ */
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
+#define HAL_USE_UART                FALSE
+#endif
+
+/**
+ * @brief   Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB                 TRUE
+#endif
+
+/**
+ * @brief   Enables the WDG subsystem.
+ */
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
+#define HAL_USE_WDG                 FALSE
+#endif
+
+/*===========================================================================*/
+/* ADC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
+#define ADC_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define ADC_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* CAN driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Sleep mode related APIs inclusion switch.
+ */
+#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
+#define CAN_USE_SLEEP_MODE          TRUE
+#endif
+
+/*===========================================================================*/
+/* I2C driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables the mutual exclusion APIs on the I2C bus.
+ */
+#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define I2C_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* MAC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
+#define MAC_USE_ZERO_COPY           FALSE
+#endif
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
+#define MAC_USE_EVENTS              TRUE
+#endif
+
+/*===========================================================================*/
+/* MMC_SPI driver related settings.                                          */
+/*===========================================================================*/
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ *          This option is recommended also if the SPI driver does not
+ *          use a DMA channel and heavily loads the CPU.
+ */
+#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
+#define MMC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SDC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Number of initialization attempts before rejecting the card.
+ * @note    Attempts are performed at 10mS intervals.
+ */
+#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
+#define SDC_INIT_RETRY              100
+#endif
+
+/**
+ * @brief   Include support for MMC cards.
+ * @note    MMC support is not yet implemented so this option must be kept
+ *          at @p FALSE.
+ */
+#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
+#define SDC_MMC_SUPPORT             FALSE
+#endif
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ */
+#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
+#define SDC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SERIAL driver related settings.                                           */
+/*===========================================================================*/
+
+/**
+ * @brief   Default bit rate.
+ * @details Configuration parameter, this is the baud rate selected for the
+ *          default configuration.
+ */
+#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
+#define SERIAL_DEFAULT_BITRATE      38400
+#endif
+
+/**
+ * @brief   Serial buffers size.
+ * @details Configuration parameter, you can change the depth of the queue
+ *          buffers depending on the requirements of your application.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_BUFFERS_SIZE         16
+#endif
+
+/*===========================================================================*/
+/* SERIAL_USB driver related setting.                                        */
+/*===========================================================================*/
+
+/**
+ * @brief   Serial over USB buffers size.
+ * @details Configuration parameter, the buffer size must be a multiple of
+ *          the USB data endpoint maximum packet size.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_USB_BUFFERS_SIZE     256
+#endif
+
+/*===========================================================================*/
+/* SPI driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
+#define SPI_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define SPI_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* USB driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
+#define USB_USE_WAIT                TRUE
+#endif
+
+#endif /* _HALCONF_H_ */
+
+/** @} */
index 66b6ce25de73edba55c6be052e8e842e4efad2c2..f453304b7578862f48070fb971dfa571671ad2b4 100644 (file)
@@ -1,55 +1,55 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-#define K20x_MCUCONF\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-\r
-/* Select the MCU clocking mode below by enabling the appropriate block. */\r
-\r
-#define KINETIS_NO_INIT             FALSE\r
-\r
-/* FEI mode - 48 MHz with internal 32.768 kHz crystal */\r
-#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI\r
-#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */\r
-#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */\r
-#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */\r
-#define KINETIS_CLKDIV1_OUTDIV1     1\r
-#define KINETIS_CLKDIV1_OUTDIV2     1\r
-#define KINETIS_CLKDIV1_OUTDIV4     2\r
-#define KINETIS_BUSCLK_FREQUENCY    KINETIS_SYSCLK_FREQUENCY\r
-#define KINETIS_FLASHCLK_FREQUENCY  KINETIS_SYSCLK_FREQUENCY/2\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define KINETIS_SERIAL_USE_UART0            TRUE\r
-\r
-/*\r
- * USB driver settings\r
- */\r
-#define KINETIS_USB_USE_USB0                TRUE\r
-/* Need to redefine this, since the default is for K20x */\r
-/* This is for Teensy LC; you should comment it out (or change to 5)\r
- * for Teensy 3.x */\r
-#define KINETIS_USB_USB0_IRQ_PRIORITY       2\r
-\r
-#endif /* _MCUCONF_H_ */\r
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#ifndef _MCUCONF_H_
+#define _MCUCONF_H_
+
+#define K20x_MCUCONF
+
+/*
+ * HAL driver system settings.
+ */
+
+/* Select the MCU clocking mode below by enabling the appropriate block. */
+
+#define KINETIS_NO_INIT             FALSE
+
+/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
+#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI
+#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */
+#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */
+#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */
+#define KINETIS_CLKDIV1_OUTDIV1     1
+#define KINETIS_CLKDIV1_OUTDIV2     1
+#define KINETIS_CLKDIV1_OUTDIV4     2
+#define KINETIS_BUSCLK_FREQUENCY    KINETIS_SYSCLK_FREQUENCY
+#define KINETIS_FLASHCLK_FREQUENCY  KINETIS_SYSCLK_FREQUENCY/2
+
+/*
+ * SERIAL driver system settings.
+ */
+#define KINETIS_SERIAL_USE_UART0            TRUE
+
+/*
+ * USB driver settings
+ */
+#define KINETIS_USB_USE_USB0                TRUE
+/* Need to redefine this, since the default is for K20x */
+/* This is for Teensy LC; you should comment it out (or change to 5)
+ * for Teensy 3.x */
+#define KINETIS_USB_USB0_IRQ_PRIORITY       2
+
+#endif /* _MCUCONF_H_ */
index 0cec70ce224f4317af446d1cacaeb6d13de2ad9c..06434b98d9378949fc271b7bc86bfb570a76218e 100644 (file)
-;---------------------------------------------------------------------------;\r
-; Extended itoa, puts, printf and atoi                     (C)ChaN, 2011\r
-;---------------------------------------------------------------------------;\r
-\r
-                               // Base size is 152 bytes\r
-#define        CR_CRLF         0       // Convert \n to \r\n (+10 bytes)\r
-#define USE_XPRINTF    1       // Enable xprintf function (+194 bytes)\r
-#define USE_XSPRINTF   0       // Add xsprintf function (+78 bytes)\r
-#define USE_XFPRINTF   0       // Add xfprintf function (+54 bytes)\r
-#define USE_XATOI      0       // Enable xatoi function (+182 bytes)\r
-\r
-\r
-#if FLASHEND > 0x1FFFF\r
-#error xitoa module does not support 256K devices\r
-#endif\r
-\r
-.nolist\r
-#include <avr/io.h>    // Include device specific definitions.\r
-.list\r
-\r
-#ifdef SPM_PAGESIZE    // Recent devices have "lpm Rd,Z+" and "movw".\r
-.macro _LPMI   reg\r
-       lpm     \reg, Z+\r
-.endm\r
-.macro _MOVW   dh,dl, sh,sl\r
-       movw    \dl, \sl\r
-.endm\r
-#else                  // Earlier devices do not have "lpm Rd,Z+" nor "movw".\r
-.macro _LPMI   reg\r
-       lpm\r
-       mov     \reg, r0\r
-       adiw    ZL, 1\r
-.endm\r
-.macro _MOVW   dh,dl, sh,sl\r
-       mov     \dl, \sl\r
-       mov     \dh, \sh\r
-.endm\r
-#endif\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------\r
-; Stub function to forward to user output function\r
-;\r
-;Prototype: void xputc (char chr       // a character to be output\r
-;                      );\r
-;Size: 12/12 words\r
-\r
-.section .bss\r
-.global xfunc_out      ; xfunc_out must be initialized before using this module.\r
-xfunc_out:     .ds.w   1\r
-.section .text\r
-\r
-\r
-.func xputc\r
-.global xputc\r
-xputc:\r
-#if CR_CRLF\r
-       cpi     r24, 10         ;LF --> CRLF\r
-       brne    1f              ;\r
-       ldi     r24, 13         ;\r
-       rcall   1f              ;\r
-       ldi     r24, 10         ;/\r
-1:\r
-#endif\r
-       push    ZH\r
-       push    ZL\r
-       lds     ZL, xfunc_out+0 ;Pointer to the registered output function.\r
-       lds     ZH, xfunc_out+1 ;/\r
-       sbiw    ZL, 0           ;Skip if null\r
-       breq    2f              ;/\r
-       icall\r
-2:     pop     ZL\r
-       pop     ZH\r
-       ret\r
-.endfunc\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------\r
-; Direct ROM string output\r
-;\r
-;Prototype: void xputs (const char *str_p // rom string to be output\r
-;                      );\r
-\r
-.func xputs\r
-.global xputs\r
-xputs:\r
-       _MOVW   ZH,ZL, r25,r24  ; Z = pointer to rom string\r
-1:     _LPMI   r24\r
-       cpi     r24, 0\r
-       breq    2f\r
-       rcall   xputc\r
-       rjmp    1b\r
-2:     ret\r
-.endfunc\r
-\r
-\r
-;---------------------------------------------------------------------------\r
-; Extended direct numeral string output (32bit version)\r
-;\r
-;Prototype: void xitoa (long value,    // value to be output\r
-;                       char radix,    // radix\r
-;                       char width);   // minimum width\r
-;\r
-\r
-.func xitoa\r
-.global xitoa\r
-xitoa:\r
-                               ;r25:r22 = value, r20 = base, r18 = digits\r
-       clr     r31             ;r31 = stack level\r
-       ldi     r30, ' '        ;r30 = sign\r
-       ldi     r19, ' '        ;r19 = filler\r
-       sbrs    r20, 7          ;When base indicates signd format and the value\r
-       rjmp    0f              ;is minus, add a '-'.\r
-       neg     r20             ;\r
-       sbrs    r25, 7          ;\r
-       rjmp    0f              ;\r
-       ldi     r30, '-'        ;\r
-       com     r22             ;\r
-       com     r23             ;\r
-       com     r24             ;\r
-       com     r25             ;\r
-       adc     r22, r1         ;\r
-       adc     r23, r1         ;\r
-       adc     r24, r1         ;\r
-       adc     r25, r1         ;/\r
-0:     sbrs    r18, 7          ;When digits indicates zero filled,\r
-       rjmp    1f              ;filler is '0'.\r
-       neg     r18             ;\r
-       ldi     r19, '0'        ;/\r
-                               ;----- string conversion loop\r
-1:     ldi     r21, 32         ;r26 = r25:r22 % r20\r
-       clr     r26             ;r25:r22 /= r20\r
-2:     lsl     r22             ;\r
-       rol     r23             ;\r
-       rol     r24             ;\r
-       rol     r25             ;\r
-       rol     r26             ;\r
-       cp      r26, r20        ;\r
-       brcs    3f              ;\r
-       sub     r26, r20        ;\r
-       inc     r22             ;\r
-3:     dec     r21             ;\r
-       brne    2b              ;/\r
-       cpi     r26, 10         ;r26 is a numeral digit '0'-'F'\r
-       brcs    4f              ;\r
-       subi    r26, -7         ;\r
-4:     subi    r26, -'0'       ;/\r
-       push    r26             ;Stack it\r
-       inc     r31             ;/\r
-       cp      r22, r1         ;Repeat until r25:r22 gets zero\r
-       cpc     r23, r1         ;\r
-       cpc     r24, r1         ;\r
-       cpc     r25, r1         ;\r
-       brne    1b              ;/\r
-\r
-       cpi     r30, '-'        ;Minus sign if needed\r
-       brne    5f              ;\r
-       push    r30             ;\r
-       inc     r31             ;/\r
-5:     cp      r31, r18        ;Filler\r
-       brcc    6f              ;\r
-       push    r19             ;\r
-       inc     r31             ;\r
-       rjmp    5b              ;/\r
-\r
-6:     pop     r24             ;Flush stacked digits and exit\r
-       rcall   xputc           ;\r
-       dec     r31             ;\r
-       brne    6b              ;/\r
-\r
-       ret\r
-.endfunc\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------;\r
-; Formatted string output (16/32bit version)\r
-;\r
-;Prototype:\r
-; void __xprintf (const char *format_p, ...);\r
-; void __xsprintf(char*, const char *format_p, ...);\r
-; void __xfprintf(void(*func)(char), const char *format_p, ...);\r
-;\r
-\r
-#if USE_XPRINTF\r
-\r
-.func xvprintf\r
-xvprintf:\r
-       ld      ZL, Y+          ;Z = pointer to format string\r
-       ld      ZH, Y+          ;/\r
-\r
-0:     _LPMI   r24             ;Get a format char\r
-       cpi     r24, 0          ;End of format string?\r
-       breq    90f             ;/\r
-       cpi     r24, '%'        ;Is format?\r
-       breq    20f             ;/\r
-1:     rcall   xputc           ;Put a normal character\r
-       rjmp    0b              ;/\r
-90:    ret\r
-\r
-20:    ldi     r18, 0          ;r18: digits\r
-       clt                     ;T: filler\r
-       _LPMI   r21             ;Get flags\r
-       cpi     r21, '%'        ;Is a %?\r
-       breq    1b              ;/\r
-       cpi     r21, '0'        ;Zero filled?\r
-       brne    23f             ;\r
-       set                     ;/\r
-22:    _LPMI   r21             ;Get width\r
-23:    cpi     r21, '9'+1      ;\r
-       brcc    24f             ;\r
-       subi    r21, '0'        ;\r
-       brcs    90b             ;\r
-       lsl     r18             ;\r
-       mov     r0, r18         ;\r
-       lsl     r18             ;\r
-       lsl     r18             ;\r
-       add     r18, r0         ;\r
-       add     r18, r21        ;\r
-       rjmp    22b             ;/\r
-\r
-24:    brtc    25f             ;get value (low word)\r
-       neg     r18             ;\r
-25:    ld      r24, Y+         ;\r
-       ld      r25, Y+         ;/\r
-       cpi     r21, 'c'        ;Is type character?\r
-       breq    1b              ;/\r
-       cpi     r21, 's'        ;Is type RAM string?\r
-       breq    50f             ;/\r
-       cpi     r21, 'S'        ;Is type ROM string?\r
-       breq    60f             ;/\r
-       _MOVW   r23,r22,r25,r24 ;r25:r22 = value\r
-       clr     r24             ;\r
-       clr     r25             ;\r
-       clt                     ;/\r
-       cpi     r21, 'l'        ;Is long int?\r
-       brne    26f             ;\r
-       ld      r24, Y+         ;get value (high word)\r
-       ld      r25, Y+         ;\r
-       set                     ;\r
-       _LPMI   r21             ;/\r
-26:    cpi     r21, 'd'        ;Is type signed decimal?\r
-       brne    27f             ;/\r
-       ldi     r20, -10        ;\r
-       brts    40f             ;\r
-       sbrs    r23, 7          ;\r
-       rjmp    40f             ;\r
-       ldi     r24, -1         ;\r
-       ldi     r25, -1         ;\r
-       rjmp    40f             ;/\r
-27:    cpi     r21, 'u'        ;Is type unsigned decimal?\r
-       ldi     r20, 10         ;\r
-       breq    40f             ;/\r
-       cpi     r21, 'X'        ;Is type hexdecimal?\r
-       ldi     r20, 16         ;\r
-       breq    40f             ;/\r
-       cpi     r21, 'b'        ;Is type binary?\r
-       ldi     r20, 2          ;\r
-       breq    40f             ;/\r
-       ret                     ;abort\r
-40:    push    ZH              ;Output the value\r
-       push    ZL              ;\r
-       rcall   xitoa           ;\r
-42:    pop     ZL              ;\r
-       pop     ZH              ;\r
-       rjmp    0b              ;/\r
-\r
-50:    push    ZH              ;Put a string on the RAM\r
-       push    ZL\r
-       _MOVW   ZH,ZL, r25,r24\r
-51:    ld      r24, Z+\r
-       cpi     r24, 0\r
-       breq    42b\r
-       rcall   xputc\r
-       rjmp    51b\r
-\r
-60:    push    ZH              ;Put a string on the ROM\r
-       push    ZL\r
-       rcall   xputs\r
-       rjmp    42b\r
-.endfunc\r
-\r
-\r
-.func __xprintf\r
-.global __xprintf\r
-__xprintf:\r
-       push    YH\r
-       push    YL\r
-       in      YL, _SFR_IO_ADDR(SPL)\r
-#ifdef SPH\r
-       in      YH, _SFR_IO_ADDR(SPH)\r
-#else\r
-       clr     YH\r
-#endif\r
-       adiw    YL, 5           ;Y = pointer to arguments\r
-       rcall   xvprintf\r
-       pop     YL\r
-       pop     YH\r
-       ret\r
-.endfunc\r
-\r
-\r
-#if USE_XSPRINTF\r
-\r
-.func __xsprintf\r
-putram:\r
-       _MOVW   ZH,ZL, r15,r14\r
-       st      Z+, r24\r
-       _MOVW   r15,r14, ZH,ZL\r
-       ret\r
-.global __xsprintf\r
-__xsprintf:\r
-       push    YH\r
-       push    YL\r
-       in      YL, _SFR_IO_ADDR(SPL)\r
-#ifdef SPH\r
-       in      YH, _SFR_IO_ADDR(SPH)\r
-#else\r
-       clr     YH\r
-#endif\r
-       adiw    YL, 5           ;Y = pointer to arguments\r
-       lds     ZL, xfunc_out+0 ;Save registered output function\r
-       lds     ZH, xfunc_out+1 ;\r
-       push    ZL              ;\r
-       push    ZH              ;/\r
-       ldi     ZL, lo8(pm(putram));Set local output function\r
-       ldi     ZH, hi8(pm(putram));\r
-       sts     xfunc_out+0, ZL ;\r
-       sts     xfunc_out+1, ZH ;/\r
-       push    r15             ;Initialize pointer to string buffer\r
-       push    r14             ;\r
-       ld      r14, Y+         ;\r
-       ld      r15, Y+         ;/\r
-       rcall   xvprintf\r
-       _MOVW   ZH,ZL, r15,r14  ;Terminate string\r
-       st      Z, r1           ;\r
-       pop     r14             ;\r
-       pop     r15             ;/\r
-       pop     ZH              ;Restore registered output function\r
-       pop     ZL              ;\r
-       sts     xfunc_out+0, ZL ;\r
-       sts     xfunc_out+1, ZH ;/\r
-       pop     YL\r
-       pop     YH\r
-       ret\r
-.endfunc\r
-#endif\r
-\r
-\r
-#if USE_XFPRINTF\r
-.func __xfprintf\r
-.global __xfprintf\r
-__xfprintf:\r
-       push    YH\r
-       push    YL\r
-       in      YL, _SFR_IO_ADDR(SPL)\r
-#ifdef SPH\r
-       in      YH, _SFR_IO_ADDR(SPH)\r
-#else\r
-       clr     YH\r
-#endif\r
-       adiw    YL, 5           ;Y = pointer to arguments\r
-       lds     ZL, xfunc_out+0 ;Save registered output function\r
-       lds     ZH, xfunc_out+1 ;\r
-       push    ZL              ;\r
-       push    ZH              ;/\r
-       ld      ZL, Y+          ;Set output function\r
-       ld      ZH, Y+          ;\r
-       sts     xfunc_out+0, ZL ;\r
-       sts     xfunc_out+1, ZH ;/\r
-       rcall   xvprintf\r
-       pop     ZH              ;Restore registered output function\r
-       pop     ZL              ;\r
-       sts     xfunc_out+0, ZL ;\r
-       sts     xfunc_out+1, ZH ;/\r
-       pop     YL\r
-       pop     YH\r
-       ret\r
-.endfunc\r
-#endif\r
-\r
-#endif\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------\r
-; Extended numeral string input\r
-;\r
-;Prototype:\r
-; char xatoi (           /* 1: Successful, 0: Failed */\r
-;      const char **str, /* pointer to pointer to source string */\r
-;      long *res         /* result */\r
-; );\r
-;\r
-\r
-\r
-#if USE_XATOI\r
-.func xatoi\r
-.global xatoi\r
-xatoi:\r
-       _MOVW   r1, r0, r23, r22\r
-       _MOVW   XH, XL, r25, r24\r
-       ld      ZL, X+\r
-       ld      ZH, X+\r
-       clr     r18             ;r21:r18 = 0;\r
-       clr     r19             ;\r
-       clr     r20             ;\r
-       clr     r21             ;/\r
-       clt                     ;T = 0;\r
-\r
-       ldi     r25, 10         ;r25 = 10;\r
-       rjmp    41f             ;/\r
-40:    adiw    ZL, 1           ;Z++;\r
-41:    ld      r22, Z          ;r22 = *Z;\r
-       cpi     r22, ' '        ;if(r22 == ' ') continue\r
-       breq    40b             ;/\r
-       brcs    70f             ;if(r22 < ' ') error;\r
-       cpi     r22, '-'        ;if(r22 == '-') {\r
-       brne    42f             ; T = 1;\r
-       set                     ; continue;\r
-       rjmp    40b             ;}\r
-42:    cpi     r22, '9'+1      ;if(r22 > '9') error;\r
-       brcc    70f             ;/\r
-       cpi     r22, '0'        ;if(r22 < '0') error;\r
-       brcs    70f             ;/\r
-       brne    51f             ;if(r22 > '0') cv_start;\r
-       ldi     r25, 8          ;r25 = 8;\r
-       adiw    ZL, 1           ;r22 = *(++Z);\r
-       ld      r22, Z          ;/\r
-       cpi     r22, ' '+1      ;if(r22 <= ' ') exit;\r
-       brcs    80f             ;/\r
-       cpi     r22, 'b'        ;if(r22 == 'b') {\r
-       brne    43f             ; r25 = 2;\r
-       ldi     r25, 2          ; cv_start;\r
-       rjmp    50f             ;}\r
-43:    cpi     r22, 'x'        ;if(r22 != 'x') error;\r
-       brne    51f             ;/\r
-       ldi     r25, 16         ;r25 = 16;\r
-\r
-50:    adiw    ZL, 1           ;Z++;\r
-       ld      r22, Z          ;r22 = *Z;\r
-51:    cpi     r22, ' '+1      ;if(r22 <= ' ') break;\r
-       brcs    80f             ;/\r
-       cpi     r22, 'a'        ;if(r22 >= 'a') r22 =- 0x20;\r
-       brcs    52f             ;\r
-       subi    r22, 0x20       ;/\r
-52:    subi    r22, '0'        ;if((r22 -= '0') < 0) error;\r
-       brcs    70f             ;/\r
-       cpi     r22, 10         ;if(r22 >= 10) {\r
-       brcs    53f             ; r22 -= 7;\r
-       subi    r22, 7          ; if(r22 < 10) \r
-       cpi     r22, 10         ;\r
-       brcs    70f             ;}\r
-53:    cp      r22, r25        ;if(r22 >= r25) error;\r
-       brcc    70f             ;/\r
-60:    ldi     r24, 33         ;r21:r18 *= r25;\r
-       sub     r23, r23        ;\r
-61:    brcc    62f             ;\r
-       add     r23, r25        ;\r
-62:    lsr     r23             ;\r
-       ror     r21             ;\r
-       ror     r20             ;\r
-       ror     r19             ;\r
-       ror     r18             ;\r
-       dec     r24             ;\r
-       brne    61b             ;/\r
-       add     r18, r22        ;r21:r18 += r22;\r
-       adc     r19, r24        ;\r
-       adc     r20, r24        ;\r
-       adc     r21, r24        ;/\r
-       rjmp    50b             ;repeat\r
-\r
-70:    ldi     r24, 0\r
-       rjmp    81f\r
-80:    ldi     r24, 1\r
-81:    brtc    82f\r
-       clr     r22\r
-       com     r18\r
-       com     r19\r
-       com     r20\r
-       com     r21\r
-       adc     r18, r22\r
-       adc     r19, r22\r
-       adc     r20, r22\r
-       adc     r21, r22\r
-82:    st      -X, ZH\r
-       st      -X, ZL\r
-       _MOVW   XH, XL, r1, r0\r
-       st      X+, r18\r
-       st      X+, r19\r
-       st      X+, r20\r
-       st      X+, r21\r
-       clr     r1\r
-       ret\r
-.endfunc\r
-#endif\r
-\r
-\r
+;---------------------------------------------------------------------------;
+; Extended itoa, puts, printf and atoi                     (C)ChaN, 2011
+;---------------------------------------------------------------------------;
+
+                               // Base size is 152 bytes
+#define        CR_CRLF         0       // Convert \n to \r\n (+10 bytes)
+#define USE_XPRINTF    1       // Enable xprintf function (+194 bytes)
+#define USE_XSPRINTF   0       // Add xsprintf function (+78 bytes)
+#define USE_XFPRINTF   0       // Add xfprintf function (+54 bytes)
+#define USE_XATOI      0       // Enable xatoi function (+182 bytes)
+
+
+#if FLASHEND > 0x1FFFF
+#error xitoa module does not support 256K devices
+#endif
+
+.nolist
+#include <avr/io.h>    // Include device specific definitions.
+.list
+
+#ifdef SPM_PAGESIZE    // Recent devices have "lpm Rd,Z+" and "movw".
+.macro _LPMI   reg
+       lpm     \reg, Z+
+.endm
+.macro _MOVW   dh,dl, sh,sl
+       movw    \dl, \sl
+.endm
+#else                  // Earlier devices do not have "lpm Rd,Z+" nor "movw".
+.macro _LPMI   reg
+       lpm
+       mov     \reg, r0
+       adiw    ZL, 1
+.endm
+.macro _MOVW   dh,dl, sh,sl
+       mov     \dl, \sl
+       mov     \dh, \sh
+.endm
+#endif
+
+
+
+;---------------------------------------------------------------------------
+; Stub function to forward to user output function
+;
+;Prototype: void xputc (char chr       // a character to be output
+;                      );
+;Size: 12/12 words
+
+.section .bss
+.global xfunc_out      ; xfunc_out must be initialized before using this module.
+xfunc_out:     .ds.w   1
+.section .text
+
+
+.func xputc
+.global xputc
+xputc:
+#if CR_CRLF
+       cpi     r24, 10         ;LF --> CRLF
+       brne    1f              ;
+       ldi     r24, 13         ;
+       rcall   1f              ;
+       ldi     r24, 10         ;/
+1:
+#endif
+       push    ZH
+       push    ZL
+       lds     ZL, xfunc_out+0 ;Pointer to the registered output function.
+       lds     ZH, xfunc_out+1 ;/
+       sbiw    ZL, 0           ;Skip if null
+       breq    2f              ;/
+       icall
+2:     pop     ZL
+       pop     ZH
+       ret
+.endfunc
+
+
+
+;---------------------------------------------------------------------------
+; Direct ROM string output
+;
+;Prototype: void xputs (const char *str_p // rom string to be output
+;                      );
+
+.func xputs
+.global xputs
+xputs:
+       _MOVW   ZH,ZL, r25,r24  ; Z = pointer to rom string
+1:     _LPMI   r24
+       cpi     r24, 0
+       breq    2f
+       rcall   xputc
+       rjmp    1b
+2:     ret
+.endfunc
+
+
+;---------------------------------------------------------------------------
+; Extended direct numeral string output (32bit version)
+;
+;Prototype: void xitoa (long value,    // value to be output
+;                       char radix,    // radix
+;                       char width);   // minimum width
+;
+
+.func xitoa
+.global xitoa
+xitoa:
+                               ;r25:r22 = value, r20 = base, r18 = digits
+       clr     r31             ;r31 = stack level
+       ldi     r30, ' '        ;r30 = sign
+       ldi     r19, ' '        ;r19 = filler
+       sbrs    r20, 7          ;When base indicates signd format and the value
+       rjmp    0f              ;is minus, add a '-'.
+       neg     r20             ;
+       sbrs    r25, 7          ;
+       rjmp    0f              ;
+       ldi     r30, '-'        ;
+       com     r22             ;
+       com     r23             ;
+       com     r24             ;
+       com     r25             ;
+       adc     r22, r1         ;
+       adc     r23, r1         ;
+       adc     r24, r1         ;
+       adc     r25, r1         ;/
+0:     sbrs    r18, 7          ;When digits indicates zero filled,
+       rjmp    1f              ;filler is '0'.
+       neg     r18             ;
+       ldi     r19, '0'        ;/
+                               ;----- string conversion loop
+1:     ldi     r21, 32         ;r26 = r25:r22 % r20
+       clr     r26             ;r25:r22 /= r20
+2:     lsl     r22             ;
+       rol     r23             ;
+       rol     r24             ;
+       rol     r25             ;
+       rol     r26             ;
+       cp      r26, r20        ;
+       brcs    3f              ;
+       sub     r26, r20        ;
+       inc     r22             ;
+3:     dec     r21             ;
+       brne    2b              ;/
+       cpi     r26, 10         ;r26 is a numeral digit '0'-'F'
+       brcs    4f              ;
+       subi    r26, -7         ;
+4:     subi    r26, -'0'       ;/
+       push    r26             ;Stack it
+       inc     r31             ;/
+       cp      r22, r1         ;Repeat until r25:r22 gets zero
+       cpc     r23, r1         ;
+       cpc     r24, r1         ;
+       cpc     r25, r1         ;
+       brne    1b              ;/
+
+       cpi     r30, '-'        ;Minus sign if needed
+       brne    5f              ;
+       push    r30             ;
+       inc     r31             ;/
+5:     cp      r31, r18        ;Filler
+       brcc    6f              ;
+       push    r19             ;
+       inc     r31             ;
+       rjmp    5b              ;/
+
+6:     pop     r24             ;Flush stacked digits and exit
+       rcall   xputc           ;
+       dec     r31             ;
+       brne    6b              ;/
+
+       ret
+.endfunc
+
+
+
+;---------------------------------------------------------------------------;
+; Formatted string output (16/32bit version)
+;
+;Prototype:
+; void __xprintf (const char *format_p, ...);
+; void __xsprintf(char*, const char *format_p, ...);
+; void __xfprintf(void(*func)(char), const char *format_p, ...);
+;
+
+#if USE_XPRINTF
+
+.func xvprintf
+xvprintf:
+       ld      ZL, Y+          ;Z = pointer to format string
+       ld      ZH, Y+          ;/
+
+0:     _LPMI   r24             ;Get a format char
+       cpi     r24, 0          ;End of format string?
+       breq    90f             ;/
+       cpi     r24, '%'        ;Is format?
+       breq    20f             ;/
+1:     rcall   xputc           ;Put a normal character
+       rjmp    0b              ;/
+90:    ret
+
+20:    ldi     r18, 0          ;r18: digits
+       clt                     ;T: filler
+       _LPMI   r21             ;Get flags
+       cpi     r21, '%'        ;Is a %?
+       breq    1b              ;/
+       cpi     r21, '0'        ;Zero filled?
+       brne    23f             ;
+       set                     ;/
+22:    _LPMI   r21             ;Get width
+23:    cpi     r21, '9'+1      ;
+       brcc    24f             ;
+       subi    r21, '0'        ;
+       brcs    90b             ;
+       lsl     r18             ;
+       mov     r0, r18         ;
+       lsl     r18             ;
+       lsl     r18             ;
+       add     r18, r0         ;
+       add     r18, r21        ;
+       rjmp    22b             ;/
+
+24:    brtc    25f             ;get value (low word)
+       neg     r18             ;
+25:    ld      r24, Y+         ;
+       ld      r25, Y+         ;/
+       cpi     r21, 'c'        ;Is type character?
+       breq    1b              ;/
+       cpi     r21, 's'        ;Is type RAM string?
+       breq    50f             ;/
+       cpi     r21, 'S'        ;Is type ROM string?
+       breq    60f             ;/
+       _MOVW   r23,r22,r25,r24 ;r25:r22 = value
+       clr     r24             ;
+       clr     r25             ;
+       clt                     ;/
+       cpi     r21, 'l'        ;Is long int?
+       brne    26f             ;
+       ld      r24, Y+         ;get value (high word)
+       ld      r25, Y+         ;
+       set                     ;
+       _LPMI   r21             ;/
+26:    cpi     r21, 'd'        ;Is type signed decimal?
+       brne    27f             ;/
+       ldi     r20, -10        ;
+       brts    40f             ;
+       sbrs    r23, 7          ;
+       rjmp    40f             ;
+       ldi     r24, -1         ;
+       ldi     r25, -1         ;
+       rjmp    40f             ;/
+27:    cpi     r21, 'u'        ;Is type unsigned decimal?
+       ldi     r20, 10         ;
+       breq    40f             ;/
+       cpi     r21, 'X'        ;Is type hexdecimal?
+       ldi     r20, 16         ;
+       breq    40f             ;/
+       cpi     r21, 'b'        ;Is type binary?
+       ldi     r20, 2          ;
+       breq    40f             ;/
+       ret                     ;abort
+40:    push    ZH              ;Output the value
+       push    ZL              ;
+       rcall   xitoa           ;
+42:    pop     ZL              ;
+       pop     ZH              ;
+       rjmp    0b              ;/
+
+50:    push    ZH              ;Put a string on the RAM
+       push    ZL
+       _MOVW   ZH,ZL, r25,r24
+51:    ld      r24, Z+
+       cpi     r24, 0
+       breq    42b
+       rcall   xputc
+       rjmp    51b
+
+60:    push    ZH              ;Put a string on the ROM
+       push    ZL
+       rcall   xputs
+       rjmp    42b
+.endfunc
+
+
+.func __xprintf
+.global __xprintf
+__xprintf:
+       push    YH
+       push    YL
+       in      YL, _SFR_IO_ADDR(SPL)
+#ifdef SPH
+       in      YH, _SFR_IO_ADDR(SPH)
+#else
+       clr     YH
+#endif
+       adiw    YL, 5           ;Y = pointer to arguments
+       rcall   xvprintf
+       pop     YL
+       pop     YH
+       ret
+.endfunc
+
+
+#if USE_XSPRINTF
+
+.func __xsprintf
+putram:
+       _MOVW   ZH,ZL, r15,r14
+       st      Z+, r24
+       _MOVW   r15,r14, ZH,ZL
+       ret
+.global __xsprintf
+__xsprintf:
+       push    YH
+       push    YL
+       in      YL, _SFR_IO_ADDR(SPL)
+#ifdef SPH
+       in      YH, _SFR_IO_ADDR(SPH)
+#else
+       clr     YH
+#endif
+       adiw    YL, 5           ;Y = pointer to arguments
+       lds     ZL, xfunc_out+0 ;Save registered output function
+       lds     ZH, xfunc_out+1 ;
+       push    ZL              ;
+       push    ZH              ;/
+       ldi     ZL, lo8(pm(putram));Set local output function
+       ldi     ZH, hi8(pm(putram));
+       sts     xfunc_out+0, ZL ;
+       sts     xfunc_out+1, ZH ;/
+       push    r15             ;Initialize pointer to string buffer
+       push    r14             ;
+       ld      r14, Y+         ;
+       ld      r15, Y+         ;/
+       rcall   xvprintf
+       _MOVW   ZH,ZL, r15,r14  ;Terminate string
+       st      Z, r1           ;
+       pop     r14             ;
+       pop     r15             ;/
+       pop     ZH              ;Restore registered output function
+       pop     ZL              ;
+       sts     xfunc_out+0, ZL ;
+       sts     xfunc_out+1, ZH ;/
+       pop     YL
+       pop     YH
+       ret
+.endfunc
+#endif
+
+
+#if USE_XFPRINTF
+.func __xfprintf
+.global __xfprintf
+__xfprintf:
+       push    YH
+       push    YL
+       in      YL, _SFR_IO_ADDR(SPL)
+#ifdef SPH
+       in      YH, _SFR_IO_ADDR(SPH)
+#else
+       clr     YH
+#endif
+       adiw    YL, 5           ;Y = pointer to arguments
+       lds     ZL, xfunc_out+0 ;Save registered output function
+       lds     ZH, xfunc_out+1 ;
+       push    ZL              ;
+       push    ZH              ;/
+       ld      ZL, Y+          ;Set output function
+       ld      ZH, Y+          ;
+       sts     xfunc_out+0, ZL ;
+       sts     xfunc_out+1, ZH ;/
+       rcall   xvprintf
+       pop     ZH              ;Restore registered output function
+       pop     ZL              ;
+       sts     xfunc_out+0, ZL ;
+       sts     xfunc_out+1, ZH ;/
+       pop     YL
+       pop     YH
+       ret
+.endfunc
+#endif
+
+#endif
+
+
+
+;---------------------------------------------------------------------------
+; Extended numeral string input
+;
+;Prototype:
+; char xatoi (           /* 1: Successful, 0: Failed */
+;      const char **str, /* pointer to pointer to source string */
+;      long *res         /* result */
+; );
+;
+
+
+#if USE_XATOI
+.func xatoi
+.global xatoi
+xatoi:
+       _MOVW   r1, r0, r23, r22
+       _MOVW   XH, XL, r25, r24
+       ld      ZL, X+
+       ld      ZH, X+
+       clr     r18             ;r21:r18 = 0;
+       clr     r19             ;
+       clr     r20             ;
+       clr     r21             ;/
+       clt                     ;T = 0;
+
+       ldi     r25, 10         ;r25 = 10;
+       rjmp    41f             ;/
+40:    adiw    ZL, 1           ;Z++;
+41:    ld      r22, Z          ;r22 = *Z;
+       cpi     r22, ' '        ;if(r22 == ' ') continue
+       breq    40b             ;/
+       brcs    70f             ;if(r22 < ' ') error;
+       cpi     r22, '-'        ;if(r22 == '-') {
+       brne    42f             ; T = 1;
+       set                     ; continue;
+       rjmp    40b             ;}
+42:    cpi     r22, '9'+1      ;if(r22 > '9') error;
+       brcc    70f             ;/
+       cpi     r22, '0'        ;if(r22 < '0') error;
+       brcs    70f             ;/
+       brne    51f             ;if(r22 > '0') cv_start;
+       ldi     r25, 8          ;r25 = 8;
+       adiw    ZL, 1           ;r22 = *(++Z);
+       ld      r22, Z          ;/
+       cpi     r22, ' '+1      ;if(r22 <= ' ') exit;
+       brcs    80f             ;/
+       cpi     r22, 'b'        ;if(r22 == 'b') {
+       brne    43f             ; r25 = 2;
+       ldi     r25, 2          ; cv_start;
+       rjmp    50f             ;}
+43:    cpi     r22, 'x'        ;if(r22 != 'x') error;
+       brne    51f             ;/
+       ldi     r25, 16         ;r25 = 16;
+
+50:    adiw    ZL, 1           ;Z++;
+       ld      r22, Z          ;r22 = *Z;
+51:    cpi     r22, ' '+1      ;if(r22 <= ' ') break;
+       brcs    80f             ;/
+       cpi     r22, 'a'        ;if(r22 >= 'a') r22 =- 0x20;
+       brcs    52f             ;
+       subi    r22, 0x20       ;/
+52:    subi    r22, '0'        ;if((r22 -= '0') < 0) error;
+       brcs    70f             ;/
+       cpi     r22, 10         ;if(r22 >= 10) {
+       brcs    53f             ; r22 -= 7;
+       subi    r22, 7          ; if(r22 < 10) 
+       cpi     r22, 10         ;
+       brcs    70f             ;}
+53:    cp      r22, r25        ;if(r22 >= r25) error;
+       brcc    70f             ;/
+60:    ldi     r24, 33         ;r21:r18 *= r25;
+       sub     r23, r23        ;
+61:    brcc    62f             ;
+       add     r23, r25        ;
+62:    lsr     r23             ;
+       ror     r21             ;
+       ror     r20             ;
+       ror     r19             ;
+       ror     r18             ;
+       dec     r24             ;
+       brne    61b             ;/
+       add     r18, r22        ;r21:r18 += r22;
+       adc     r19, r24        ;
+       adc     r20, r24        ;
+       adc     r21, r24        ;/
+       rjmp    50b             ;repeat
+
+70:    ldi     r24, 0
+       rjmp    81f
+80:    ldi     r24, 1
+81:    brtc    82f
+       clr     r22
+       com     r18
+       com     r19
+       com     r20
+       com     r21
+       adc     r18, r22
+       adc     r19, r22
+       adc     r20, r22
+       adc     r21, r22
+82:    st      -X, ZH
+       st      -X, ZL
+       _MOVW   XH, XL, r1, r0
+       st      X+, r18
+       st      X+, r19
+       st      X+, r20
+       st      X+, r21
+       clr     r1
+       ret
+.endfunc
+#endif
+
+
index 59c6f253123957e4aa7527c0bdc5b47d392563ef..e53c0dd8e0df1ba0823ca761601ae63f34d88b64 100644 (file)
-/*---------------------------------------------------------------------------\r
-   Extended itoa, puts and printf                    (C)ChaN, 2011\r
------------------------------------------------------------------------------*/\r
-\r
-#ifndef XPRINTF_H\r
-#define XPRINTF_H\r
-\r
-#include <inttypes.h>\r
-#include <avr/pgmspace.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-extern void (*xfunc_out)(uint8_t);\r
-#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)\r
-\r
-/* This is a pointer to user defined output function. It must be initialized\r
-   before using this modle.\r
-*/\r
-\r
-void xputc(char chr);\r
-\r
-/* This is a stub function to forward outputs to user defined output function.\r
-   All outputs from this module are output via this function.\r
-*/\r
-\r
-\r
-/*-----------------------------------------------------------------------------*/\r
-void xputs(const char *string_p);\r
-\r
-/*  The string placed in the ROM is forwarded to xputc() directly.\r
-*/\r
-\r
-\r
-/*-----------------------------------------------------------------------------*/\r
-void xitoa(long value, char radix, char width);\r
-\r
-/* Extended itoa().\r
-\r
-      value  radix  width   output\r
-        100     10      6   "   100"\r
-        100     10     -6   "000100"\r
-        100     10      0   "100"\r
- 4294967295     10      0   "4294967295"\r
- 4294967295    -10      0   "-1"\r
-     655360     16     -8   "000A0000"\r
-       1024     16      0   "400"\r
-       0x55      2     -8   "01010101"\r
-*/\r
-\r
-\r
-/*-----------------------------------------------------------------------------*/\r
-#define xprintf(format, ...)            __xprintf(PSTR(format), ##__VA_ARGS__)\r
-#define xsprintf(str, format, ...)      __xsprintf(str, PSTR(format), ##__VA_ARGS__)\r
-#define xfprintf(func, format, ...)     __xfprintf(func, PSTR(format), ##__VA_ARGS__)\r
-\r
-void __xprintf(const char *format_p, ...);     /* Send formatted string to the registered device */\r
-void __xsprintf(char*, const char *format_p, ...);     /* Put formatted string to the memory */\r
-void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */\r
-\r
-/* Format string is placed in the ROM. The format flags is similar to printf().\r
-\r
-   %[flag][width][size]type\r
-\r
-   flag\r
-     A '0' means filled with '0' when output is shorter than width.\r
-     ' ' is used in default. This is effective only numeral type.\r
-   width\r
-     Minimum width in decimal number. This is effective only numeral type.\r
-     Default width is zero.\r
-   size\r
-     A 'l' means the argument is long(32bit). Default is short(16bit).\r
-     This is effective only numeral type.\r
-   type\r
-     'c' : Character, argument is the value\r
-     's' : String placed on the RAM, argument is the pointer\r
-     'S' : String placed on the ROM, argument is the pointer\r
-     'd' : Signed decimal, argument is the value\r
-     'u' : Unsigned decimal, argument is the value\r
-     'X' : Hexdecimal, argument is the value\r
-     'b' : Binary, argument is the value\r
-     '%' : '%'\r
-\r
-*/\r
-\r
-\r
-/*-----------------------------------------------------------------------------*/\r
-char xatoi(char **str, long *ret);\r
-\r
-/* Get value of the numeral string. \r
-\r
-  str\r
-    Pointer to pointer to source string\r
-\r
-    "0b11001010" binary\r
-    "0377" octal\r
-    "0xff800" hexdecimal\r
-    "1250000" decimal\r
-    "-25000" decimal\r
-\r
-  ret\r
-    Pointer to return value\r
-*/\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
+/*---------------------------------------------------------------------------
+   Extended itoa, puts and printf                    (C)ChaN, 2011
+-----------------------------------------------------------------------------*/
+
+#ifndef XPRINTF_H
+#define XPRINTF_H
+
+#include <inttypes.h>
+#include <avr/pgmspace.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void (*xfunc_out)(uint8_t);
+#define xdev_out(func) xfunc_out = (void(*)(uint8_t))(func)
+
+/* This is a pointer to user defined output function. It must be initialized
+   before using this modle.
+*/
+
+void xputc(char chr);
+
+/* This is a stub function to forward outputs to user defined output function.
+   All outputs from this module are output via this function.
+*/
+
+
+/*-----------------------------------------------------------------------------*/
+void xputs(const char *string_p);
+
+/*  The string placed in the ROM is forwarded to xputc() directly.
+*/
+
+
+/*-----------------------------------------------------------------------------*/
+void xitoa(long value, char radix, char width);
+
+/* Extended itoa().
+
+      value  radix  width   output
+        100     10      6   "   100"
+        100     10     -6   "000100"
+        100     10      0   "100"
+ 4294967295     10      0   "4294967295"
+ 4294967295    -10      0   "-1"
+     655360     16     -8   "000A0000"
+       1024     16      0   "400"
+       0x55      2     -8   "01010101"
+*/
+
+
+/*-----------------------------------------------------------------------------*/
+#define xprintf(format, ...)            __xprintf(PSTR(format), ##__VA_ARGS__)
+#define xsprintf(str, format, ...)      __xsprintf(str, PSTR(format), ##__VA_ARGS__)
+#define xfprintf(func, format, ...)     __xfprintf(func, PSTR(format), ##__VA_ARGS__)
+
+void __xprintf(const char *format_p, ...);     /* Send formatted string to the registered device */
+void __xsprintf(char*, const char *format_p, ...);     /* Put formatted string to the memory */
+void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */
+
+/* Format string is placed in the ROM. The format flags is similar to printf().
+
+   %[flag][width][size]type
+
+   flag
+     A '0' means filled with '0' when output is shorter than width.
+     ' ' is used in default. This is effective only numeral type.
+   width
+     Minimum width in decimal number. This is effective only numeral type.
+     Default width is zero.
+   size
+     A 'l' means the argument is long(32bit). Default is short(16bit).
+     This is effective only numeral type.
+   type
+     'c' : Character, argument is the value
+     's' : String placed on the RAM, argument is the pointer
+     'S' : String placed on the ROM, argument is the pointer
+     'd' : Signed decimal, argument is the value
+     'u' : Unsigned decimal, argument is the value
+     'X' : Hexdecimal, argument is the value
+     'b' : Binary, argument is the value
+     '%' : '%'
+
+*/
+
+
+/*-----------------------------------------------------------------------------*/
+char xatoi(char **str, long *ret);
+
+/* Get value of the numeral string. 
+
+  str
+    Pointer to pointer to source string
+
+    "0b11001010" binary
+    "0377" octal
+    "0xff800" hexdecimal
+    "1250000" decimal
+    "-25000" decimal
+
+  ret
+    Pointer to return value
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
index 1b029096384df159b37019b2eeb0e40b237f7eb0..a873515e1041a6130a1ea9717b0b2e8830bf98e1 100644 (file)
-;---------------------------------------------------------------------------;\r
-; Software implemented UART module                                          ;\r
-; (C)ChaN, 2005 (http://elm-chan.org/)                                      ;\r
-;---------------------------------------------------------------------------;\r
-; Bit rate settings:\r
-;\r
-;            1MHz  2MHz  4MHz  6MHz  8MHz  10MHz  12MHz  16MHz  20MHz\r
-;   2.4kbps   138     -     -     -     -      -      -      -      -\r
-;   4.8kbps    68   138     -     -     -      -      -      -      -\r
-;   9.6kbps    33    68   138   208     -      -      -      -      -\r
-;  19.2kbps     -    33    68   102   138    173    208      -      -\r
-;  38.4kbps     -     -    33    50    68     85    102    138    172\r
-;  57.6kbps     -     -    21    33    44     56     68     91    114\r
-; 115.2kbps     -     -     -     -    21     27     33     44     56\r
-\r
-.nolist\r
-#include <avr/io.h>\r
-.list\r
-\r
-#define        BPS     102     /* Bit delay. (see above table) */\r
-#define        BIDIR   0       /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */\r
-\r
-#define        OUT_1           sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */\r
-#define        OUT_0           cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */\r
-#define        SKIP_IN_1       sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT   /* Skip if 1 */\r
-#define        SKIP_IN_0       sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT   /* Skip if 0 */\r
-\r
-\r
-\r
-#ifdef SPM_PAGESIZE\r
-.macro _LPMI   reg\r
-       lpm     \reg, Z+\r
-.endm\r
-.macro _MOVW   dh,dl, sh,sl\r
-       movw    \dl, \sl\r
-.endm\r
-#else\r
-.macro _LPMI   reg\r
-       lpm\r
-       mov     \reg, r0\r
-       adiw    ZL, 1\r
-.endm\r
-.macro _MOVW   dh,dl, sh,sl\r
-       mov     \dl, \sl\r
-       mov     \dh, \sh\r
-.endm\r
-#endif\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------;\r
-; Transmit a byte in serial format of N81\r
-;\r
-;Prototype: void xmit (uint8_t data);\r
-;Size: 16 words\r
-\r
-.global xmit\r
-.func xmit\r
-xmit:\r
-#if BIDIR\r
-       ldi     r23, BPS-1      ;Pre-idle time for bidirectional data line\r
-5:     dec     r23             ;\r
-       brne    5b              ;/\r
-#endif\r
-       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags\r
-\r
-       com     r24             ;C = start bit\r
-       ldi     r25, 10         ;Bit counter\r
-       cli                     ;Start critical section\r
-\r
-1:     ldi     r23, BPS-1      ;----- Bit transferring loop \r
-2:     dec     r23             ;Wait for a bit time\r
-       brne    2b              ;/\r
-       brcs    3f              ;MISO = bit to be sent\r
-       OUT_1                   ;\r
-3:     brcc    4f              ;\r
-       OUT_0                   ;/\r
-4:     lsr     r24             ;Get next bit into C\r
-       dec     r25             ;All bits sent?\r
-       brne    1b              ;  no, coutinue\r
-\r
-       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section\r
-       ret\r
-.endfunc\r
-\r
-\r
-\r
-;---------------------------------------------------------------------------;\r
-; Receive a byte\r
-;\r
-;Prototype: uint8_t rcvr (void);\r
-;Size: 19 words\r
-\r
-.global rcvr\r
-.func rcvr\r
-rcvr:\r
-       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags\r
-\r
-       ldi     r24, 0x80       ;Receiving shift reg\r
-       cli                     ;Start critical section\r
-\r
-1:     SKIP_IN_1               ;Wait for idle\r
-       rjmp    1b\r
-2:     SKIP_IN_0               ;Wait for start bit\r
-       rjmp    2b\r
-       ldi     r25, BPS/2      ;Wait for half bit time\r
-3:     dec     r25\r
-       brne    3b\r
-\r
-4:     ldi     r25, BPS        ;----- Bit receiving loop\r
-5:     dec     r25             ;Wait for a bit time\r
-       brne    5b              ;/\r
-       lsr     r24             ;Next bit\r
-       SKIP_IN_0               ;Get a data bit into r24.7\r
-       ori     r24, 0x80\r
-       brcc    4b              ;All bits received?  no, continue\r
-\r
-       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section\r
-       ret\r
-.endfunc\r
-\r
-\r
-; Not wait for start bit. This should be called after detecting start bit.\r
-.global recv\r
-.func recv\r
-recv:\r
-       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags\r
-\r
-       ldi     r24, 0x80       ;Receiving shift reg\r
-       cli                     ;Start critical section\r
-\r
-;1:    SKIP_IN_1               ;Wait for idle\r
-;      rjmp    1b\r
-;2:    SKIP_IN_0               ;Wait for start bit\r
-;      rjmp    2b\r
-       ldi     r25, BPS/2      ;Wait for half bit time\r
-3:     dec     r25\r
-       brne    3b\r
-\r
-4:     ldi     r25, BPS        ;----- Bit receiving loop\r
-5:     dec     r25             ;Wait for a bit time\r
-       brne    5b              ;/\r
-       lsr     r24             ;Next bit\r
-       SKIP_IN_0               ;Get a data bit into r24.7\r
-       ori     r24, 0x80\r
-       brcc    4b              ;All bits received?  no, continue\r
-\r
-       ldi     r25, BPS/2      ;Wait for half bit time\r
-6:     dec     r25\r
-       brne    6b\r
-7:     SKIP_IN_1               ;Wait for stop bit\r
-       rjmp    7b\r
-\r
-       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section\r
-       ret\r
-.endfunc\r
+;---------------------------------------------------------------------------;
+; Software implemented UART module                                          ;
+; (C)ChaN, 2005 (http://elm-chan.org/)                                      ;
+;---------------------------------------------------------------------------;
+; Bit rate settings:
+;
+;            1MHz  2MHz  4MHz  6MHz  8MHz  10MHz  12MHz  16MHz  20MHz
+;   2.4kbps   138     -     -     -     -      -      -      -      -
+;   4.8kbps    68   138     -     -     -      -      -      -      -
+;   9.6kbps    33    68   138   208     -      -      -      -      -
+;  19.2kbps     -    33    68   102   138    173    208      -      -
+;  38.4kbps     -     -    33    50    68     85    102    138    172
+;  57.6kbps     -     -    21    33    44     56     68     91    114
+; 115.2kbps     -     -     -     -    21     27     33     44     56
+
+.nolist
+#include <avr/io.h>
+.list
+
+#define        BPS     102     /* Bit delay. (see above table) */
+#define        BIDIR   0       /* 0:Separated Tx/Rx, 1:Shared Tx/Rx */
+
+#define        OUT_1           sbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 1 */
+#define        OUT_0           cbi _SFR_IO_ADDR(SUART_OUT_PORT), SUART_OUT_BIT /* Output 0 */
+#define        SKIP_IN_1       sbis _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT   /* Skip if 1 */
+#define        SKIP_IN_0       sbic _SFR_IO_ADDR(SUART_IN_PIN), SUART_IN_BIT   /* Skip if 0 */
+
+
+
+#ifdef SPM_PAGESIZE
+.macro _LPMI   reg
+       lpm     \reg, Z+
+.endm
+.macro _MOVW   dh,dl, sh,sl
+       movw    \dl, \sl
+.endm
+#else
+.macro _LPMI   reg
+       lpm
+       mov     \reg, r0
+       adiw    ZL, 1
+.endm
+.macro _MOVW   dh,dl, sh,sl
+       mov     \dl, \sl
+       mov     \dh, \sh
+.endm
+#endif
+
+
+
+;---------------------------------------------------------------------------;
+; Transmit a byte in serial format of N81
+;
+;Prototype: void xmit (uint8_t data);
+;Size: 16 words
+
+.global xmit
+.func xmit
+xmit:
+#if BIDIR
+       ldi     r23, BPS-1      ;Pre-idle time for bidirectional data line
+5:     dec     r23             ;
+       brne    5b              ;/
+#endif
+       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags
+
+       com     r24             ;C = start bit
+       ldi     r25, 10         ;Bit counter
+       cli                     ;Start critical section
+
+1:     ldi     r23, BPS-1      ;----- Bit transferring loop 
+2:     dec     r23             ;Wait for a bit time
+       brne    2b              ;/
+       brcs    3f              ;MISO = bit to be sent
+       OUT_1                   ;
+3:     brcc    4f              ;
+       OUT_0                   ;/
+4:     lsr     r24             ;Get next bit into C
+       dec     r25             ;All bits sent?
+       brne    1b              ;  no, coutinue
+
+       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section
+       ret
+.endfunc
+
+
+
+;---------------------------------------------------------------------------;
+; Receive a byte
+;
+;Prototype: uint8_t rcvr (void);
+;Size: 19 words
+
+.global rcvr
+.func rcvr
+rcvr:
+       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags
+
+       ldi     r24, 0x80       ;Receiving shift reg
+       cli                     ;Start critical section
+
+1:     SKIP_IN_1               ;Wait for idle
+       rjmp    1b
+2:     SKIP_IN_0               ;Wait for start bit
+       rjmp    2b
+       ldi     r25, BPS/2      ;Wait for half bit time
+3:     dec     r25
+       brne    3b
+
+4:     ldi     r25, BPS        ;----- Bit receiving loop
+5:     dec     r25             ;Wait for a bit time
+       brne    5b              ;/
+       lsr     r24             ;Next bit
+       SKIP_IN_0               ;Get a data bit into r24.7
+       ori     r24, 0x80
+       brcc    4b              ;All bits received?  no, continue
+
+       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section
+       ret
+.endfunc
+
+
+; Not wait for start bit. This should be called after detecting start bit.
+.global recv
+.func recv
+recv:
+       in      r0, _SFR_IO_ADDR(SREG)  ;Save flags
+
+       ldi     r24, 0x80       ;Receiving shift reg
+       cli                     ;Start critical section
+
+;1:    SKIP_IN_1               ;Wait for idle
+;      rjmp    1b
+;2:    SKIP_IN_0               ;Wait for start bit
+;      rjmp    2b
+       ldi     r25, BPS/2      ;Wait for half bit time
+3:     dec     r25
+       brne    3b
+
+4:     ldi     r25, BPS        ;----- Bit receiving loop
+5:     dec     r25             ;Wait for a bit time
+       brne    5b              ;/
+       lsr     r24             ;Next bit
+       SKIP_IN_0               ;Get a data bit into r24.7
+       ori     r24, 0x80
+       brcc    4b              ;All bits received?  no, continue
+
+       ldi     r25, BPS/2      ;Wait for half bit time
+6:     dec     r25
+       brne    6b
+7:     SKIP_IN_1               ;Wait for stop bit
+       rjmp    7b
+
+       out     _SFR_IO_ADDR(SREG), r0  ;End of critical section
+       ret
+.endfunc
index 72725b998f0a27a7e90163a72f257e19e724b75a..7d92be069299159b563959b0c9b676a71febd8bf 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef SUART\r
-#define SUART\r
-\r
-void xmit(uint8_t);\r
-uint8_t rcvr(void);\r
-uint8_t recv(void);\r
-\r
-#endif /* SUART */\r
+#ifndef SUART
+#define SUART
+
+void xmit(uint8_t);
+uint8_t rcvr(void);
+uint8_t recv(void);
+
+#endif /* SUART */
index 99058f0331d260b7f7409294b90bbbc735f3ef7a..12395bf69649606da53e5202877fd306a6aeb896 100644 (file)
-/* This is from http://www.mtcnet.net/~henryvm/wdt/ */\r
-#ifndef _AVR_WD_H_\r
-#define _AVR_WD_H_\r
-\r
-#include <avr/io.h>\r
-\r
-/*\r
-Copyright (c) 2009, Curt Van Maanen\r
-\r
-Permission to use, copy, modify, and/or distribute this software for any\r
-purpose with or without fee is hereby granted, provided that the above\r
-copyright notice and this permission notice appear in all copies.\r
-\r
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\r
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\r
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\r
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\r
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\r
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\r
-\r
-\r
-include usage-\r
-    #include "wd.h"             //if in same directory as project\r
-    #include <avr/wd.h>         //if wd.h is in avr directory\r
-\r
-set watchdog modes and prescale\r
-\r
-usage-\r
-    WD_SET(mode,[timeout]);     //prescale always set\r
-\r
-modes-\r
-    WD_OFF                      disabled\r
-    WD_RST                      normal reset mode\r
-    WD_IRQ                      interrupt only mode (if supported)\r
-    WD_RST_IRQ                  interrupt+reset mode (if supported)\r
-\r
-timeout-\r
-    WDTO_15MS                   default if no timeout provided\r
-    WDTO_30MS\r
-    WDTO_60MS\r
-    WDTO_120MS\r
-    WDTO_250MS\r
-    WDTO_500MS\r
-    WDTO_1S\r
-    WDTO_2S\r
-    WDTO_4S                     (if supported)\r
-    WDTO_8S                     (if supported)\r
-\r
-examples-\r
-    WD_SET(WD_RST,WDTO_1S);     //reset mode, 1s timeout\r
-    WD_SET(WD_OFF);             //watchdog disabled (if not fused on)\r
-    WD_SET(WD_RST);             //reset mode, 15ms (default timeout)\r
-    WD_SET(WD_IRQ,WDTO_120MS);  //interrupt only mode, 120ms timeout\r
-    WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout\r
-\r
-\r
-for enhanced watchdogs, if the watchdog is not being used WDRF should be\r
-cleared on every power up or reset, along with disabling the watchdog-\r
-    WD_DISABLE();               //clear WDRF, then turn off watchdog\r
-\r
-*/\r
-\r
-//reset registers to the same name (MCUCSR)\r
-#if !defined(MCUCSR)\r
-#define MCUCSR                  MCUSR\r
-#endif\r
-\r
-//watchdog registers to the same name (WDTCSR)\r
-#if !defined(WDTCSR)\r
-#define WDTCSR                  WDTCR\r
-#endif\r
-\r
-//if enhanced watchdog, define irq values, create disable macro\r
-#if defined(WDIF)\r
-#define WD_IRQ                  0xC0\r
-#define WD_RST_IRQ              0xC8\r
-#define WD_DISABLE()            do{                       \\r
-                                    MCUCSR &= ~(1<<WDRF); \\r
-                                    WD_SET(WD_OFF);       \\r
-                                }while(0)\r
-#endif\r
-\r
-//all watchdogs\r
-#define WD_RST                  8\r
-#define WD_OFF                  0\r
-\r
-//prescale values\r
-#define WDTO_15MS               0\r
-#define WDTO_30MS               1\r
-#define WDTO_60MS               2\r
-#define WDTO_120MS              3\r
-#define WDTO_250MS              4\r
-#define WDTO_500MS              5\r
-#define WDTO_1S                 6\r
-#define WDTO_2S                 7\r
-\r
-//prescale values for avrs with WDP3\r
-#if defined(WDP3)\r
-#define WDTO_4S                 0x20\r
-#define WDTO_8S                 0x21\r
-#endif\r
-\r
-//watchdog reset\r
-#define WDR()                   __asm__ __volatile__("wdr")\r
-\r
-//avr reset using watchdog\r
-#define WD_AVR_RESET()          do{                              \\r
-                                    __asm__ __volatile__("cli"); \\r
-                                    WD_SET_UNSAFE(WD_RST);       \\r
-                                    while(1);                    \\r
-                                }while(0)\r
-\r
-/*set the watchdog-\r
-1. save SREG\r
-2. turn off irq's\r
-3. reset watchdog timer\r
-4. enable watchdog change\r
-5. write watchdog value\r
-6. restore SREG (restoring irq status)\r
-*/\r
-#define WD_SET(val,...)                                 \\r
-    __asm__ __volatile__(                               \\r
-        "in __tmp_reg__,__SREG__"           "\n\t"      \\r
-        "cli"                               "\n\t"      \\r
-        "wdr"                               "\n\t"      \\r
-        "sts %[wdreg],%[wden]"              "\n\t"      \\r
-        "sts %[wdreg],%[wdval]"             "\n\t"      \\r
-        "out __SREG__,__tmp_reg__"          "\n\t"      \\r
-        :                                               \\r
-        : [wdreg] "M" (&WDTCSR),                        \\r
-          [wden]  "r" ((uint8_t)(0x18)),                \\r
-          [wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0)))  \\r
-        : "r0"                                          \\r
-)\r
-\r
-/*set the watchdog when I bit in SREG known to be clear-\r
-1. reset watchdog timer\r
-2. enable watchdog change\r
-5. write watchdog value\r
-*/\r
-#define WD_SET_UNSAFE(val,...)                          \\r
-    __asm__ __volatile__(                               \\r
-        "wdr"                               "\n\t"      \\r
-        "sts %[wdreg],%[wden]"              "\n\t"      \\r
-        "sts %[wdreg],%[wdval]"             "\n\t"      \\r
-        :                                               \\r
-        : [wdreg] "M" (&WDTCSR),                        \\r
-          [wden]  "r" ((uint8_t)(0x18)),                \\r
-          [wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0)))  \\r
-)\r
-\r
-\r
-//for compatibility with avr/wdt.h\r
-#define wdt_enable(val) WD_SET(WD_RST,val)\r
-#define wdt_disable()   WD_SET(WD_OFF)\r
-\r
-\r
-#endif /* _AVR_WD_H_ */\r
+/* This is from http://www.mtcnet.net/~henryvm/wdt/ */
+#ifndef _AVR_WD_H_
+#define _AVR_WD_H_
+
+#include <avr/io.h>
+
+/*
+Copyright (c) 2009, Curt Van Maanen
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+include usage-
+    #include "wd.h"             //if in same directory as project
+    #include <avr/wd.h>         //if wd.h is in avr directory
+
+set watchdog modes and prescale
+
+usage-
+    WD_SET(mode,[timeout]);     //prescale always set
+
+modes-
+    WD_OFF                      disabled
+    WD_RST                      normal reset mode
+    WD_IRQ                      interrupt only mode (if supported)
+    WD_RST_IRQ                  interrupt+reset mode (if supported)
+
+timeout-
+    WDTO_15MS                   default if no timeout provided
+    WDTO_30MS
+    WDTO_60MS
+    WDTO_120MS
+    WDTO_250MS
+    WDTO_500MS
+    WDTO_1S
+    WDTO_2S
+    WDTO_4S                     (if supported)
+    WDTO_8S                     (if supported)
+
+examples-
+    WD_SET(WD_RST,WDTO_1S);     //reset mode, 1s timeout
+    WD_SET(WD_OFF);             //watchdog disabled (if not fused on)
+    WD_SET(WD_RST);             //reset mode, 15ms (default timeout)
+    WD_SET(WD_IRQ,WDTO_120MS);  //interrupt only mode, 120ms timeout
+    WD_SET(WD_RST_IRQ,WDTO_2S); //interrupt+reset mode, 2S timeout
+
+
+for enhanced watchdogs, if the watchdog is not being used WDRF should be
+cleared on every power up or reset, along with disabling the watchdog-
+    WD_DISABLE();               //clear WDRF, then turn off watchdog
+
+*/
+
+//reset registers to the same name (MCUCSR)
+#if !defined(MCUCSR)
+#define MCUCSR                  MCUSR
+#endif
+
+//watchdog registers to the same name (WDTCSR)
+#if !defined(WDTCSR)
+#define WDTCSR                  WDTCR
+#endif
+
+//if enhanced watchdog, define irq values, create disable macro
+#if defined(WDIF)
+#define WD_IRQ                  0xC0
+#define WD_RST_IRQ              0xC8
+#define WD_DISABLE()            do{                       \
+                                    MCUCSR &= ~(1<<WDRF); \
+                                    WD_SET(WD_OFF);       \
+                                }while(0)
+#endif
+
+//all watchdogs
+#define WD_RST                  8
+#define WD_OFF                  0
+
+//prescale values
+#define WDTO_15MS               0
+#define WDTO_30MS               1
+#define WDTO_60MS               2
+#define WDTO_120MS              3
+#define WDTO_250MS              4
+#define WDTO_500MS              5
+#define WDTO_1S                 6
+#define WDTO_2S                 7
+
+//prescale values for avrs with WDP3
+#if defined(WDP3)
+#define WDTO_4S                 0x20
+#define WDTO_8S                 0x21
+#endif
+
+//watchdog reset
+#define WDR()                   __asm__ __volatile__("wdr")
+
+//avr reset using watchdog
+#define WD_AVR_RESET()          do{                              \
+                                    __asm__ __volatile__("cli"); \
+                                    WD_SET_UNSAFE(WD_RST);       \
+                                    while(1);                    \
+                                }while(0)
+
+/*set the watchdog-
+1. save SREG
+2. turn off irq's
+3. reset watchdog timer
+4. enable watchdog change
+5. write watchdog value
+6. restore SREG (restoring irq status)
+*/
+#define WD_SET(val,...)                                 \
+    __asm__ __volatile__(                               \
+        "in __tmp_reg__,__SREG__"           "\n\t"      \
+        "cli"                               "\n\t"      \
+        "wdr"                               "\n\t"      \
+        "sts %[wdreg],%[wden]"              "\n\t"      \
+        "sts %[wdreg],%[wdval]"             "\n\t"      \
+        "out __SREG__,__tmp_reg__"          "\n\t"      \
+        :                                               \
+        : [wdreg] "M" (&WDTCSR),                        \
+          [wden]  "r" ((uint8_t)(0x18)),                \
+          [wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0)))  \
+        : "r0"                                          \
+)
+
+/*set the watchdog when I bit in SREG known to be clear-
+1. reset watchdog timer
+2. enable watchdog change
+5. write watchdog value
+*/
+#define WD_SET_UNSAFE(val,...)                          \
+    __asm__ __volatile__(                               \
+        "wdr"                               "\n\t"      \
+        "sts %[wdreg],%[wden]"              "\n\t"      \
+        "sts %[wdreg],%[wdval]"             "\n\t"      \
+        :                                               \
+        : [wdreg] "M" (&WDTCSR),                        \
+          [wden]  "r" ((uint8_t)(0x18)),                \
+          [wdval] "r" ((uint8_t)(val|(__VA_ARGS__+0)))  \
+)
+
+
+//for compatibility with avr/wdt.h
+#define wdt_enable(val) WD_SET(WD_RST,val)
+#define wdt_disable()   WD_SET(WD_OFF)
+
+
+#endif /* _AVR_WD_H_ */
index 72f3ff04c7448e57def3eeedf88ead79f1f02376..02e7063c66cf4c1e91a99d71efe30dbd9064fae1 100644 (file)
-<asf xmlversion="1.0">\r
-       <project caption="CDC Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.128_4" force-caption="true" workspace-name="lufa_cdc_128kb_4kb_">\r
-               <require idref="lufa.bootloaders.cdc"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="CDC Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.64_4" force-caption="true" workspace-name="lufa_cdc_64kb_4kb_">\r
-               <require idref="lufa.bootloaders.cdc"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb647"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="CDC Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.32_4" force-caption="true" workspace-name="lufa_cdc_32kb_4kb_">\r
-               <require idref="lufa.bootloaders.cdc"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega32u4"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="CDC Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.16_4" force-caption="true" workspace-name="lufa_cdc_16kb_4kb_">\r
-               <require idref="lufa.bootloaders.cdc"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega16u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="CDC Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.8_4" force-caption="true" workspace-name="lufa_cdc_8kb_4kb_">\r
-               <require idref="lufa.bootloaders.cdc"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega8u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.bootloaders.cdc" caption="CDC Bootloader">\r
-               <info type="description" value="summary">\r
-               CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="Bootloaders"/>\r
-                       <keyword value="USB Device"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="include-path" value="."/>\r
-               <build type="c-source" value="BootloaderCDC.c"/>\r
-               <build type="header-file" value="BootloaderCDC.h"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-               <build type="c-source" value="BootloaderAPI.c"/>\r
-               <build type="header-file" value="BootloaderAPI.h"/>\r
-               <build type="asm-source" value="BootloaderAPITable.S"/>\r
-\r
-               <build type="module-config" subtype="path" value="Config"/>\r
-               <build type="header-file" value="Config/LUFAConfig.h"/>\r
-               <build type="header-file" value="Config/AppConfig.h"/>\r
-\r
-               <build type="distribute" subtype="user-file" value="doxyfile"/>\r
-               <build type="distribute" subtype="user-file" value="BootloaderCDC.txt"/>\r
-               <build type="distribute" subtype="user-file" value="LUFA CDC Bootloader.inf"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-               <require idref="lufa.drivers.board.leds"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="CDC Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.128_4" force-caption="true" workspace-name="lufa_cdc_128kb_4kb_">
+               <require idref="lufa.bootloaders.cdc"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="CDC Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.64_4" force-caption="true" workspace-name="lufa_cdc_64kb_4kb_">
+               <require idref="lufa.bootloaders.cdc"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb647"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="CDC Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.32_4" force-caption="true" workspace-name="lufa_cdc_32kb_4kb_">
+               <require idref="lufa.bootloaders.cdc"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega32u4"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="CDC Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.16_4" force-caption="true" workspace-name="lufa_cdc_16kb_4kb_">
+               <require idref="lufa.bootloaders.cdc"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega16u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="CDC Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.cdc.avr8.8_4" force-caption="true" workspace-name="lufa_cdc_8kb_4kb_">
+               <require idref="lufa.bootloaders.cdc"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega8u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <module type="application" id="lufa.bootloaders.cdc" caption="CDC Bootloader">
+               <info type="description" value="summary">
+               CDC Class Bootloader, capable of reprogramming a device using avrdude or other AVR109 protocol compliant software when plugged into a host.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="Bootloaders"/>
+                       <keyword value="USB Device"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="include-path" value="."/>
+               <build type="c-source" value="BootloaderCDC.c"/>
+               <build type="header-file" value="BootloaderCDC.h"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="Descriptors.h"/>
+               <build type="c-source" value="BootloaderAPI.c"/>
+               <build type="header-file" value="BootloaderAPI.h"/>
+               <build type="asm-source" value="BootloaderAPITable.S"/>
+
+               <build type="module-config" subtype="path" value="Config"/>
+               <build type="header-file" value="Config/LUFAConfig.h"/>
+               <build type="header-file" value="Config/AppConfig.h"/>
+
+               <build type="distribute" subtype="user-file" value="doxyfile"/>
+               <build type="distribute" subtype="user-file" value="BootloaderCDC.txt"/>
+               <build type="distribute" subtype="user-file" value="LUFA CDC Bootloader.inf"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+               <require idref="lufa.drivers.board.leds"/>
+       </module>
+</asf>
index 6f3312b764dc3ec2dca5c375828ab29be52a2a9d..f56aba69f5bae8bb3f0a918997bcb99387a5f245 100644 (file)
-<asf xmlversion="1.0">\r
-       <project caption="DFU Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.128_4" force-caption="true" workspace-name="lufa_dfu_128kb_4kb_">\r
-               <require idref="lufa.bootloaders.dfu"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="DFU Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.64_4" force-caption="true" workspace-name="lufa_dfu_64kb_4kb_">\r
-               <require idref="lufa.bootloaders.dfu"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb647"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="DFU Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.32_4" force-caption="true" workspace-name="lufa_dfu_32kb_4kb_">\r
-               <require idref="lufa.bootloaders.dfu"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega32u4"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="DFU Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.16_4" force-caption="true" workspace-name="lufa_dfu_16kb_4kb_">\r
-               <require idref="lufa.bootloaders.dfu"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega16u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="DFU Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.8_4" force-caption="true" workspace-name="lufa_dfu_8kb_4kb_">\r
-               <require idref="lufa.bootloaders.dfu"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega8u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.bootloaders.dfu" caption="DFU Bootloader">\r
-               <info type="description" value="summary">\r
-               DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="Bootloaders"/>\r
-                       <keyword value="USB Device"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="include-path" value="."/>\r
-               <build type="c-source" value="BootloaderDFU.c"/>\r
-               <build type="header-file" value="BootloaderDFU.h"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-               <build type="c-source" value="BootloaderAPI.c"/>\r
-               <build type="header-file" value="BootloaderAPI.h"/>\r
-               <build type="asm-source" value="BootloaderAPITable.S"/>\r
-\r
-               <build type="module-config" subtype="path" value="Config"/>\r
-               <build type="header-file" value="Config/LUFAConfig.h"/>\r
-               <build type="header-file" value="Config/AppConfig.h"/>\r
-\r
-               <build type="distribute" subtype="user-file" value="doxyfile"/>\r
-               <build type="distribute" subtype="user-file" value="BootloaderDFU.txt"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-               <require idref="lufa.drivers.board.leds"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="DFU Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.128_4" force-caption="true" workspace-name="lufa_dfu_128kb_4kb_">
+               <require idref="lufa.bootloaders.dfu"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="DFU Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.64_4" force-caption="true" workspace-name="lufa_dfu_64kb_4kb_">
+               <require idref="lufa.bootloaders.dfu"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb647"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="DFU Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.32_4" force-caption="true" workspace-name="lufa_dfu_32kb_4kb_">
+               <require idref="lufa.bootloaders.dfu"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega32u4"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="DFU Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.16_4" force-caption="true" workspace-name="lufa_dfu_16kb_4kb_">
+               <require idref="lufa.bootloaders.dfu"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega16u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="DFU Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.dfu.avr8.8_4" force-caption="true" workspace-name="lufa_dfu_8kb_4kb_">
+               <require idref="lufa.bootloaders.dfu"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega8u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <module type="application" id="lufa.bootloaders.dfu" caption="DFU Bootloader">
+               <info type="description" value="summary">
+               DFU Class Bootloader, capable of reprogramming a device using the Atmel FLIP or other AVR DFU programming software when plugged into a host.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="Bootloaders"/>
+                       <keyword value="USB Device"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="include-path" value="."/>
+               <build type="c-source" value="BootloaderDFU.c"/>
+               <build type="header-file" value="BootloaderDFU.h"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="Descriptors.h"/>
+               <build type="c-source" value="BootloaderAPI.c"/>
+               <build type="header-file" value="BootloaderAPI.h"/>
+               <build type="asm-source" value="BootloaderAPITable.S"/>
+
+               <build type="module-config" subtype="path" value="Config"/>
+               <build type="header-file" value="Config/LUFAConfig.h"/>
+               <build type="header-file" value="Config/AppConfig.h"/>
+
+               <build type="distribute" subtype="user-file" value="doxyfile"/>
+               <build type="distribute" subtype="user-file" value="BootloaderDFU.txt"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+               <require idref="lufa.drivers.board.leds"/>
+       </module>
+</asf>
index 9394b13530b1a95d233890973a1aaee1df816318..c67b9419edf8719169952510c24ce13bbb789475 100644 (file)
-<asf xmlversion="1.0">\r
-       <project caption="HID Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.128_4" force-caption="true" workspace-name="lufa_hid_128kb_4kb_">\r
-               <require idref="lufa.bootloaders.hid"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
-       </project>\r
-\r
-       <project caption="HID Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.64_4" force-caption="true" workspace-name="lufa_hid_64kb_4kb_">\r
-               <require idref="lufa.bootloaders.hid"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb647"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
-       </project>\r
-\r
-       <project caption="HID Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.32_4" force-caption="true" workspace-name="lufa_hid_32kb_4kb_">\r
-               <require idref="lufa.bootloaders.hid"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega32u4"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
-       </project>\r
-\r
-       <project caption="HID Bootloader - 16KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.16_2" force-caption="true" workspace-name="lufa_hid_16kb_2kb_">\r
-               <require idref="lufa.bootloaders.hid"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega16u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x3800"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>\r
-       </project>\r
-\r
-       <project caption="HID Bootloader - 8KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.8_2" force-caption="true" workspace-name="lufa_hid_8kb_2kb_">\r
-               <require idref="lufa.bootloaders.hid"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega8u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1800"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.bootloaders.hid" caption="HID Bootloader">\r
-               <info type="description" value="summary">\r
-               HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="Bootloaders"/>\r
-                       <keyword value="USB Device"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="include-path" value="."/>\r
-               <build type="c-source" value="BootloaderHID.c"/>\r
-               <build type="header-file" value="BootloaderHID.h"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-\r
-               <build type="module-config" subtype="path" value="Config"/>\r
-               <build type="header-file" value="Config/LUFAConfig.h"/>\r
-\r
-               <build type="distribute" subtype="user-file" value="doxyfile"/>\r
-               <build type="distribute" subtype="user-file" value="BootloaderHID.txt"/>\r
-               <build type="distribute" subtype="directory" value="HostLoaderApp"/>\r
-               <build type="distribute" subtype="directory" value="HostLoaderApp_Python"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-               <require idref="lufa.drivers.board.leds"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="HID Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.128_4" force-caption="true" workspace-name="lufa_hid_128kb_4kb_">
+               <require idref="lufa.bootloaders.hid"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
+       </project>
+
+       <project caption="HID Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.64_4" force-caption="true" workspace-name="lufa_hid_64kb_4kb_">
+               <require idref="lufa.bootloaders.hid"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb647"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
+       </project>
+
+       <project caption="HID Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.32_4" force-caption="true" workspace-name="lufa_hid_32kb_4kb_">
+               <require idref="lufa.bootloaders.hid"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega32u4"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
+       </project>
+
+       <project caption="HID Bootloader - 16KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.16_2" force-caption="true" workspace-name="lufa_hid_16kb_2kb_">
+               <require idref="lufa.bootloaders.hid"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega16u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x3800"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3800"/>
+       </project>
+
+       <project caption="HID Bootloader - 8KB FLASH / 2KB Boot - AVR8 Architecture" id="lufa.bootloaders.hid.avr8.8_2" force-caption="true" workspace-name="lufa_hid_8kb_2kb_">
+               <require idref="lufa.bootloaders.hid"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega8u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1800"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1800"/>
+       </project>
+
+       <module type="application" id="lufa.bootloaders.hid" caption="HID Bootloader">
+               <info type="description" value="summary">
+               HID Class Bootloader, capable of reprogramming a device via a custom cross-platform command line utility when plugged into a host.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="Bootloaders"/>
+                       <keyword value="USB Device"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="include-path" value="."/>
+               <build type="c-source" value="BootloaderHID.c"/>
+               <build type="header-file" value="BootloaderHID.h"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="Descriptors.h"/>
+
+               <build type="module-config" subtype="path" value="Config"/>
+               <build type="header-file" value="Config/LUFAConfig.h"/>
+
+               <build type="distribute" subtype="user-file" value="doxyfile"/>
+               <build type="distribute" subtype="user-file" value="BootloaderHID.txt"/>
+               <build type="distribute" subtype="directory" value="HostLoaderApp"/>
+               <build type="distribute" subtype="directory" value="HostLoaderApp_Python"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+               <require idref="lufa.drivers.board.leds"/>
+       </module>
+</asf>
index 6844d4b01c808537d3be8215fcc08c5b7e13cca7..91fc949666a63881b403e9f67028b2602765a3f3 100644 (file)
-/*\r
-             LUFA Library\r
-     Copyright (C) Dean Camera, 2014.\r
-\r
-  dean [at] fourwalledcubicle [dot] com\r
-           www.lufa-lib.org\r
-*/\r
-\r
-/*\r
-  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-\r
-  Permission to use, copy, modify, distribute, and sell this\r
-  software and its documentation for any purpose is hereby granted\r
-  without fee, provided that the above copyright notice appear in\r
-  all copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
-  software without specific, written prior permission.\r
-\r
-  The author disclaims all warranties with regard to this\r
-  software, including all implied warranties of merchantability\r
-  and fitness.  In no event shall the author be liable for any\r
-  special, indirect or consequential damages or any damages\r
-  whatsoever resulting from loss of use, data or profits, whether\r
-  in an action of contract, negligence or other tortious action,\r
-  arising out of or in connection with the use or performance of\r
-  this software.\r
-*/\r
-\r
-#if AUX_BOOT_SECTION_SIZE > 0\r
-#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation).\r
-\r
-; Trampoline to jump over the AUX bootloader section to the start of the bootloader,\r
-; on devices where an AUX bootloader section is used.\r
-.section .boot_aux_trampoline, "ax"\r
-.global Boot_AUX_Trampoline\r
-Boot_AUX_Trampoline:\r
-       jmp BOOT_START_ADDR\r
-#endif\r
-\r
-; Trampolines to actual API implementations if the target address is outside the\r
-; range of a rjmp instruction (can happen with large bootloader sections)\r
-.section .apitable_trampolines, "ax"\r
-.global BootloaderAPI_Trampolines\r
-BootloaderAPI_Trampolines:\r
-\r
-       BootloaderAPI_ErasePage_Trampoline:\r
-               jmp BootloaderAPI_ErasePage\r
-       BootloaderAPI_WritePage_Trampoline:\r
-               jmp BootloaderAPI_WritePage\r
-       BootloaderAPI_FillWord_Trampoline:\r
-               jmp BootloaderAPI_FillWord\r
-       BootloaderAPI_ReadSignature_Trampoline:\r
-               jmp BootloaderAPI_ReadSignature\r
-       BootloaderAPI_ReadFuse_Trampoline:\r
-               jmp BootloaderAPI_ReadFuse\r
-       BootloaderAPI_ReadLock_Trampoline:\r
-               jmp BootloaderAPI_ReadLock\r
-       BootloaderAPI_WriteLock_Trampoline:\r
-               jmp BootloaderAPI_WriteLock\r
-       BootloaderAPI_UNUSED1:\r
-               ret\r
-       BootloaderAPI_UNUSED2:\r
-               ret\r
-       BootloaderAPI_UNUSED3:\r
-               ret\r
-       BootloaderAPI_UNUSED4:\r
-               ret\r
-       BootloaderAPI_UNUSED5:\r
-               ret\r
-\r
-\r
-\r
-; API function jump table\r
-.section .apitable_jumptable, "ax"\r
-.global BootloaderAPI_JumpTable\r
-BootloaderAPI_JumpTable:\r
-\r
-       rjmp BootloaderAPI_ErasePage_Trampoline\r
-       rjmp BootloaderAPI_WritePage_Trampoline\r
-       rjmp BootloaderAPI_FillWord_Trampoline\r
-       rjmp BootloaderAPI_ReadSignature_Trampoline\r
-       rjmp BootloaderAPI_ReadFuse_Trampoline\r
-       rjmp BootloaderAPI_ReadLock_Trampoline\r
-       rjmp BootloaderAPI_WriteLock_Trampoline\r
-       rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1\r
-       rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2\r
-       rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3\r
-       rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4\r
-       rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5\r
-\r
-\r
-\r
-; Bootloader table signatures and information\r
-.section .apitable_signatures, "ax"\r
-.global BootloaderAPI_Signatures\r
-BootloaderAPI_Signatures:\r
-\r
-       .long BOOT_START_ADDR ; Start address of the bootloader\r
-       .word 0xDF30 ; Signature for the MS class bootloader, V1\r
-       .word 0xDCFB ; Signature for a LUFA class bootloader\r
+/*
+             LUFA Library
+     Copyright (C) Dean Camera, 2014.
+
+  dean [at] fourwalledcubicle [dot] com
+           www.lufa-lib.org
+*/
+
+/*
+  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+  Permission to use, copy, modify, distribute, and sell this
+  software and its documentation for any purpose is hereby granted
+  without fee, provided that the above copyright notice appear in
+  all copies and that both that the copyright notice and this
+  permission notice and warranty disclaimer appear in supporting
+  documentation, and that the name of the author not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+
+  The author disclaims all warranties with regard to this
+  software, including all implied warranties of merchantability
+  and fitness.  In no event shall the author be liable for any
+  special, indirect or consequential damages or any damages
+  whatsoever resulting from loss of use, data or profits, whether
+  in an action of contract, negligence or other tortious action,
+  arising out of or in connection with the use or performance of
+  this software.
+*/
+
+#if AUX_BOOT_SECTION_SIZE > 0
+#warning Using a AUX bootloader section in addition to the defined bootloader space (see documentation).
+
+; Trampoline to jump over the AUX bootloader section to the start of the bootloader,
+; on devices where an AUX bootloader section is used.
+.section .boot_aux_trampoline, "ax"
+.global Boot_AUX_Trampoline
+Boot_AUX_Trampoline:
+       jmp BOOT_START_ADDR
+#endif
+
+; Trampolines to actual API implementations if the target address is outside the
+; range of a rjmp instruction (can happen with large bootloader sections)
+.section .apitable_trampolines, "ax"
+.global BootloaderAPI_Trampolines
+BootloaderAPI_Trampolines:
+
+       BootloaderAPI_ErasePage_Trampoline:
+               jmp BootloaderAPI_ErasePage
+       BootloaderAPI_WritePage_Trampoline:
+               jmp BootloaderAPI_WritePage
+       BootloaderAPI_FillWord_Trampoline:
+               jmp BootloaderAPI_FillWord
+       BootloaderAPI_ReadSignature_Trampoline:
+               jmp BootloaderAPI_ReadSignature
+       BootloaderAPI_ReadFuse_Trampoline:
+               jmp BootloaderAPI_ReadFuse
+       BootloaderAPI_ReadLock_Trampoline:
+               jmp BootloaderAPI_ReadLock
+       BootloaderAPI_WriteLock_Trampoline:
+               jmp BootloaderAPI_WriteLock
+       BootloaderAPI_UNUSED1:
+               ret
+       BootloaderAPI_UNUSED2:
+               ret
+       BootloaderAPI_UNUSED3:
+               ret
+       BootloaderAPI_UNUSED4:
+               ret
+       BootloaderAPI_UNUSED5:
+               ret
+
+
+
+; API function jump table
+.section .apitable_jumptable, "ax"
+.global BootloaderAPI_JumpTable
+BootloaderAPI_JumpTable:
+
+       rjmp BootloaderAPI_ErasePage_Trampoline
+       rjmp BootloaderAPI_WritePage_Trampoline
+       rjmp BootloaderAPI_FillWord_Trampoline
+       rjmp BootloaderAPI_ReadSignature_Trampoline
+       rjmp BootloaderAPI_ReadFuse_Trampoline
+       rjmp BootloaderAPI_ReadLock_Trampoline
+       rjmp BootloaderAPI_WriteLock_Trampoline
+       rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
+       rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
+       rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
+       rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
+       rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
+
+
+
+; Bootloader table signatures and information
+.section .apitable_signatures, "ax"
+.global BootloaderAPI_Signatures
+BootloaderAPI_Signatures:
+
+       .long BOOT_START_ADDR ; Start address of the bootloader
+       .word 0xDF30 ; Signature for the MS class bootloader, V1
+       .word 0xDCFB ; Signature for a LUFA class bootloader
index f1d550d1eba5432c3f096d8457451d0d09e1a8ef..700ffa26ffb707968e62b0ea5dd25028649f347d 100644 (file)
-<asf xmlversion="1.0">\r
-       <project caption="Mass Storage Bootloader - 128KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.128_8" force-caption="true" workspace-name="lufa_ms_128kb_8kb_">\r
-               <require idref="lufa.bootloaders.mass_storage"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1E000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>\r
-\r
-               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Mass Storage Bootloader - 64KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.64_8" force-caption="true" workspace-name="lufa_ms_64kb_8kb_">\r
-               <require idref="lufa.bootloaders.mass_storage"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb647"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0xE000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>\r
-\r
-               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Mass Storage Bootloader - 32KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.32_4" force-caption="true" workspace-name="lufa_ms_32kb_4kb_">\r
-               <require idref="lufa.bootloaders.mass_storage"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega32u4"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
-\r
-               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x6810"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x6800"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Mass Storage Bootloader - 16KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.16_4" force-caption="true" workspace-name="lufa_ms_16kb_4kb_">\r
-               <require idref="lufa.bootloaders.mass_storage"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega16u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
-\r
-               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x2810"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x2800"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.bootloaders.mass_storage" caption="Mass Storage Bootloader">\r
-               <info type="description" value="summary">\r
-               Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="Bootloaders"/>\r
-                       <keyword value="USB Device"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="include-path" value="."/>\r
-               <build type="c-source" value="BootloaderMassStorage.c"/>\r
-               <build type="header-file" value="BootloaderMassStorage.h"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-               <build type="c-source" value="BootloaderAPI.c"/>\r
-               <build type="header-file" value="BootloaderAPI.h"/>\r
-               <build type="asm-source" value="BootloaderAPITable.S"/>\r
-\r
-               <build type="module-config" subtype="path" value="Config"/>\r
-               <build type="header-file" value="Config/LUFAConfig.h"/>\r
-               <build type="header-file" value="Config/AppConfig.h"/>\r
-\r
-               <build type="include-path" value="Lib"/>\r
-               <build type="header-file" value="Lib/VirtualFAT.h"/>\r
-               <build type="c-source" value="Lib/VirtualFAT.c"/>\r
-               <build type="header-file" value="Lib/SCSI.h"/>\r
-               <build type="c-source" value="Lib/SCSI.c"/>\r
-\r
-               <build type="distribute" subtype="user-file" value="doxyfile"/>\r
-               <build type="distribute" subtype="user-file" value="BootloaderMassStorage.txt"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-               <require idref="lufa.drivers.board.leds"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="Mass Storage Bootloader - 128KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.128_8" force-caption="true" workspace-name="lufa_ms_128kb_8kb_">
+               <require idref="lufa.bootloaders.mass_storage"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1E000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1E000"/>
+
+               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Mass Storage Bootloader - 64KB FLASH / 8KB Boot - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.64_8" force-caption="true" workspace-name="lufa_ms_64kb_8kb_">
+               <require idref="lufa.bootloaders.mass_storage"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb647"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0xE000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0xE000"/>
+
+               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="0"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Mass Storage Bootloader - 32KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.32_4" force-caption="true" workspace-name="lufa_ms_32kb_4kb_">
+               <require idref="lufa.bootloaders.mass_storage"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega32u4"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
+
+               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x6810"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x6800"/>
+               <build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Mass Storage Bootloader - 16KB FLASH / 4KB Boot (2KB AUX) - AVR8 Architecture" id="lufa.bootloaders.mass_storage.avr8.16_4" force-caption="true" workspace-name="lufa_ms_16kb_4kb_">
+               <require idref="lufa.bootloaders.mass_storage"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega16u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
+
+               <build type="define" name="AUX_BOOT_SECTION_SIZE" value="2048"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux=0x2810"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.boot_aux_trampoline=0x2800"/>
+               <build type="linker-config" subtype="flags" value="--undefined=Boot_AUX_Trampoline"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <module type="application" id="lufa.bootloaders.mass_storage" caption="Mass Storage Bootloader">
+               <info type="description" value="summary">
+               Mass Storage Class Bootloader, capable of reprogramming a device via binary BIN files copied to the virtual FAT12 file-system it creates when plugged into a host.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="Bootloaders"/>
+                       <keyword value="USB Device"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="include-path" value="."/>
+               <build type="c-source" value="BootloaderMassStorage.c"/>
+               <build type="header-file" value="BootloaderMassStorage.h"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="Descriptors.h"/>
+               <build type="c-source" value="BootloaderAPI.c"/>
+               <build type="header-file" value="BootloaderAPI.h"/>
+               <build type="asm-source" value="BootloaderAPITable.S"/>
+
+               <build type="module-config" subtype="path" value="Config"/>
+               <build type="header-file" value="Config/LUFAConfig.h"/>
+               <build type="header-file" value="Config/AppConfig.h"/>
+
+               <build type="include-path" value="Lib"/>
+               <build type="header-file" value="Lib/VirtualFAT.h"/>
+               <build type="c-source" value="Lib/VirtualFAT.c"/>
+               <build type="header-file" value="Lib/SCSI.h"/>
+               <build type="c-source" value="Lib/SCSI.c"/>
+
+               <build type="distribute" subtype="user-file" value="doxyfile"/>
+               <build type="distribute" subtype="user-file" value="BootloaderMassStorage.txt"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+               <require idref="lufa.drivers.board.leds"/>
+       </module>
+</asf>
index 91bb4038e8ee67c85013af866e5c13d2b945f9ab..a0edb2c4f5032c293c35defd4665588624a9123e 100644 (file)
@@ -1,68 +1,68 @@
-#\r
-#             LUFA Library\r
-#     Copyright (C) Dean Camera, 2014.\r
-#\r
-#  dean [at] fourwalledcubicle [dot] com\r
-#           www.lufa-lib.org\r
-#\r
-# --------------------------------------\r
-#         LUFA Project Makefile.\r
-# --------------------------------------\r
-\r
-# Run "make help" for target help.\r
-\r
-MCU          = at90usb1287\r
-ARCH         = AVR8\r
-BOARD        = USBKEY\r
-F_CPU        = 8000000\r
-F_USB        = $(F_CPU)\r
-OPTIMIZATION = s\r
-TARGET       = BootloaderMassStorage\r
-SRC          = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)\r
-LUFA_PATH    = ../../LUFA\r
-CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)\r
-LD_FLAGS     = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)\r
-\r
-# Flash size and bootloader section sizes of the target, in KB. These must\r
-# match the target's total FLASH size and the bootloader size set in the\r
-# device's fuses.\r
-FLASH_SIZE_KB         = 128\r
-BOOT_SECTION_SIZE_KB  = 8\r
-\r
-# Bootloader address calculation formulas\r
-# Do not modify these macros, but rather modify the dependent values above.\r
-CALC_ADDRESS_IN_HEX   = $(shell printf "0x%X" $$(( $(1) )) )\r
-BOOT_START_OFFSET     = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )\r
-BOOT_SEC_OFFSET       = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )\r
-\r
-# Bootloader linker section flags for relocating the API table sections to\r
-# known FLASH addresses - these should not normally be user-edited.\r
-BOOT_SECTION_LD_FLAG  = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))\r
-BOOT_API_LD_FLAGS     = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)\r
-BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable,   BootloaderAPI_JumpTable,   32)\r
-BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures,  BootloaderAPI_Signatures,  8)\r
-\r
-# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the\r
-# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum\r
-# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices.\r
-ifeq ($(BOOT_SECTION_SIZE_KB),8)\r
-  CC_FLAGS           += -DAUX_BOOT_SECTION_SIZE=0\r
-else\r
-  AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB))\r
-\r
-  CC_FLAGS           += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)'\r
-  LD_FLAGS           += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16))\r
-  LD_FLAGS           += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024)\r
-endif\r
-\r
-# Default target\r
-all:\r
-\r
-# Include LUFA build script makefiles\r
-include $(LUFA_PATH)/Build/lufa_core.mk\r
-include $(LUFA_PATH)/Build/lufa_sources.mk\r
-include $(LUFA_PATH)/Build/lufa_build.mk\r
-include $(LUFA_PATH)/Build/lufa_cppcheck.mk\r
-include $(LUFA_PATH)/Build/lufa_doxygen.mk\r
-include $(LUFA_PATH)/Build/lufa_avrdude.mk\r
-include $(LUFA_PATH)/Build/lufa_atprogram.mk\r
+#
+#             LUFA Library
+#     Copyright (C) Dean Camera, 2014.
+#
+#  dean [at] fourwalledcubicle [dot] com
+#           www.lufa-lib.org
+#
+# --------------------------------------
+#         LUFA Project Makefile.
+# --------------------------------------
+
+# Run "make help" for target help.
+
+MCU          = at90usb1287
+ARCH         = AVR8
+BOARD        = USBKEY
+F_CPU        = 8000000
+F_USB        = $(F_CPU)
+OPTIMIZATION = s
+TARGET       = BootloaderMassStorage
+SRC          = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
+LUFA_PATH    = ../../LUFA
+CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
+LD_FLAGS     = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
+
+# 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
+# Do not modify these macros, but rather modify the dependent values above.
+CALC_ADDRESS_IN_HEX   = $(shell printf "0x%X" $$(( $(1) )) )
+BOOT_START_OFFSET     = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
+BOOT_SEC_OFFSET       = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
+
+# Bootloader linker section flags for relocating the API table sections to
+# known FLASH addresses - these should not normally be user-edited.
+BOOT_SECTION_LD_FLAG  = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
+BOOT_API_LD_FLAGS     = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
+BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable,   BootloaderAPI_JumpTable,   32)
+BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures,  BootloaderAPI_Signatures,  8)
+
+# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the
+# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum
+# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices.
+ifeq ($(BOOT_SECTION_SIZE_KB),8)
+  CC_FLAGS           += -DAUX_BOOT_SECTION_SIZE=0
+else
+  AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB))
+
+  CC_FLAGS           += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)'
+  LD_FLAGS           += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16))
+  LD_FLAGS           += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024)
+endif
+
+# Default target
+all:
+
+# Include LUFA build script makefiles
+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
index ec499b74e5a8c39932aecfffda535bf0a1f43b7c..88c51da8257c93f2313014145f1f69a1ac9235ce 100644 (file)
@@ -1,91 +1,91 @@
-/*\r
-             LUFA Library\r
-     Copyright (C) Dean Camera, 2014.\r
-\r
-  dean [at] fourwalledcubicle [dot] com\r
-           www.lufa-lib.org\r
-*/\r
-\r
-/*\r
-  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-\r
-  Permission to use, copy, modify, distribute, and sell this\r
-  software and its documentation for any purpose is hereby granted\r
-  without fee, provided that the above copyright notice appear in\r
-  all copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of the author not be used in\r
-  advertising or publicity pertaining to distribution of the\r
-  software without specific, written prior permission.\r
-\r
-  The author disclaims all warranties with regard to this\r
-  software, including all implied warranties of merchantability\r
-  and fitness.  In no event shall the author be liable for any\r
-  special, indirect or consequential damages or any damages\r
-  whatsoever resulting from loss of use, data or profits, whether\r
-  in an action of contract, negligence or other tortious action,\r
-  arising out of or in connection with the use or performance of\r
-  this software.\r
-*/\r
-\r
-; Trampolines to actual API implementations if the target address is outside the\r
-; range of a rjmp instruction (can happen with large bootloader sections)\r
-.section .apitable_trampolines, "ax"\r
-.global BootloaderAPI_Trampolines\r
-BootloaderAPI_Trampolines:\r
-\r
-       BootloaderAPI_ErasePage_Trampoline:\r
-               jmp BootloaderAPI_ErasePage\r
-       BootloaderAPI_WritePage_Trampoline:\r
-               jmp BootloaderAPI_WritePage\r
-       BootloaderAPI_FillWord_Trampoline:\r
-               jmp BootloaderAPI_FillWord\r
-       BootloaderAPI_ReadSignature_Trampoline:\r
-               jmp BootloaderAPI_ReadSignature\r
-       BootloaderAPI_ReadFuse_Trampoline:\r
-               jmp BootloaderAPI_ReadFuse\r
-       BootloaderAPI_ReadLock_Trampoline:\r
-               jmp BootloaderAPI_ReadLock\r
-       BootloaderAPI_WriteLock_Trampoline:\r
-               jmp BootloaderAPI_WriteLock\r
-       BootloaderAPI_UNUSED1:\r
-               ret\r
-       BootloaderAPI_UNUSED2:\r
-               ret\r
-       BootloaderAPI_UNUSED3:\r
-               ret\r
-       BootloaderAPI_UNUSED4:\r
-               ret\r
-       BootloaderAPI_UNUSED5:\r
-               ret\r
-\r
-\r
-\r
-; API function jump table\r
-.section .apitable_jumptable, "ax"\r
-.global BootloaderAPI_JumpTable\r
-BootloaderAPI_JumpTable:\r
-\r
-       rjmp BootloaderAPI_ErasePage_Trampoline\r
-       rjmp BootloaderAPI_WritePage_Trampoline\r
-       rjmp BootloaderAPI_FillWord_Trampoline\r
-       rjmp BootloaderAPI_ReadSignature_Trampoline\r
-       rjmp BootloaderAPI_ReadFuse_Trampoline\r
-       rjmp BootloaderAPI_ReadLock_Trampoline\r
-       rjmp BootloaderAPI_WriteLock_Trampoline\r
-       rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1\r
-       rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2\r
-       rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3\r
-       rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4\r
-       rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5\r
-\r
-\r
-\r
-; Bootloader table signatures and information\r
-.section .apitable_signatures, "ax"\r
-.global BootloaderAPI_Signatures\r
-BootloaderAPI_Signatures:\r
-\r
-       .long BOOT_START_ADDR ; Start address of the bootloader\r
-       .word 0xDF20 ; Signature for the Printer class bootloader\r
-       .word 0xDCFB ; Signature for a LUFA class bootloader\r
+/*
+             LUFA Library
+     Copyright (C) Dean Camera, 2014.
+
+  dean [at] fourwalledcubicle [dot] com
+           www.lufa-lib.org
+*/
+
+/*
+  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+
+  Permission to use, copy, modify, distribute, and sell this
+  software and its documentation for any purpose is hereby granted
+  without fee, provided that the above copyright notice appear in
+  all copies and that both that the copyright notice and this
+  permission notice and warranty disclaimer appear in supporting
+  documentation, and that the name of the author not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+
+  The author disclaims all warranties with regard to this
+  software, including all implied warranties of merchantability
+  and fitness.  In no event shall the author be liable for any
+  special, indirect or consequential damages or any damages
+  whatsoever resulting from loss of use, data or profits, whether
+  in an action of contract, negligence or other tortious action,
+  arising out of or in connection with the use or performance of
+  this software.
+*/
+
+; Trampolines to actual API implementations if the target address is outside the
+; range of a rjmp instruction (can happen with large bootloader sections)
+.section .apitable_trampolines, "ax"
+.global BootloaderAPI_Trampolines
+BootloaderAPI_Trampolines:
+
+       BootloaderAPI_ErasePage_Trampoline:
+               jmp BootloaderAPI_ErasePage
+       BootloaderAPI_WritePage_Trampoline:
+               jmp BootloaderAPI_WritePage
+       BootloaderAPI_FillWord_Trampoline:
+               jmp BootloaderAPI_FillWord
+       BootloaderAPI_ReadSignature_Trampoline:
+               jmp BootloaderAPI_ReadSignature
+       BootloaderAPI_ReadFuse_Trampoline:
+               jmp BootloaderAPI_ReadFuse
+       BootloaderAPI_ReadLock_Trampoline:
+               jmp BootloaderAPI_ReadLock
+       BootloaderAPI_WriteLock_Trampoline:
+               jmp BootloaderAPI_WriteLock
+       BootloaderAPI_UNUSED1:
+               ret
+       BootloaderAPI_UNUSED2:
+               ret
+       BootloaderAPI_UNUSED3:
+               ret
+       BootloaderAPI_UNUSED4:
+               ret
+       BootloaderAPI_UNUSED5:
+               ret
+
+
+
+; API function jump table
+.section .apitable_jumptable, "ax"
+.global BootloaderAPI_JumpTable
+BootloaderAPI_JumpTable:
+
+       rjmp BootloaderAPI_ErasePage_Trampoline
+       rjmp BootloaderAPI_WritePage_Trampoline
+       rjmp BootloaderAPI_FillWord_Trampoline
+       rjmp BootloaderAPI_ReadSignature_Trampoline
+       rjmp BootloaderAPI_ReadFuse_Trampoline
+       rjmp BootloaderAPI_ReadLock_Trampoline
+       rjmp BootloaderAPI_WriteLock_Trampoline
+       rjmp BootloaderAPI_UNUSED1 ; UNUSED ENTRY 1
+       rjmp BootloaderAPI_UNUSED2 ; UNUSED ENTRY 2
+       rjmp BootloaderAPI_UNUSED3 ; UNUSED ENTRY 3
+       rjmp BootloaderAPI_UNUSED4 ; UNUSED ENTRY 4
+       rjmp BootloaderAPI_UNUSED5 ; UNUSED ENTRY 5
+
+
+
+; Bootloader table signatures and information
+.section .apitable_signatures, "ax"
+.global BootloaderAPI_Signatures
+BootloaderAPI_Signatures:
+
+       .long BOOT_START_ADDR ; Start address of the bootloader
+       .word 0xDF20 ; Signature for the Printer class bootloader
+       .word 0xDCFB ; Signature for a LUFA class bootloader
index 86a56911ede5f058aeadf47ffd6cffd46949bc1e..b5c0c6b3a5d86acefabb383143a568d1d594771f 100644 (file)
-<asf xmlversion="1.0">\r
-       <project caption="Printer Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.128_4" force-caption="true" workspace-name="lufa_printer_128kb_4kb_">\r
-               <require idref="lufa.bootloaders.printer"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Printer Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.64_4" force-caption="true" workspace-name="lufa_printer_64kb_4kb_">\r
-               <require idref="lufa.bootloaders.printer"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="at90usb647"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Printer Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.32_4" force-caption="true" workspace-name="lufa_printer_32kb_4kb_">\r
-               <require idref="lufa.bootloaders.printer"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega32u4"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Printer Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.16_4" force-caption="true" workspace-name="lufa_printer_16kb_4kb_">\r
-               <require idref="lufa.bootloaders.printer"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega16u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <project caption="Printer Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.8_4" force-caption="true" workspace-name="lufa_printer_8kb_4kb_">\r
-               <require idref="lufa.bootloaders.printer"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8"/>\r
-\r
-               <device-support value="atmega8u2"/>\r
-               <config name="lufa.drivers.board.name" value="none"/>\r
-\r
-               <config name="config.compiler.optimization.level" value="size"/>\r
-\r
-               <build type="define" name="F_CPU" value="16000000UL"/>\r
-               <build type="define" name="F_USB" value="16000000UL"/>\r
-\r
-               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>\r
-\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>\r
-               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>\r
-               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.bootloaders.printer" caption="Printer Bootloader">\r
-               <info type="description" value="summary">\r
-               Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="Bootloaders"/>\r
-                       <keyword value="USB Device"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="include-path" value="."/>\r
-               <build type="c-source" value="BootloaderPrinter.c"/>\r
-               <build type="header-file" value="BootloaderPrinter.h"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-               <build type="c-source" value="BootloaderAPI.c"/>\r
-               <build type="header-file" value="BootloaderAPI.h"/>\r
-               <build type="asm-source" value="BootloaderAPITable.S"/>\r
-\r
-               <build type="module-config" subtype="path" value="Config"/>\r
-               <build type="header-file" value="Config/LUFAConfig.h"/>\r
-\r
-               <build type="distribute" subtype="user-file" value="doxyfile"/>\r
-               <build type="distribute" subtype="user-file" value="BootloaderPrinter.txt"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-               <require idref="lufa.drivers.board.leds"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="Printer Bootloader - 128KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.128_4" force-caption="true" workspace-name="lufa_printer_128kb_4kb_">
+               <require idref="lufa.bootloaders.printer"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1F000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1F000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Printer Bootloader - 64KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.64_4" force-caption="true" workspace-name="lufa_printer_64kb_4kb_">
+               <require idref="lufa.bootloaders.printer"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="at90usb647"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0xF000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0xF000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0xFFA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0xFFE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0xFFF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Printer Bootloader - 32KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.32_4" force-caption="true" workspace-name="lufa_printer_32kb_4kb_">
+               <require idref="lufa.bootloaders.printer"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega32u4"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x7000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x7000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x7FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x7FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x7FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Printer Bootloader - 16KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.16_4" force-caption="true" workspace-name="lufa_printer_16kb_4kb_">
+               <require idref="lufa.bootloaders.printer"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega16u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x3000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x3000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x3FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x3FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x3FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <project caption="Printer Bootloader - 8KB FLASH / 4KB Boot - AVR8 Architecture" id="lufa.bootloaders.printer.avr8.8_4" force-caption="true" workspace-name="lufa_printer_8kb_4kb_">
+               <require idref="lufa.bootloaders.printer"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8"/>
+
+               <device-support value="atmega8u2"/>
+               <config name="lufa.drivers.board.name" value="none"/>
+
+               <config name="config.compiler.optimization.level" value="size"/>
+
+               <build type="define" name="F_CPU" value="16000000UL"/>
+               <build type="define" name="F_USB" value="16000000UL"/>
+
+               <build type="define" name="BOOT_START_ADDR" value="0x1000"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.text=0x1000"/>
+
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_trampolines=0x1FA0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Trampolines"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_jumptable=0x1FE0"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_JumpTable"/>
+               <build type="linker-config" subtype="flags" value="--section-start=.apitable_signatures=0x1FF8"/>
+               <build type="linker-config" subtype="flags" value="--undefined=BootloaderAPI_Signatures"/>
+       </project>
+
+       <module type="application" id="lufa.bootloaders.printer" caption="Printer Bootloader">
+               <info type="description" value="summary">
+               Printer Class Bootloader, capable of reprogramming a device by "printing" new HEX files to the virtual Plain-Text printer it creates when plugged into a host.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="Bootloaders"/>
+                       <keyword value="USB Device"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="include-path" value="."/>
+               <build type="c-source" value="BootloaderPrinter.c"/>
+               <build type="header-file" value="BootloaderPrinter.h"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="Descriptors.h"/>
+               <build type="c-source" value="BootloaderAPI.c"/>
+               <build type="header-file" value="BootloaderAPI.h"/>
+               <build type="asm-source" value="BootloaderAPITable.S"/>
+
+               <build type="module-config" subtype="path" value="Config"/>
+               <build type="header-file" value="Config/LUFAConfig.h"/>
+
+               <build type="distribute" subtype="user-file" value="doxyfile"/>
+               <build type="distribute" subtype="user-file" value="BootloaderPrinter.txt"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+               <require idref="lufa.drivers.board.leds"/>
+       </module>
+</asf>
index 0716c3bbe8804b56336604b7bcdabf0dca949dbf..0db035de3b84db98c243eecd4287f28ed2e02331 100644 (file)
@@ -1,55 +1,55 @@
-#\r
-#             LUFA Library\r
-#     Copyright (C) Dean Camera, 2014.\r
-#\r
-#  dean [at] fourwalledcubicle [dot] com\r
-#           www.lufa-lib.org\r
-#\r
-# --------------------------------------\r
-#         LUFA Project Makefile.\r
-# --------------------------------------\r
-\r
-# Run "make help" for target help.\r
-\r
-MCU          = at90usb1287\r
-ARCH         = AVR8\r
-BOARD        = USBKEY\r
-F_CPU        = 8000000\r
-F_USB        = $(F_CPU)\r
-OPTIMIZATION = s\r
-TARGET       = BootloaderPrinter\r
-SRC          = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)\r
-LUFA_PATH    = ../../LUFA\r
-CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)\r
-LD_FLAGS     = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)\r
-\r
-# Flash size and bootloader section sizes of the target, in KB. These must\r
-# match the target's total FLASH size and the bootloader size set in the\r
-# device's fuses.\r
-FLASH_SIZE_KB         = 128\r
-BOOT_SECTION_SIZE_KB  = 8\r
-\r
-# Bootloader address calculation formulas\r
-# Do not modify these macros, but rather modify the dependent values above.\r
-CALC_ADDRESS_IN_HEX   = $(shell printf "0x%X" $$(( $(1) )) )\r
-BOOT_START_OFFSET     = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )\r
-BOOT_SEC_OFFSET       = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )\r
-\r
-# Bootloader linker section flags for relocating the API table sections to\r
-# known FLASH addresses - these should not normally be user-edited.\r
-BOOT_SECTION_LD_FLAG  = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))\r
-BOOT_API_LD_FLAGS     = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)\r
-BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable,   BootloaderAPI_JumpTable,   32)\r
-BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures,  BootloaderAPI_Signatures,  8)\r
-\r
-# Default target\r
-all:\r
-\r
-# Include LUFA build script makefiles\r
-include $(LUFA_PATH)/Build/lufa_core.mk\r
-include $(LUFA_PATH)/Build/lufa_sources.mk\r
-include $(LUFA_PATH)/Build/lufa_build.mk\r
-include $(LUFA_PATH)/Build/lufa_cppcheck.mk\r
-include $(LUFA_PATH)/Build/lufa_doxygen.mk\r
-include $(LUFA_PATH)/Build/lufa_avrdude.mk\r
-include $(LUFA_PATH)/Build/lufa_atprogram.mk\r
+#
+#             LUFA Library
+#     Copyright (C) Dean Camera, 2014.
+#
+#  dean [at] fourwalledcubicle [dot] com
+#           www.lufa-lib.org
+#
+# --------------------------------------
+#         LUFA Project Makefile.
+# --------------------------------------
+
+# Run "make help" for target help.
+
+MCU          = at90usb1287
+ARCH         = AVR8
+BOARD        = USBKEY
+F_CPU        = 8000000
+F_USB        = $(F_CPU)
+OPTIMIZATION = s
+TARGET       = BootloaderPrinter
+SRC          = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
+LUFA_PATH    = ../../LUFA
+CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
+LD_FLAGS     = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
+
+# 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
+# Do not modify these macros, but rather modify the dependent values above.
+CALC_ADDRESS_IN_HEX   = $(shell printf "0x%X" $$(( $(1) )) )
+BOOT_START_OFFSET     = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
+BOOT_SEC_OFFSET       = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
+
+# Bootloader linker section flags for relocating the API table sections to
+# known FLASH addresses - these should not normally be user-edited.
+BOOT_SECTION_LD_FLAG  = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
+BOOT_API_LD_FLAGS     = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
+BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable,   BootloaderAPI_JumpTable,   32)
+BOOT_API_LD_FLAGS    += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures,  BootloaderAPI_Signatures,  8)
+
+# Default target
+all:
+
+# Include LUFA build script makefiles
+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
index 9fd188c936fc1b343758c44181fff9252a920d01..e839ba6b1d985775d5dd1e3cafec5bd41d7a7568 100644 (file)
@@ -1,42 +1,42 @@
-#\r
-#             LUFA Library\r
-#     Copyright (C) Dean Camera, 2014.\r
-#\r
-#  dean [at] fourwalledcubicle [dot] com\r
-#           www.lufa-lib.org\r
-#\r
-# --------------------------------------\r
-#         LUFA Project Makefile.\r
-# --------------------------------------\r
-\r
-# Run "make help" for target help.\r
-\r
-MCU          = at90usb1287\r
-ARCH         = AVR8\r
-F_CPU        = 1000000\r
-F_USB        = $(F_CPU)\r
-OPTIMIZATION = s\r
-TARGET       = HID_EEPROM_Loader\r
-SRC          = $(TARGET).c\r
-LUFA_PATH    = ../../../LUFA\r
-CC_FLAGS     =\r
-LD_FLAGS     =\r
-OBJECT_FILES = InputEEData.o\r
-\r
-# Default target\r
-all:\r
-\r
-# Determine the AVR sub-architecture of the build main application object file\r
-FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)\r
-\r
-# Create a linkable object file with the input binary EEPROM data stored in the FLASH section\r
-InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)\r
-       @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"\r
-       avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@\r
-\r
-# Include LUFA build script makefiles\r
-include $(LUFA_PATH)/Build/lufa_core.mk\r
-include $(LUFA_PATH)/Build/lufa_build.mk\r
-include $(LUFA_PATH)/Build/lufa_cppcheck.mk\r
-include $(LUFA_PATH)/Build/lufa_doxygen.mk\r
-include $(LUFA_PATH)/Build/lufa_hid.mk\r
+#
+#             LUFA Library
+#     Copyright (C) Dean Camera, 2014.
+#
+#  dean [at] fourwalledcubicle [dot] com
+#           www.lufa-lib.org
+#
+# --------------------------------------
+#         LUFA Project Makefile.
+# --------------------------------------
+
+# Run "make help" for target help.
+
+MCU          = at90usb1287
+ARCH         = AVR8
+F_CPU        = 1000000
+F_USB        = $(F_CPU)
+OPTIMIZATION = s
+TARGET       = HID_EEPROM_Loader
+SRC          = $(TARGET).c
+LUFA_PATH    = ../../../LUFA
+CC_FLAGS     =
+LD_FLAGS     =
+OBJECT_FILES = InputEEData.o
+
+# Default target
+all:
+
+# Determine the AVR sub-architecture of the build main application object file
+FIND_AVR_SUBARCH = avr$(shell avr-objdump -f $(TARGET).o | grep architecture | cut -d':' -f3 | cut -d',' -f1)
+
+# Create a linkable object file with the input binary EEPROM data stored in the FLASH section
+InputEEData.o: InputEEData.bin $(TARGET).o $(MAKEFILE_LIST)
+       @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a object file \"$@\"
+       avr-objcopy -I binary -O elf32-avr -B $(call FIND_AVR_SUBARCH) --rename-section .data=.progmem.data,contents,alloc,readonly,data $< $@
+
+# Include LUFA build script makefiles
+include $(LUFA_PATH)/Build/lufa_core.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_hid.mk
index fd65db283facc5ec6899ccf5e5bf84e3e2c84627..e952714e16b39088ae6137587dba7d882172e815 100644 (file)
@@ -1,55 +1,55 @@
-<asf xmlversion="1.0">\r
-       <project caption="USB Device Template" id="lufa.templates.device.project.avr8">\r
-               <require idref="lufa.templates.device"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8_template"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
-\r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
-       </project>\r
-\r
-       <project caption="USB Device Template" id="lufa.templates.device.project.xmega">\r
-               <require idref="lufa.templates.device"/>\r
-               <require idref="lufa.boards.dummy.xmega"/>\r
-               <generator value="as5_8_template"/>\r
-\r
-               <device-support value="atxmega256a3bu"/>\r
-               <config name="lufa.drivers.board.name" value="a3bu_xplained"/>\r
-\r
-               <build type="define" name="F_CPU" value="32000000UL"/>\r
-               <build type="define" name="F_USB" value="48000000UL"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.templates.device" caption="USB Device Template">\r
-               <info type="description" value="summary">\r
-               Template for a LUFA USB device mode application.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="USB Device"/>\r
-                       <keyword value="Template Projects"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="c-source" value="DeviceApplication.c"/>\r
-               <build type="c-source" value="Descriptors.c"/>\r
-               <build type="header-file" value="DeviceApplication.h"/>\r
-               <build type="header-file" value="Descriptors.h"/>\r
-\r
-               <build type="module-config" subtype="path" value=".."/>\r
-               <build type="header-file" value="../LUFAConfig.h"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="USB Device Template" id="lufa.templates.device.project.avr8">
+               <require idref="lufa.templates.device"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8_template"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="usbkey"/>
+
+               <build type="define" name="F_CPU" value="8000000UL"/>
+               <build type="define" name="F_USB" value="8000000UL"/>
+       </project>
+
+       <project caption="USB Device Template" id="lufa.templates.device.project.xmega">
+               <require idref="lufa.templates.device"/>
+               <require idref="lufa.boards.dummy.xmega"/>
+               <generator value="as5_8_template"/>
+
+               <device-support value="atxmega256a3bu"/>
+               <config name="lufa.drivers.board.name" value="a3bu_xplained"/>
+
+               <build type="define" name="F_CPU" value="32000000UL"/>
+               <build type="define" name="F_USB" value="48000000UL"/>
+       </project>
+
+       <module type="application" id="lufa.templates.device" caption="USB Device Template">
+               <info type="description" value="summary">
+               Template for a LUFA USB device mode application.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="USB Device"/>
+                       <keyword value="Template Projects"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="c-source" value="DeviceApplication.c"/>
+               <build type="c-source" value="Descriptors.c"/>
+               <build type="header-file" value="DeviceApplication.h"/>
+               <build type="header-file" value="Descriptors.h"/>
+
+               <build type="module-config" subtype="path" value=".."/>
+               <build type="header-file" value="../LUFAConfig.h"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+       </module>
+</asf>
index c1996ec7114aed39ec3e1627966d2044fb2c9569..c3860c056d3e4450bbf04901b222bd4f5905f168 100644 (file)
@@ -1,41 +1,41 @@
-<asf xmlversion="1.0">\r
-       <project caption="USB Host Template" id="lufa.templates.host.project">\r
-               <require idref="lufa.templates.host"/>\r
-               <require idref="lufa.boards.dummy.avr8"/>\r
-               <generator value="as5_8_template"/>\r
-\r
-               <device-support value="at90usb1287"/>\r
-               <config name="lufa.drivers.board.name" value="usbkey"/>\r
-\r
-               <build type="define" name="F_CPU" value="8000000UL"/>\r
-               <build type="define" name="F_USB" value="8000000UL"/>\r
-       </project>\r
-\r
-       <module type="application" id="lufa.templates.host" caption="USB Host Template">\r
-               <info type="description" value="summary">\r
-               Template for a LUFA USB host mode application.\r
-               </info>\r
-\r
-               <info type="gui-flag" value="move-to-root"/>\r
-\r
-               <info type="keyword" value="Technology">\r
-                       <keyword value="USB Host"/>\r
-                       <keyword value="Template Projects"/>\r
-               </info>\r
-\r
-               <device-support-alias value="lufa_avr8"/>\r
-               <device-support-alias value="lufa_xmega"/>\r
-               <device-support-alias value="lufa_uc3"/>\r
-\r
-               <build type="c-source" value="HostApplication.c"/>\r
-               <build type="header-file" value="HostApplication.h"/>\r
-\r
-               <build type="module-config" subtype="path" value=".."/>\r
-               <build type="header-file" value="../LUFAConfig.h"/>\r
-\r
-               <require idref="lufa.common"/>\r
-               <require idref="lufa.platform"/>\r
-               <require idref="lufa.drivers.usb"/>\r
-               <require idref="lufa.drivers.board"/>\r
-       </module>\r
-</asf>\r
+<asf xmlversion="1.0">
+       <project caption="USB Host Template" id="lufa.templates.host.project">
+               <require idref="lufa.templates.host"/>
+               <require idref="lufa.boards.dummy.avr8"/>
+               <generator value="as5_8_template"/>
+
+               <device-support value="at90usb1287"/>
+               <config name="lufa.drivers.board.name" value="usbkey"/>
+
+               <build type="define" name="F_CPU" value="8000000UL"/>
+               <build type="define" name="F_USB" value="8000000UL"/>
+       </project>
+
+       <module type="application" id="lufa.templates.host" caption="USB Host Template">
+               <info type="description" value="summary">
+               Template for a LUFA USB host mode application.
+               </info>
+
+               <info type="gui-flag" value="move-to-root"/>
+
+               <info type="keyword" value="Technology">
+                       <keyword value="USB Host"/>
+                       <keyword value="Template Projects"/>
+               </info>
+
+               <device-support-alias value="lufa_avr8"/>
+               <device-support-alias value="lufa_xmega"/>
+               <device-support-alias value="lufa_uc3"/>
+
+               <build type="c-source" value="HostApplication.c"/>
+               <build type="header-file" value="HostApplication.h"/>
+
+               <build type="module-config" subtype="path" value=".."/>
+               <build type="header-file" value="../LUFAConfig.h"/>
+
+               <require idref="lufa.common"/>
+               <require idref="lufa.platform"/>
+               <require idref="lufa.drivers.usb"/>
+               <require idref="lufa.drivers.board"/>
+       </module>
+</asf>
index 7ddfa1be3f8879c82af354b1d878072a81f7bc6f..0ae1dd678f3d5c852f7a6d635e70db70fc36213c 100644 (file)
-/** \file\r
- *\r
- *  This file contains special DoxyGen information for the generation of the main page and other special\r
- *  documentation pages. It is not a project source file.\r
- */\r
-\r
-/** \page Page_BuildSystem The LUFA Build System\r
- *\r
- *  \section Sec_BuildSystem_Overview Overview of the LUFA Build System\r
- *  The LUFA build system is an attempt at making a set of re-usable, modular build make files which\r
- *  can be referenced in a LUFA powered project, to minimize the amount of code required in an\r
- *  application makefile. The system is written in GNU Make, and each module is independent of\r
- *  one-another.\r
- *\r
- *  For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA\r
- *  build system, see \ref Sec_CompilingApps_Prerequisites.\r
- *\r
- *  To use a LUFA build system module, simply add an include to your project makefile. All user projects\r
- *  should at a minimum include \ref Page_BuildModule_CORE for base functionality:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_core.mk\r
- *  \endcode\r
- *\r
- *  Once included in your project makefile, the associated build module targets will be added to your\r
- *  project's build makefile targets automatically. To call a build target, run <tt>make {TARGET_NAME}</tt>\r
- *  from the command line, substituting in the appropriate target name.\r
- *\r
- *  \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile.\r
- *\r
- *  Each build module may have one or more mandatory parameters (GNU Make variables) which <i>must</i>\r
- *  be supplied in the project makefile for the module to work, and one or more optional parameters which\r
- *  may be defined and which will assume a sensible default if not.\r
- *\r
- *  \section SSec_BuildSystem_Modules Available Modules\r
- *\r
- *  The following modules are included in this LUFA release:\r
- *\r
- *  \li \subpage Page_BuildModule_ATPROGRAM - Device Programming\r
- *  \li \subpage Page_BuildModule_AVRDUDE - Device Programming\r
- *  \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking\r
- *  \li \subpage Page_BuildModule_CORE - Core Build System Functions\r
- *  \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis\r
- *  \li \subpage Page_BuildModule_DFU - Device Programming\r
- *  \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation\r
- *  \li \subpage Page_BuildModule_HID - Device Programming\r
- *  \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables\r
- *\r
- *  If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps.\r
- */\r
-\r
- /** \page Page_BuildModule_BUILD The BUILD build module\r
- *\r
- *  The BUILD LUFA build system module, providing targets for the compilation,\r
- *  assembling and linking of an application from source code into binary files\r
- *  suitable for programming into a target device, using the GCC compiler.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_build.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_BUILD_Requirements Requirements\r
- *  This module requires the the architecture appropriate binaries of the GCC compiler are available in your\r
- *  system's <b>PATH</b> variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio\r
- *  5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.\r
- *\r
- *  \section SSec_BuildModule_BUILD_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>size</tt></td>\r
- *    <td>Display size of the compiled application FLASH and SRAM segments.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>symbol-sizes</tt></td>\r
- *    <td>Display a size-sorted list of symbols from the compiled application, in decimal bytes.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>lib</tt></td>\r
- *    <td>Build and archive all source files into a library A binary file.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>all</tt></td>\r
- *    <td>Build and link the application into ELF debug and HEX binary files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>elf</tt></td>\r
- *    <td>Build and link the application into an ELF debug file.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>bin</tt></td>\r
- *    <td>Build and link the application and produce a BIN binary file.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>hex</tt></td>\r
- *    <td>Build and link the application and produce HEX and EEP binary files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>lss</tt></td>\r
- *    <td>Build and link the application and produce a LSS source code/assembly code mixed listing file.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>clean</tt></td>\r
- *    <td>Remove all intermediary files and binary output files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>mostlyclean</tt></td>\r
- *    <td>Remove all intermediary files but preserve any binary output files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt><i>&lt;filename&gt;</i>.s</tt></td>\r
- *    <td>Create an assembly listing of a given input C/C++ source file.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>TARGET</tt></td>\r
- *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>ARCH</tt></td>\r
- *    <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>MCU</tt></td>\r
- *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>SRC</tt></td>\r
- *    <td>List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>F_USB</tt></td>\r
- *    <td>Speed in Hz of the input clock frequency to the target's USB controller.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_PATH</tt></td>\r
- *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>BOARD</tt></td>\r
- *    <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>OPTIMIZATION</tt></td>\r
- *    <td>Optimization level to use when compiling source files (see GCC manual).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>C_STANDARD</tt></td>\r
- *    <td>Version of the C standard to apply when compiling C++ source files (see GCC manual).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPP_STANDARD</tt></td>\r
- *    <td>Version of the C++ standard to apply when compiling C++ source files (see GCC manual).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>DEBUG_FORMAT</tt></td>\r
- *    <td>Format of the debug information to embed in the generated object files (see GCC manual).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>DEBUG_LEVEL</tt></td>\r
- *    <td>Level of the debugging information to embed in the generated object files (see GCC manual).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>F_CPU</tt></td>\r
- *    <td>Speed of the processor CPU clock, in Hz.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>C_FLAGS</tt></td>\r
- *    <td>Flags to pass to the C compiler only, after the automatically generated flags.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPP_FLAGS</tt></td>\r
- *    <td>Flags to pass to the C++ compiler only, after the automatically generated flags.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>ASM_FLAGS</tt></td>\r
- *    <td>Flags to pass to the assembler only, after the automatically generated flags.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CC_FLAGS</tt></td>\r
- *    <td>Common flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>COMPILER_PATH</tt></td>\r
- *    <td>Directory where the C/C++ toolchain is located, if not available in the system <tt>PATH</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LD_FLAGS</tt></td>\r
- *    <td>Flags to pass to the linker, after the automatically generated flags.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LINKER_RELAXATIONS</tt></td>\r
- *    <td>Enables or disables linker relaxations when linking the application binary. This can reduce the total size\r
- *        of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible.\r
- *        \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you\r
- *              receive a link error <tt>relocation truncated to fit: R_AVR_13_PCREL</tt>, disable this setting.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>OBJDIR</tt></td>\r
- *    <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.\r
- *        \note When this option is enabled, all source filenames <b>must</b> be unique.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>OBJECT_FILES</tt></td>\r
- *    <td>List of additional object files that should be linked into the resulting binary.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
-/** \page Page_BuildModule_CORE The CORE build module\r
- *\r
- *  The core LUFA build system module, providing common build system help and information targets.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_core.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_CORE_Requirements Requirements\r
- *  This module has no requirements outside a standard *nix shell like environment; the <tt>sh</tt>\r
- *  shell, GNU <tt>make</tt> and *nix CoreUtils (<tt>echo</tt>, <tt>printf</tt>, etc.).\r
- *\r
- *  \section SSec_BuildModule_CORE_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>help</tt></td>\r
- *    <td>Display build system help and configuration information.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_targets</tt></td>\r
- *    <td>List all available build targets from the build system.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_modules</tt></td>\r
- *    <td>List all available build modules from the build system.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_mandatory</tt></td>\r
- *    <td>List all mandatory parameters required by the included modules.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_optional</tt></td>\r
- *    <td>List all optional parameters required by the included modules.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_provided</tt></td>\r
- *    <td>List all variables provided by the included modules.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>list_macros</tt></td>\r
- *    <td>List all macros provided by the included modules.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CORE_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
-/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module\r
- *\r
- *  The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an\r
- *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_atprogram.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_Requirements Requirements\r
- *  This module requires the <tt>atprogram.exe</tt> utility to be available in your system's <b>PATH</b>\r
- *  variable. The <tt>atprogram.exe</tt> utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x\r
- *  inside the application install folder's "\atbackend" subdirectory.\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>atprogram</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>atprogram-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>MCU</tt></td>\r
- *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>TARGET</tt></td>\r
- *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>ATPROGRAM_PROGRAMMER</tt></td>\r
- *    <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. <tt>jtagice3</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>ATPROGRAM_INTERFACE</tt></td>\r
- *    <td>Name of the programming interface to use when programming the target (e.g. <tt>spi</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>ATPROGRAM_PORT</tt></td>\r
- *    <td>Name of the communication port to use when when programming with a serially connected tool (e.g. <tt>COM2</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
-/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module\r
- *\r
- *  The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an\r
- *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_avrdude.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_Requirements Requirements\r
- *  This module requires the <tt>avrdude</tt> utility to be available in your system's <b>PATH</b>\r
- *  variable. The <tt>avrdude</tt> utility is distributed in the old WinAVR project releases for\r
- *  Windows (<a>http://winavr.sourceforge.net</a>) or can be installed on *nix systems via the project's\r
- *  source code (<a>https://savannah.nongnu.org/projects/avrdude</a>) or through the package manager.\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>avrdude</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>avrdude-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>MCU</tt></td>\r
- *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>TARGET</tt></td>\r
- *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>AVRDUDE_PROGRAMMER</tt></td>\r
- *    <td>Name of the programmer or debugger tool to communicate with (e.g. <tt>jtagicemkii</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>AVRDUDE_PORT</tt></td>\r
- *    <td>Name of the communication port to use when when programming with the connected tool (e.g. <tt>COM2</tt>, <tt>/dev/ttyUSB0</tt> or <tt>usb</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>AVRDUDE_FLAGS</tt></td>\r
- *    <td>Additional flags to pass to avrdude when programming, applied after the automatically generated flags.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
- /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module\r
- *\r
- *  The CPPCHECK programming utility LUFA build system module, providing targets to statically\r
- *  analyze C and C++ source code for errors and performance/style issues.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_cppcheck.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_Requirements Requirements\r
- *  This module requires the <tt>cppcheck</tt> utility to be available in your system's <b>PATH</b>\r
- *  variable. The <tt>cppcheck</tt> utility is distributed through the project's home page\r
- *  (<a>http://cppcheck.sourceforge.net</a>) for Windows, and can be installed on *nix systems via\r
- *  the project's source code or through the package manager.\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>cppcheck</tt></td>\r
- *    <td>Statically analyze the project source code for issues.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>cppcheck-config</tt></td>\r
- *    <td>Check the <tt>cppcheck</tt> configuration - scan source code and warn about missing header files and other issues.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>SRC</tt></td>\r
- *    <td>List of source files to statically analyze.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_INCLUDES</tt></td>\r
- *    <td>Path of extra directories to check when attemting to resolve C/C++ header file includes.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_EXCLUDES</tt></td>\r
- *    <td>Paths or path fragments to exclude when analyzing.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_MSG_TEMPLATE</tt></td>\r
- *    <td>Output message template to use when printing errors, warnings and information (see <tt>cppcheck</tt> documentation).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_ENABLE</tt></td>\r
- *    <td>Analysis rule categories to enable (see <tt>cppcheck</tt> documentation).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_SUPPRESS</tt></td>\r
- *    <td>Specific analysis rules to suppress (see <tt>cppcheck</tt> documentation).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_FAIL_ON_WARNING</tt></td>\r
- *    <td>Set to <b>Y</b> to fail the analysis job with an error exit code if warnings are found, <b>N</b> to continue without failing.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_QUIET</tt></td>\r
- *    <td>Set to <b>Y</b> to suppress all output except warnings and errors, <b>N</b> to show verbose output information.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>CPPCHECK_FLAGS</tt></td>\r
- *    <td>Extra flags to pass to <tt>cppcheck</tt>, after the automatically generated flags.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
- /** \page Page_BuildModule_DFU The DFU build module\r
- *\r
- *  The DFU programming utility LUFA build system module, providing targets to reprogram an\r
- *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.\r
- *  This module requires a DFU class bootloader to be running in the target, compatible with\r
- *  the DFU bootloader protocol as published by Atmel.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_dfu.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_DFU_Requirements Requirements\r
- *  This module requires either the <tt>batchisp</tt> utility from Atmel's FLIP utility, or the open\r
- *  source <tt>dfu-programmer</tt> utility (<a>http://dfu-programmer.sourceforge.net/</a>) to be\r
- *  available in your system's <b>PATH</b> variable. On *nix systems the <tt>dfu-programmer</tt> utility\r
- *  can be installed via the project's source code or through the package manager.\r
- *\r
- *  \section SSec_BuildModule_DFU_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>dfu</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data using <tt>dfu-programmer</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>dfu-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>dfu-programmer</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>flip</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data using <tt>batchisp</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>flip-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>batchisp</tt>.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>MCU</tt></td>\r
- *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>TARGET</tt></td>\r
- *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DFU_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
- /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module\r
- *\r
- *  The DOXYGEN code documentation utility LUFA build system module, providing targets to generate\r
- *  project HTML and other format documentation from a set of source files that include special\r
- *  Doxygen comments.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_doxygen.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_Requirements Requirements\r
- *  This module requires the <tt>doxygen</tt> utility from the Doxygen website\r
- *  (<a>http://www.doxygen.org/</a>) to be available in your system's <b>PATH</b> variable. On *nix\r
- *  systems the <tt>doxygen</tt> utility can be installed via the project's source code or through\r
- *  the package manager.\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>doxygen</tt></td>\r
- *    <td>Generate project documentation.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>doxygen_create</tt></td>\r
- *    <td>Create a new Doxygen configuration file using the latest template.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>doxygen_upgrade</tt></td>\r
- *    <td>Upgrade an existing Doxygen configuration file to the latest template</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>LUFA_PATH</tt></td>\r
- *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>DOXYGEN_CONF</tt></td>\r
- *    <td>Name and path of the base Doxygen configuration file for the project.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>DOXYGEN_FAIL_ON_WARNING</tt></td>\r
- *    <td>Set to <b>Y</b> to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, <b>N</b> to continue without failing.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>DOXYGEN_OVERRIDE_PARAMS</tt></td>\r
- *    <td>Extra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. <tt>QUIET=YES</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
- /** \page Page_BuildModule_HID The HID build module\r
- *\r
- *  The HID programming utility LUFA build system module, providing targets to reprogram an\r
- *  Atmel processor's FLASH memory with a project's compiled binary output file. This module\r
- *  requires a HID class bootloader to be running in the target, using a protocol compatible\r
- *  with the PJRC "HalfKay" protocol (<a>http://www.pjrc.com/teensy/halfkay_protocol.html</a>).\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_hid.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_HID_Requirements Requirements\r
- *  This module requires either the <tt>hid_bootloader_cli</tt> utility from the included LUFA HID\r
- *  class bootloader API subdirectory, or the <tt>teensy_loader_cli</tt> utility from PJRC\r
- *  (<a>http://www.pjrc.com/teensy/loader_cli.html</a>) to be available in your system's <b>PATH</b>\r
- *  variable.\r
- *\r
- *  \section SSec_BuildModule_HID_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>hid</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data using <tt>hid_bootloader_cli</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>hid-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>hid_bootloader_cli</tt> and\r
- *        a temporary AVR application programmed into the target's FLASH.\r
- *        \note This will erase the currently loaded application in the target.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>teensy</tt></td>\r
- *    <td>Program the device FLASH memory with the application's executable data using <tt>teensy_loader_cli</tt>.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>teensy-ee</tt></td>\r
- *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>teensy_loader_cli</tt> and\r
- *        a temporary AVR application programmed into the target's FLASH.\r
- *        \note This will erase the currently loaded application in the target.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>MCU</tt></td>\r
- *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>TARGET</tt></td>\r
- *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_HID_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
- /** \page Page_BuildModule_SOURCES The SOURCES build module\r
- *\r
- *  The SOURCES LUFA build system module, providing variables listing the various LUFA source files\r
- *  required to be build by a project for a given LUFA module. This module gives a way to reference\r
- *  LUFA source files symbolically, so that changes to the library structure do not break the library\r
- *  makefile.\r
- *\r
- *  To use this module in your application makefile, add the following code:\r
- *  \code\r
- *  include $(LUFA_PATH)/Build/lufa_sources.mk\r
- *  \endcode\r
- *\r
- *  \section SSec_BuildModule_SOURCES_Requirements Requirements\r
- *  None.\r
- *\r
- *  \section SSec_BuildModule_SOURCES_Targets Targets\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>LUFA_PATH</tt></td>\r
- *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>ARCH</tt></td>\r
- *    <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_USB</tt></td>\r
- *    <td>List of LUFA USB driver source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_USBCLASS</tt></td>\r
- *    <td>List of LUFA USB Class driver source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_TEMPERATURE</tt></td>\r
- *    <td>List of LUFA temperature sensor driver source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_SERIAL</tt></td>\r
- *    <td>List of LUFA Serial U(S)ART driver source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_TWI</tt></td>\r
- *    <td>List of LUFA TWI driver source files.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td><tt>LUFA_SRC_PLATFORM</tt></td>\r
- *    <td>List of LUFA architecture specific platform management source files.</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros\r
- *\r
- *  <table>\r
- *   <tr>\r
- *    <td><i>None</i></td>\r
- *   </tr>\r
- *  </table>\r
- */\r
-\r
-/** \page Page_BuildTroubleshooting Troubleshooting Information\r
- *\r
- *  LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these\r
- *  features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different\r
- *  errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions.\r
- *\r
- *  <table>\r
- *    <tr>\r
- *    <th>Problem</th>\r
- *    <th>Resolution</th>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>relocation truncated to fit: R_AVR_13_PCREL against symbol <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
- *    <td>Try compiling with the setting <tt>LINKER_RELAXATIONS=N</tt> in your LUFA Build System 2.0 makefile, or remove the line <tt>-Wl,--relax</tt>\r
- *        from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>error: ld terminated with signal 11 [Segmentation fault]</tt></b>&quot; shown when compiling.</td>\r
- *    <td>Try compiling with the setting <tt>DEBUG_LEVEL=2</tt> in your LUFA Build System 2.0 makefile, or make sure you are using <tt>binutils</tt> version 2.22 or later.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>EMERGENCY ABORT: INFINITE RECURSION DETECTED</tt></b>&quot; shown when compiling.</td>\r
- *    <td>Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with\r
- *        GNU make or other variants of Make causing an infinitely recursive build.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Unsupported architecture &quot;<i>{X}</i>&quot;</tt></b>&quot; shown when compiling.</td>\r
- *    <td>Ensure your makefile's <tt>ARCH</tt> setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> value not set</tt></b>&quot; shown when compiling.</td>\r
- *    <td>The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA\r
- *        build system modules. Define the value in your project makefile and try again.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option cannot be blank</tt></b>&quot; shown when compiling.</td>\r
- *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration\r
- *        option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option must be Y or N</tt></b>&quot; shown when compiling.</td>\r
- *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No").\r
- *        This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Unknown input source file formats: <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
- *    <td>The nominated source files, specified in your project's makefile in the <tt>SRC</tt> configuration option, has an extension that the LUFA build system does not\r
- *        recognise. The file extensions are case sensitive, and must be one of the supported formats (<tt>*.c</tt>, <tt>*.cpp</tt> or <tt>*.S</tt>).</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Cannot build with OBJDIR parameter set - one or more object file name is not unique</tt></b>&quot; shown when compiling.</td>\r
- *    <td>When a project is built with a non-empty <tt>OBJDIR</tt> object directory name set, all input source files must have unique names, excluding extension and path.\r
- *        This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Source file does not exist: <i>{X}</i></tt></b>&quot; shown when compiling.</td>\r
- *    <td>The nominated input source file, specified in the user project's <tt>SRC</tt> parameter, could not be found. Ensure the source file exists and the absolute or\r
- *        relative path given in the user project makefile is correct and try again.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>Doxygen configuration file <i>{X}</i> does not exist</tt></b>&quot; shown when upgrading a Doxygen configuration file.</td>\r
- *    <td>The nominated Doxygen configuration file, specified in the user project's <tt>DOXYGEN_CONF</tt> parameter, could not be found. Ensure the configuration file exists\r
- *        and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration\r
- *        file.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>avr-gcc: error: unrecognized option '<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>\r
- *    <td>An unrecognised option was supplied to the compiler, usually in the <tt>C_FLAGS</tt>, <tt>CPP_FLAGS</tt>, <tt>ASM_FLAGS</tt> or <tt>CC_FLAGS</tt> configuration\r
- *        options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or\r
- *        upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>makefile:{X}: {Y}.mk: No such file or directory</tt></b>&quot; shown when make is invoked.</td>\r
- *    <td>The path to the nominated makefile module was incorrect. This usually indicates that the makefile <tt>LUFA_PATH</tt> option is not set to a valid relative or\r
- *        absolute path to the LUFA library core.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>fatal error: LUFAConfig.h: No such file or directory</tt></b>&quot; shown when compiling.</td>\r
- *    <td>The <tt>USE_LUFA_CONFIG_HEADER</tt> compile time option was set in the user project makefile, but the user supplied <tt>LUFAConfig.h</tt> header could not be\r
- *        found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile <tt>CC_FLAGS</tt>\r
- *        parameter.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>ld.exe: section .apitable_trampolines loaded at <i>{X}</i> overlaps section .text</tt></b>&quot; shown when compiling a bootloader.</td>\r
- *    <td>The bootloader is compiling too large for the given <tt>FLASH_SIZE_KB</tt> and <tt>BOOT_SECTION_SIZE_KB</tt> parameters set in the bootloader makefile. This\r
- *        usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the\r
- *        compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>unknown MCU '<i>{X}</i>' specified</tt></b>&quot; shown when compiling.</td>\r
- *    <td>The specified microcontroller device model name set in the user application's makefile as the <tt>MCU</tt> parameter is incorrect, or unsupported by the\r
- *        version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.</td>\r
- *   </tr>\r
- *   <tr>\r
- *    <td>Error &quot;<b><tt>undefined reference to `<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>\r
- *    <td>This is usually caused by a missing source file in the user application's <tt>SRC</tt> configuration parameter. If the indicated symbol is one from the LUFA\r
- *        library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).</td>\r
- *   </tr>\r
- *  </table>\r
- *\r
- *  For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp.\r
- */\r
+/** \file
+ *
+ *  This file contains special DoxyGen information for the generation of the main page and other special
+ *  documentation pages. It is not a project source file.
+ */
+
+/** \page Page_BuildSystem The LUFA Build System
+ *
+ *  \section Sec_BuildSystem_Overview Overview of the LUFA Build System
+ *  The LUFA build system is an attempt at making a set of re-usable, modular build make files which
+ *  can be referenced in a LUFA powered project, to minimize the amount of code required in an
+ *  application makefile. The system is written in GNU Make, and each module is independent of
+ *  one-another.
+ *
+ *  For details on the prerequisites needed for Linux and Windows machines to be able to use the LUFA
+ *  build system, see \ref Sec_CompilingApps_Prerequisites.
+ *
+ *  To use a LUFA build system module, simply add an include to your project makefile. All user projects
+ *  should at a minimum include \ref Page_BuildModule_CORE for base functionality:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_core.mk
+ *  \endcode
+ *
+ *  Once included in your project makefile, the associated build module targets will be added to your
+ *  project's build makefile targets automatically. To call a build target, run <tt>make {TARGET_NAME}</tt>
+ *  from the command line, substituting in the appropriate target name.
+ *
+ *  \see \ref Sec_ConfiguringApps_AppMakefileParams for a copy of the sample LUFA project makefile.
+ *
+ *  Each build module may have one or more mandatory parameters (GNU Make variables) which <i>must</i>
+ *  be supplied in the project makefile for the module to work, and one or more optional parameters which
+ *  may be defined and which will assume a sensible default if not.
+ *
+ *  \section SSec_BuildSystem_Modules Available Modules
+ *
+ *  The following modules are included in this LUFA release:
+ *
+ *  \li \subpage Page_BuildModule_ATPROGRAM - Device Programming
+ *  \li \subpage Page_BuildModule_AVRDUDE - Device Programming
+ *  \li \subpage Page_BuildModule_BUILD - Compiling/Assembling/Linking
+ *  \li \subpage Page_BuildModule_CORE - Core Build System Functions
+ *  \li \subpage Page_BuildModule_CPPCHECK - Static Code Analysis
+ *  \li \subpage Page_BuildModule_DFU - Device Programming
+ *  \li \subpage Page_BuildModule_DOXYGEN - Automated Source Code Documentation
+ *  \li \subpage Page_BuildModule_HID - Device Programming
+ *  \li \subpage Page_BuildModule_SOURCES - LUFA Module Source Code Variables
+ *
+ *  If you have problems building using the LUFA build system, see \subpage Page_BuildTroubleshooting for resolution steps.
+ */
+
+ /** \page Page_BuildModule_BUILD The BUILD build module
+ *
+ *  The BUILD LUFA build system module, providing targets for the compilation,
+ *  assembling and linking of an application from source code into binary files
+ *  suitable for programming into a target device, using the GCC compiler.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_build.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_BUILD_Requirements Requirements
+ *  This module requires the the architecture appropriate binaries of the GCC compiler are available in your
+ *  system's <b>PATH</b> variable. The GCC compiler and associated toolchain is distributed in Atmel AVR Studio
+ *  5.x and Atmel Studio 6.x installation directories, as well as in many third party distribution packages.
+ *
+ *  \section SSec_BuildModule_BUILD_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>size</tt></td>
+ *    <td>Display size of the compiled application FLASH and SRAM segments.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>symbol-sizes</tt></td>
+ *    <td>Display a size-sorted list of symbols from the compiled application, in decimal bytes.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>lib</tt></td>
+ *    <td>Build and archive all source files into a library A binary file.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>all</tt></td>
+ *    <td>Build and link the application into ELF debug and HEX binary files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>elf</tt></td>
+ *    <td>Build and link the application into an ELF debug file.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>bin</tt></td>
+ *    <td>Build and link the application and produce a BIN binary file.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>hex</tt></td>
+ *    <td>Build and link the application and produce HEX and EEP binary files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>lss</tt></td>
+ *    <td>Build and link the application and produce a LSS source code/assembly code mixed listing file.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>clean</tt></td>
+ *    <td>Remove all intermediary files and binary output files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>mostlyclean</tt></td>
+ *    <td>Remove all intermediary files but preserve any binary output files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt><i>&lt;filename&gt;</i>.s</tt></td>
+ *    <td>Create an assembly listing of a given input C/C++ source file.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_BUILD_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>TARGET</tt></td>
+ *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>ARCH</tt></td>
+ *    <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>MCU</tt></td>
+ *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>SRC</tt></td>
+ *    <td>List of relative or absolute paths to the application C (.c), C++ (.cpp) and Assembly (.S) source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>F_USB</tt></td>
+ *    <td>Speed in Hz of the input clock frequency to the target's USB controller.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_PATH</tt></td>
+ *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_BUILD_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>BOARD</tt></td>
+ *    <td>LUFA board hardware drivers to use (see \ref Page_DeviceSupport).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>OPTIMIZATION</tt></td>
+ *    <td>Optimization level to use when compiling source files (see GCC manual).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>C_STANDARD</tt></td>
+ *    <td>Version of the C standard to apply when compiling C++ source files (see GCC manual).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPP_STANDARD</tt></td>
+ *    <td>Version of the C++ standard to apply when compiling C++ source files (see GCC manual).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>DEBUG_FORMAT</tt></td>
+ *    <td>Format of the debug information to embed in the generated object files (see GCC manual).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>DEBUG_LEVEL</tt></td>
+ *    <td>Level of the debugging information to embed in the generated object files (see GCC manual).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>F_CPU</tt></td>
+ *    <td>Speed of the processor CPU clock, in Hz.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>C_FLAGS</tt></td>
+ *    <td>Flags to pass to the C compiler only, after the automatically generated flags.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPP_FLAGS</tt></td>
+ *    <td>Flags to pass to the C++ compiler only, after the automatically generated flags.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>ASM_FLAGS</tt></td>
+ *    <td>Flags to pass to the assembler only, after the automatically generated flags.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CC_FLAGS</tt></td>
+ *    <td>Common flags to pass to the C/C++ compiler and assembler, after the automatically generated flags.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>COMPILER_PATH</tt></td>
+ *    <td>Directory where the C/C++ toolchain is located, if not available in the system <tt>PATH</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LD_FLAGS</tt></td>
+ *    <td>Flags to pass to the linker, after the automatically generated flags.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LINKER_RELAXATIONS</tt></td>
+ *    <td>Enables or disables linker relaxations when linking the application binary. This can reduce the total size
+ *        of the application by replacing full \c CALL instructions with smaller \c RCALL instructions where possible.
+ *        \note On some unpatched versions of binutils, this can cause link failures in some circumstances. If you
+ *              receive a link error <tt>relocation truncated to fit: R_AVR_13_PCREL</tt>, disable this setting.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>OBJDIR</tt></td>
+ *    <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.
+ *        \note When this option is enabled, all source filenames <b>must</b> be unique.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>OBJECT_FILES</tt></td>
+ *    <td>List of additional object files that should be linked into the resulting binary.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_BUILD_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_BUILD_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+/** \page Page_BuildModule_CORE The CORE build module
+ *
+ *  The core LUFA build system module, providing common build system help and information targets.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_core.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_CORE_Requirements Requirements
+ *  This module has no requirements outside a standard *nix shell like environment; the <tt>sh</tt>
+ *  shell, GNU <tt>make</tt> and *nix CoreUtils (<tt>echo</tt>, <tt>printf</tt>, etc.).
+ *
+ *  \section SSec_BuildModule_CORE_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>help</tt></td>
+ *    <td>Display build system help and configuration information.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_targets</tt></td>
+ *    <td>List all available build targets from the build system.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_modules</tt></td>
+ *    <td>List all available build modules from the build system.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_mandatory</tt></td>
+ *    <td>List all mandatory parameters required by the included modules.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_optional</tt></td>
+ *    <td>List all optional parameters required by the included modules.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_provided</tt></td>
+ *    <td>List all variables provided by the included modules.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>list_macros</tt></td>
+ *    <td>List all macros provided by the included modules.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CORE_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CORE_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CORE_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CORE_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+/** \page Page_BuildModule_ATPROGRAM The ATPROGRAM build module
+ *
+ *  The ATPROGRAM programming utility LUFA build system module, providing targets to reprogram an
+ *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_atprogram.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_Requirements Requirements
+ *  This module requires the <tt>atprogram.exe</tt> utility to be available in your system's <b>PATH</b>
+ *  variable. The <tt>atprogram.exe</tt> utility is distributed in Atmel AVR Studio 5.x and Atmel Studio 6.x
+ *  inside the application install folder's "\atbackend" subdirectory.
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>atprogram</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>atprogram-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>MCU</tt></td>
+ *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>TARGET</tt></td>
+ *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>ATPROGRAM_PROGRAMMER</tt></td>
+ *    <td>Name of the Atmel programmer or debugger tool to communicate with (e.g. <tt>jtagice3</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>ATPROGRAM_INTERFACE</tt></td>
+ *    <td>Name of the programming interface to use when programming the target (e.g. <tt>spi</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>ATPROGRAM_PORT</tt></td>
+ *    <td>Name of the communication port to use when when programming with a serially connected tool (e.g. <tt>COM2</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_ATPROGRAM_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+/** \page Page_BuildModule_AVRDUDE The AVRDUDE build module
+ *
+ *  The AVRDUDE programming utility LUFA build system module, providing targets to reprogram an
+ *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_avrdude.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_AVRDUDE_Requirements Requirements
+ *  This module requires the <tt>avrdude</tt> utility to be available in your system's <b>PATH</b>
+ *  variable. The <tt>avrdude</tt> utility is distributed in the old WinAVR project releases for
+ *  Windows (<a>http://winavr.sourceforge.net</a>) or can be installed on *nix systems via the project's
+ *  source code (<a>https://savannah.nongnu.org/projects/avrdude</a>) or through the package manager.
+ *
+ *  \section SSec_BuildModule_AVRDUDE_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>avrdude</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>avrdude-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_AVRDUDE_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>MCU</tt></td>
+ *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>TARGET</tt></td>
+ *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_AVRDUDE_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>AVRDUDE_PROGRAMMER</tt></td>
+ *    <td>Name of the programmer or debugger tool to communicate with (e.g. <tt>jtagicemkii</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>AVRDUDE_PORT</tt></td>
+ *    <td>Name of the communication port to use when when programming with the connected tool (e.g. <tt>COM2</tt>, <tt>/dev/ttyUSB0</tt> or <tt>usb</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>AVRDUDE_FLAGS</tt></td>
+ *    <td>Additional flags to pass to avrdude when programming, applied after the automatically generated flags.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_AVRDUDE_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_AVRDUDE_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+ /** \page Page_BuildModule_CPPCHECK The CPPCHECK build module
+ *
+ *  The CPPCHECK programming utility LUFA build system module, providing targets to statically
+ *  analyze C and C++ source code for errors and performance/style issues.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_cppcheck.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_CPPCHECK_Requirements Requirements
+ *  This module requires the <tt>cppcheck</tt> utility to be available in your system's <b>PATH</b>
+ *  variable. The <tt>cppcheck</tt> utility is distributed through the project's home page
+ *  (<a>http://cppcheck.sourceforge.net</a>) for Windows, and can be installed on *nix systems via
+ *  the project's source code or through the package manager.
+ *
+ *  \section SSec_BuildModule_CPPCHECK_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>cppcheck</tt></td>
+ *    <td>Statically analyze the project source code for issues.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>cppcheck-config</tt></td>
+ *    <td>Check the <tt>cppcheck</tt> configuration - scan source code and warn about missing header files and other issues.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CPPCHECK_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>SRC</tt></td>
+ *    <td>List of source files to statically analyze.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CPPCHECK_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>CPPCHECK_INCLUDES</tt></td>
+ *    <td>Path of extra directories to check when attemting to resolve C/C++ header file includes.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_EXCLUDES</tt></td>
+ *    <td>Paths or path fragments to exclude when analyzing.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_MSG_TEMPLATE</tt></td>
+ *    <td>Output message template to use when printing errors, warnings and information (see <tt>cppcheck</tt> documentation).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_ENABLE</tt></td>
+ *    <td>Analysis rule categories to enable (see <tt>cppcheck</tt> documentation).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_SUPPRESS</tt></td>
+ *    <td>Specific analysis rules to suppress (see <tt>cppcheck</tt> documentation).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_FAIL_ON_WARNING</tt></td>
+ *    <td>Set to <b>Y</b> to fail the analysis job with an error exit code if warnings are found, <b>N</b> to continue without failing.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_QUIET</tt></td>
+ *    <td>Set to <b>Y</b> to suppress all output except warnings and errors, <b>N</b> to show verbose output information.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>CPPCHECK_FLAGS</tt></td>
+ *    <td>Extra flags to pass to <tt>cppcheck</tt>, after the automatically generated flags.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CPPCHECK_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_CPPCHECK_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+ /** \page Page_BuildModule_DFU The DFU build module
+ *
+ *  The DFU programming utility LUFA build system module, providing targets to reprogram an
+ *  Atmel processor FLASH and EEPROM memories with a project's compiled binary output files.
+ *  This module requires a DFU class bootloader to be running in the target, compatible with
+ *  the DFU bootloader protocol as published by Atmel.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_dfu.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_DFU_Requirements Requirements
+ *  This module requires either the <tt>batchisp</tt> utility from Atmel's FLIP utility, or the open
+ *  source <tt>dfu-programmer</tt> utility (<a>http://dfu-programmer.sourceforge.net/</a>) to be
+ *  available in your system's <b>PATH</b> variable. On *nix systems the <tt>dfu-programmer</tt> utility
+ *  can be installed via the project's source code or through the package manager.
+ *
+ *  \section SSec_BuildModule_DFU_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>dfu</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data using <tt>dfu-programmer</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>dfu-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>dfu-programmer</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>flip</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data using <tt>batchisp</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>flip-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>batchisp</tt>.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DFU_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>MCU</tt></td>
+ *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>TARGET</tt></td>
+ *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DFU_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DFU_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DFU_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+ /** \page Page_BuildModule_DOXYGEN The DOXYGEN build module
+ *
+ *  The DOXYGEN code documentation utility LUFA build system module, providing targets to generate
+ *  project HTML and other format documentation from a set of source files that include special
+ *  Doxygen comments.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_doxygen.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_DOXYGEN_Requirements Requirements
+ *  This module requires the <tt>doxygen</tt> utility from the Doxygen website
+ *  (<a>http://www.doxygen.org/</a>) to be available in your system's <b>PATH</b> variable. On *nix
+ *  systems the <tt>doxygen</tt> utility can be installed via the project's source code or through
+ *  the package manager.
+ *
+ *  \section SSec_BuildModule_DOXYGEN_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>doxygen</tt></td>
+ *    <td>Generate project documentation.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>doxygen_create</tt></td>
+ *    <td>Create a new Doxygen configuration file using the latest template.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>doxygen_upgrade</tt></td>
+ *    <td>Upgrade an existing Doxygen configuration file to the latest template</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DOXYGEN_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>LUFA_PATH</tt></td>
+ *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DOXYGEN_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>DOXYGEN_CONF</tt></td>
+ *    <td>Name and path of the base Doxygen configuration file for the project.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>DOXYGEN_FAIL_ON_WARNING</tt></td>
+ *    <td>Set to <b>Y</b> to fail the generation with an error exit code if warnings are found other than unsupported configuration parameters, <b>N</b> to continue without failing.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>DOXYGEN_OVERRIDE_PARAMS</tt></td>
+ *    <td>Extra Doxygen configuration parameters to apply, overriding the corresponding config entry in the project's configuration file (e.g. <tt>QUIET=YES</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DOXYGEN_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_DOXYGEN_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+ /** \page Page_BuildModule_HID The HID build module
+ *
+ *  The HID programming utility LUFA build system module, providing targets to reprogram an
+ *  Atmel processor's FLASH memory with a project's compiled binary output file. This module
+ *  requires a HID class bootloader to be running in the target, using a protocol compatible
+ *  with the PJRC "HalfKay" protocol (<a>http://www.pjrc.com/teensy/halfkay_protocol.html</a>).
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_hid.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_HID_Requirements Requirements
+ *  This module requires either the <tt>hid_bootloader_cli</tt> utility from the included LUFA HID
+ *  class bootloader API subdirectory, or the <tt>teensy_loader_cli</tt> utility from PJRC
+ *  (<a>http://www.pjrc.com/teensy/loader_cli.html</a>) to be available in your system's <b>PATH</b>
+ *  variable.
+ *
+ *  \section SSec_BuildModule_HID_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>hid</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data using <tt>hid_bootloader_cli</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>hid-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>hid_bootloader_cli</tt> and
+ *        a temporary AVR application programmed into the target's FLASH.
+ *        \note This will erase the currently loaded application in the target.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>teensy</tt></td>
+ *    <td>Program the device FLASH memory with the application's executable data using <tt>teensy_loader_cli</tt>.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>teensy-ee</tt></td>
+ *    <td>Program the device EEPROM memory with the application's EEPROM data using <tt>teensy_loader_cli</tt> and
+ *        a temporary AVR application programmed into the target's FLASH.
+ *        \note This will erase the currently loaded application in the target.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_HID_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>MCU</tt></td>
+ *    <td>Name of the Atmel processor model (e.g. <tt>at90usb1287</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>TARGET</tt></td>
+ *    <td>Name of the application output file prefix (e.g. <tt>TestApplication</tt>).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_HID_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_HID_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_HID_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+ /** \page Page_BuildModule_SOURCES The SOURCES build module
+ *
+ *  The SOURCES LUFA build system module, providing variables listing the various LUFA source files
+ *  required to be build by a project for a given LUFA module. This module gives a way to reference
+ *  LUFA source files symbolically, so that changes to the library structure do not break the library
+ *  makefile.
+ *
+ *  To use this module in your application makefile, add the following code:
+ *  \code
+ *  include $(LUFA_PATH)/Build/lufa_sources.mk
+ *  \endcode
+ *
+ *  \section SSec_BuildModule_SOURCES_Requirements Requirements
+ *  None.
+ *
+ *  \section SSec_BuildModule_SOURCES_Targets Targets
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_SOURCES_MandatoryParams Mandatory Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>LUFA_PATH</tt></td>
+ *    <td>Path to the LUFA library core, either relative or absolute (e.g. <tt>../LUFA-000000/LUFA/</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>ARCH</tt></td>
+ *    <td>Architecture of the target processor (see \ref Page_DeviceSupport).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_SOURCES_OptionalParams Optional Parameters
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_SOURCES_ProvidedVariables Module Provided Variables
+ *
+ *  <table>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_USB</tt></td>
+ *    <td>List of LUFA USB driver source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_USBCLASS</tt></td>
+ *    <td>List of LUFA USB Class driver source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_TEMPERATURE</tt></td>
+ *    <td>List of LUFA temperature sensor driver source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_SERIAL</tt></td>
+ *    <td>List of LUFA Serial U(S)ART driver source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_TWI</tt></td>
+ *    <td>List of LUFA TWI driver source files.</td>
+ *   </tr>
+ *   <tr>
+ *    <td><tt>LUFA_SRC_PLATFORM</tt></td>
+ *    <td>List of LUFA architecture specific platform management source files.</td>
+ *   </tr>
+ *  </table>
+ *
+ *  \section SSec_BuildModule_SOURCES_ProvidedMacros Module Provided Macros
+ *
+ *  <table>
+ *   <tr>
+ *    <td><i>None</i></td>
+ *   </tr>
+ *  </table>
+ */
+
+/** \page Page_BuildTroubleshooting Troubleshooting Information
+ *
+ *  LUFA uses a lot of advanced features of the AVR-GCC compiler, linker, and surrounding binaries. This can sometimes lead to problems compiling applications if one of these
+ *  features is buggy in the version of the tools used in a build environment. Missing utilities and incorrectly set makefile configuration options can also result in different
+ *  errors being produced when compilation or other operations are attempted. The table below lists a set of commonly encountered errors and their resolutions.
+ *
+ *  <table>
+ *    <tr>
+ *    <th>Problem</th>
+ *    <th>Resolution</th>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>relocation truncated to fit: R_AVR_13_PCREL against symbol <i>{X}</i></tt></b>&quot; shown when compiling.</td>
+ *    <td>Try compiling with the setting <tt>LINKER_RELAXATIONS=N</tt> in your LUFA Build System 2.0 makefile, or remove the line <tt>-Wl,--relax</tt>
+ *        from other makefiles. Alternatively, make sure you have the latest version of the Atmel Toolchain installed for your system.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>error: ld terminated with signal 11 [Segmentation fault]</tt></b>&quot; shown when compiling.</td>
+ *    <td>Try compiling with the setting <tt>DEBUG_LEVEL=2</tt> in your LUFA Build System 2.0 makefile, or make sure you are using <tt>binutils</tt> version 2.22 or later.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>EMERGENCY ABORT: INFINITE RECURSION DETECTED</tt></b>&quot; shown when compiling.</td>
+ *    <td>Make sure you are using an up to date version of GNU Make when compiling. This error is a safety system added to the mid-level makefiles, to prevent an issue with
+ *        GNU make or other variants of Make causing an infinitely recursive build.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Unsupported architecture &quot;<i>{X}</i>&quot;</tt></b>&quot; shown when compiling.</td>
+ *    <td>Ensure your makefile's <tt>ARCH</tt> setting is set to one of the architecture names (case-sensitive) supported by the version of LUFA you are compiling against.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> value not set</tt></b>&quot; shown when compiling.</td>
+ *    <td>The specified Makefile value was not configured in your project's makefile or on the command line, and the nominated setting is required by one or more LUFA
+ *        build system modules. Define the value in your project makefile and try again.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option cannot be blank</tt></b>&quot; shown when compiling.</td>
+ *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to an empty value. For the nominated configuration
+ *        option, an empty value is not allowed. Define the nominated setting to a correct non-blank value and try again.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Makefile <i>{X}</i> option must be Y or N</tt></b>&quot; shown when compiling.</td>
+ *    <td>The specified Makefile value was configured in your project's makefile or on the command line, but was set to a value other than a Y (for "Yes") or "N" (for "No").
+ *        This configuration option is required to be one of the aforementioned boolean values, and other values are invalid. Set this option to either Y or N and try again.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Unknown input source file formats: <i>{X}</i></tt></b>&quot; shown when compiling.</td>
+ *    <td>The nominated source files, specified in your project's makefile in the <tt>SRC</tt> configuration option, has an extension that the LUFA build system does not
+ *        recognise. The file extensions are case sensitive, and must be one of the supported formats (<tt>*.c</tt>, <tt>*.cpp</tt> or <tt>*.S</tt>).</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Cannot build with OBJDIR parameter set - one or more object file name is not unique</tt></b>&quot; shown when compiling.</td>
+ *    <td>When a project is built with a non-empty <tt>OBJDIR</tt> object directory name set, all input source files must have unique names, excluding extension and path.
+ *        This means that input files that are named identically and differ only by their path or extension are invalid when this mode is used.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Source file does not exist: <i>{X}</i></tt></b>&quot; shown when compiling.</td>
+ *    <td>The nominated input source file, specified in the user project's <tt>SRC</tt> parameter, could not be found. Ensure the source file exists and the absolute or
+ *        relative path given in the user project makefile is correct and try again.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>Doxygen configuration file <i>{X}</i> does not exist</tt></b>&quot; shown when upgrading a Doxygen configuration file.</td>
+ *    <td>The nominated Doxygen configuration file, specified in the user project's <tt>DOXYGEN_CONF</tt> parameter, could not be found. Ensure the configuration file exists
+ *        and the absolute or relative path given in the user project makefile is correct and try again, or run the appropriate makefile target to generate a new configuration
+ *        file.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>avr-gcc: error: unrecognized option '<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>
+ *    <td>An unrecognised option was supplied to the compiler, usually in the <tt>C_FLAGS</tt>, <tt>CPP_FLAGS</tt>, <tt>ASM_FLAGS</tt> or <tt>CC_FLAGS</tt> configuration
+ *        options. The nominated compiler switch may be invalid, or unsupported by the version of AVR-GCC on the host system. Remove the unrecognised flag if invalid, or
+ *        upgrade to the latest AVR-GCC. If the option is a valid linker option, use the prefix "-Wl," to ensure it is passed to the linker correctly.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>makefile:{X}: {Y}.mk: No such file or directory</tt></b>&quot; shown when make is invoked.</td>
+ *    <td>The path to the nominated makefile module was incorrect. This usually indicates that the makefile <tt>LUFA_PATH</tt> option is not set to a valid relative or
+ *        absolute path to the LUFA library core.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>fatal error: LUFAConfig.h: No such file or directory</tt></b>&quot; shown when compiling.</td>
+ *    <td>The <tt>USE_LUFA_CONFIG_HEADER</tt> compile time option was set in the user project makefile, but the user supplied <tt>LUFAConfig.h</tt> header could not be
+ *        found. Ensure that the directory that contains this configuration file is correctly passed to the compiler via the -I switch in the makefile <tt>CC_FLAGS</tt>
+ *        parameter.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>ld.exe: section .apitable_trampolines loaded at <i>{X}</i> overlaps section .text</tt></b>&quot; shown when compiling a bootloader.</td>
+ *    <td>The bootloader is compiling too large for the given <tt>FLASH_SIZE_KB</tt> and <tt>BOOT_SECTION_SIZE_KB</tt> parameters set in the bootloader makefile. This
+ *        usually indicates that these values are incorrect for the specified device the bootloader is targeting. If these values are correct, a newer version of the
+ *        compiler may need to be used to ensure that the bootloader is built within the section size constraints of the target device.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>unknown MCU '<i>{X}</i>' specified</tt></b>&quot; shown when compiling.</td>
+ *    <td>The specified microcontroller device model name set in the user application's makefile as the <tt>MCU</tt> parameter is incorrect, or unsupported by the
+ *        version of the compiler being used. Make sure the model name is correct, or upgrade to the latest Atmel Toolchain to obtain newer device support.</td>
+ *   </tr>
+ *   <tr>
+ *    <td>Error &quot;<b><tt>undefined reference to `<i>{X}</i>'</tt></b>&quot; shown when compiling.</td>
+ *    <td>This is usually caused by a missing source file in the user application's <tt>SRC</tt> configuration parameter. If the indicated symbol is one from the LUFA
+ *        library, you may be missing a LUFA source makefile module (see \ref Page_BuildModule_SOURCES).</td>
+ *   </tr>
+ *  </table>
+ *
+ *  For troubleshooting other errors you encounter, please see \ref Sec_ProjectHelp.
+ */