]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
authorcbbrowne <cbbrowne@cbbrowne.tor.int-afilias.info>
Mon, 29 Aug 2016 16:32:03 +0000 (12:32 -0400)
committercbbrowne <cbbrowne@cbbrowne.tor.int-afilias.info>
Mon, 29 Aug 2016 16:32:03 +0000 (12:32 -0400)
209 files changed:
.gitattributes
.gitmodules
.travis.yml
Makefile
build_keyboard.mk [new file with mode: 0644]
build_test.mk [new file with mode: 0644]
common.mk [new file with mode: 0644]
keyboards/alps64/Makefile
keyboards/alps64/rules.mk [new file with mode: 0644]
keyboards/amj60/Makefile
keyboards/amj60/rules.mk [new file with mode: 0644]
keyboards/arrow_pad/Makefile
keyboards/arrow_pad/readme.md
keyboards/arrow_pad/rules.mk [new file with mode: 0644]
keyboards/atomic/Makefile
keyboards/atomic/readme.md
keyboards/atomic/rules.mk [new file with mode: 0644]
keyboards/atreus/Makefile
keyboards/atreus/readme.md
keyboards/atreus/rules.mk [new file with mode: 0644]
keyboards/bantam44/Makefile
keyboards/bantam44/readme.md
keyboards/bantam44/rules.mk [new file with mode: 0644]
keyboards/chibios_test/Makefile
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/rules.mk [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/Makefile
keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
keyboards/chibios_test/stm32_f072_onekey/rules.mk [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/Makefile
keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
keyboards/chibios_test/stm32_f103_onekey/rules.mk [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/Makefile
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/chibios_test/teensy_lc_onekey/rules.mk [new file with mode: 0644]
keyboards/clueboard/Makefile
keyboards/clueboard/readme.md
keyboards/clueboard/rev1/Makefile
keyboards/clueboard/rev1/rules.mk [new file with mode: 0644]
keyboards/clueboard/rev2/Makefile
keyboards/clueboard/rev2/rules.mk [new file with mode: 0644]
keyboards/clueboard/rules.mk [new file with mode: 0644]
keyboards/cluecard/Makefile
keyboards/cluecard/readme.md
keyboards/cluecard/rules.mk [new file with mode: 0644]
keyboards/cluepad/Makefile
keyboards/cluepad/rules.mk [new file with mode: 0644]
keyboards/ergodox/Makefile
keyboards/ergodox/ez/Makefile
keyboards/ergodox/ez/rules.mk [new file with mode: 0644]
keyboards/ergodox/infinity/Makefile
keyboards/ergodox/infinity/rules.mk [new file with mode: 0644]
keyboards/ergodox/readme.md
keyboards/ergodox/rules.mk [new file with mode: 0644]
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/gh60/rules.mk [new file with mode: 0644]
keyboards/handwired/CMD60/Makefile
keyboards/handwired/CMD60/rules.mk [new file with mode: 0644]
keyboards/handwired/Makefile
keyboards/handwired/fivethirteen/Makefile
keyboards/handwired/fivethirteen/rules.mk [new file with mode: 0644]
keyboards/handwired/minorca/Makefile
keyboards/handwired/minorca/rules.mk [new file with mode: 0644]
keyboards/handwired/onekey/Makefile
keyboards/handwired/onekey/rules.mk [new file with mode: 0644]
keyboards/handwired/rules.mk [new file with mode: 0644]
keyboards/handwired/traveller/Makefile
keyboards/handwired/traveller/rules.mk [new file with mode: 0644]
keyboards/hhkb/Makefile
keyboards/hhkb/readme.md
keyboards/hhkb/rules.mk [new file with mode: 0644]
keyboards/infinity60/MEMO.txt [new file with mode: 0644]
keyboards/infinity60/Makefile [new file with mode: 0644]
keyboards/infinity60/bootloader_defs.h [new file with mode: 0644]
keyboards/infinity60/chconf.h [new file with mode: 0644]
keyboards/infinity60/config.h [new file with mode: 0644]
keyboards/infinity60/halconf.h [new file with mode: 0644]
keyboards/infinity60/infinity60.c [new file with mode: 0644]
keyboards/infinity60/infinity60.h [new file with mode: 0644]
keyboards/infinity60/keymaps/default/keymap.c [new file with mode: 0644]
keyboards/infinity60/keymaps/depariel/keymap.c [new file with mode: 0755]
keyboards/infinity60/keymaps/hasu/keymap.c [new file with mode: 0644]
keyboards/infinity60/led.c [new file with mode: 0644]
keyboards/infinity60/matrix.c [new file with mode: 0644]
keyboards/infinity60/mcuconf.h [new file with mode: 0644]
keyboards/infinity60/readme.md [new file with mode: 0644]
keyboards/infinity60/rules.mk [new file with mode: 0644]
keyboards/infinity_chibios/MEMO.txt [deleted file]
keyboards/infinity_chibios/Makefile [deleted file]
keyboards/infinity_chibios/bootloader_defs.h [deleted file]
keyboards/infinity_chibios/chconf.h [deleted file]
keyboards/infinity_chibios/config.h [deleted file]
keyboards/infinity_chibios/halconf.h [deleted file]
keyboards/infinity_chibios/infinity_chibios.c [deleted file]
keyboards/infinity_chibios/infinity_chibios.h [deleted file]
keyboards/infinity_chibios/keymaps/default/keymap.c [deleted file]
keyboards/infinity_chibios/keymaps/depariel/keymap.c [deleted file]
keyboards/infinity_chibios/keymaps/hasu/keymap.c [deleted file]
keyboards/infinity_chibios/led.c [deleted file]
keyboards/infinity_chibios/matrix.c [deleted file]
keyboards/infinity_chibios/mcuconf.h [deleted file]
keyboards/jd45/Makefile
keyboards/jd45/rules.mk [new file with mode: 0644]
keyboards/kc60/Makefile
keyboards/kc60/keymaps/workman-dead/README.md [deleted file]
keyboards/kc60/keymaps/workman-dead/keymap.c
keyboards/kc60/keymaps/workman-dead/readme.md [new file with mode: 0644]
keyboards/kc60/readme.md
keyboards/kc60/rules.mk [new file with mode: 0644]
keyboards/kinesis/Makefile
keyboards/kinesis/readme.md
keyboards/kinesis/rules.mk [new file with mode: 0644]
keyboards/kitten_paw/Makefile
keyboards/kitten_paw/rules.mk [new file with mode: 0644]
keyboards/lets_split/Makefile
keyboards/lets_split/rules.mk [new file with mode: 0644]
keyboards/phantom/Makefile
keyboards/phantom/rules.mk [new file with mode: 0644]
keyboards/planck/Makefile
keyboards/planck/readme.md
keyboards/planck/rev3/Makefile
keyboards/planck/rev3/rules.mk [new file with mode: 0644]
keyboards/planck/rev4/Makefile
keyboards/planck/rev4/rules.mk [new file with mode: 0644]
keyboards/planck/rules.mk [new file with mode: 0644]
keyboards/preonic/Makefile
keyboards/preonic/readme.md
keyboards/preonic/rules.mk [new file with mode: 0644]
keyboards/readme.md
keyboards/retro_refit/Makefile
keyboards/retro_refit/readme.md
keyboards/retro_refit/rules.mk [new file with mode: 0644]
keyboards/s60-x/Makefile
keyboards/s60-x/readme.md
keyboards/s60-x/rules.mk [new file with mode: 0644]
keyboards/satan/Makefile
keyboards/satan/rules.mk [new file with mode: 0644]
keyboards/sixkeyboard/Makefile
keyboards/sixkeyboard/rules.mk [new file with mode: 0644]
keyboards/tv44/Makefile
keyboards/tv44/keymaps/jeebak/Makefile [new file with mode: 0644]
keyboards/tv44/keymaps/jeebak/config.h [new file with mode: 0644]
keyboards/tv44/keymaps/jeebak/keymap.c [new file with mode: 0644]
keyboards/tv44/keymaps/jeebak/readme.md [new file with mode: 0644]
keyboards/tv44/readme.md
keyboards/tv44/rules.mk [new file with mode: 0644]
keyboards/vision_division/Makefile
keyboards/vision_division/rules.mk [new file with mode: 0644]
lib/googletest [new submodule]
message.mk [new file with mode: 0644]
quantum/serial_link/protocol/byte_stuffer.c
quantum/serial_link/protocol/byte_stuffer.h
quantum/serial_link/protocol/transport.c
quantum/serial_link/protocol/transport.h
quantum/serial_link/tests/byte_stuffer_tests.c [deleted file]
quantum/serial_link/tests/byte_stuffer_tests.cpp [new file with mode: 0644]
quantum/serial_link/tests/frame_router_tests.c [deleted file]
quantum/serial_link/tests/frame_router_tests.cpp [new file with mode: 0644]
quantum/serial_link/tests/frame_validator_tests.c [deleted file]
quantum/serial_link/tests/frame_validator_tests.cpp [new file with mode: 0644]
quantum/serial_link/tests/rules.mk [new file with mode: 0644]
quantum/serial_link/tests/testlist.mk [new file with mode: 0644]
quantum/serial_link/tests/transport_tests.c [deleted file]
quantum/serial_link/tests/transport_tests.cpp [new file with mode: 0644]
quantum/serial_link/tests/triple_buffered_object_tests.c [deleted file]
quantum/serial_link/tests/triple_buffered_object_tests.cpp [new file with mode: 0644]
quantum/template/Makefile
quantum/template/readme.md
quantum/template/rules.mk [new file with mode: 0644]
readme.md
testlist.mk [new file with mode: 0644]
tmk_core/chibios.mk
tmk_core/common.mk
tmk_core/common/avr/xprintf.S
tmk_core/common/avr/xprintf.h
tmk_core/common/command.c
tmk_core/native.mk [new file with mode: 0644]
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
tmk_core/rules.mk
util/install_dependencies.sh
util/travis_compiled_push.sh

index 8fd1fd7525a7f2209234a6ac03701e94e4255b7e..92dfc3c617709e2666e384a0c5945c84f0b569b1 100644 (file)
@@ -91,3 +91,4 @@ GRAPHICS
 
 # hex files
 *.hex binary
+*.eep binary
index 7e3c92d031214cecc061c1ca9efa238b30c535d3..12b7cb918f2a7b9ebe35d03cffc1fd2a0c61edec 100644 (file)
@@ -7,3 +7,6 @@
 [submodule "lib/ugfx"]
        path = lib/ugfx
        url = https://bitbucket.org/Tectu/ugfx
+[submodule "lib/googletest"]
+       path = lib/googletest
+       url = https://github.com/google/googletest
index 297cf19a686925e67f68f66da6feccf04a8b5ad7..e74744a967ef316ddff4bc66d6d6bd37d4e33c56 100644 (file)
@@ -9,8 +9,11 @@ branches:
 env:
   global:
   - secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
+  matrix:
+  - TARGET=all-keyboards AUTOGEN=true
+  - TARGET=test AUTOGEN=false
 script:
-- make all-keyboards AUTOGEN=true
+- make $TARGET AUTOGEN=$AUTOGEN
 addons:
   apt:
     packages:
@@ -21,4 +24,8 @@ addons:
     - gcc-arm-none-eabi
     - binutils-arm-none-eabi
     - libnewlib-arm-none-eabi
-after_success: bash util/travis_compiled_push.sh
+    - diffutils
+after_success: 
+  if [ "$AUTOGEN" == "true" ]; then
+    bash util/travis_compiled_push.sh;
+  fi
index 331badcf84fbb243b08c5e475f78638b5694f52e..0aaf585786cbe28bde3ee2ae9ef51c089928e0e7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,284 +2,518 @@ ifndef VERBOSE
 .SILENT:
 endif
 
-.DEFAULT_GOAL := all
-
-space := $(subst ,, )
-ESCAPED_ABS_PATH = $(subst $(space),_SPACE_,$(abspath $1))
-starting_makefile := $(call ESCAPED_ABS_PATH,$(firstword $(MAKEFILE_LIST)))
-mkfile_path := $(call ESCAPED_ABS_PATH,$(lastword $(MAKEFILE_LIST))))
-abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path)))
-
-ifneq (,$(findstring /keyboards/,$(starting_makefile)))
-       possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(abs_tmk_root)/keyboards/%,%,$(starting_makefile))))
-       ifneq (,$(findstring /keymaps/,$(possible_keyboard)))
-               KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard)))
-               KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard)))
-               ifneq (,$(findstring /,$(KEYBOARD_DIR)))
-                       # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
-                       # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
-                       tmk_root = ../../..
-               else
-                       tmk_root = ../../../..
-               endif
-       else
-               KEYMAP_DIR:=default
-               KEYBOARD_DIR:=$(possible_keyboard)
-               ifneq (,$(findstring /,$(KEYBOARD_DIR)))
-                       # SUBPROJECT_DIR:=$(lastword $(subst /, ,$(KEYBOARD_DIR)))
-                       # KEYBOARD_DIR:=$(firstword $(subst /, ,$(KEYBOARD_DIR)))
-                       tmk_root = ../../..
-               else
-                       tmk_root = ../..
-               endif
-       endif
-else
-       tmk_root = .
-endif
-# $(info $(KEYBOARD_DIR))
-# $(info $(KEYMAP_DIR))
-# $(info $(SUBPROJECT_DIR))
-
-# Directory common source filess exist
-TOP_DIR = $(tmk_root)
-TMK_DIR = tmk_core
-TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
-LIB_PATH = $(TOP_DIR)/lib
-
-QUANTUM_DIR = quantum
-QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
-
-
+# Never run this makefile in parallel, as it could screw things up
+# It won't affect the submakes, so you still get the speedup from specifying -jx
+.NOTPARALLEL:
+
+# Allow the silent with lower caps to work the same way as upper caps
+ifdef silent
+    SILENT = $(silent)
+endif
+
+ifdef SILENT
+    SUB_IS_SILENT := $(SILENT)
+endif
+
+# We need to make sure that silent is always turned off at the top level
+# Otherwise the [OK], [ERROR] and [WARN] messags won't be displayed correctly
+override SILENT := false
+
+ON_ERROR := error_occured=1
+
+STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
+ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
+ROOT_DIR := $(dir $(ROOT_MAKEFILE))
+ifeq ($(ROOT_DIR),)
+    ROOT_DIR := .
+endif
+ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE))
+ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE))
+ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE))
+ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE))
+STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
+TEST_DIR := $(ROOT_DIR)/.build/test
+
+MAKEFILE_INCLUDED=yes
+
+# Helper function to process the newt element of a space separated path 
+# It works a bit like the traditional functional head tail
+# so the CURRENT_PATH_ELEMENT will beome the new head
+# and the PATH_ELEMENTS are the rest that are still unprocessed
+define NEXT_PATH_ELEMENT
+    $$(eval CURRENT_PATH_ELEMENT := $$(firstword  $$(PATH_ELEMENTS)))
+    $$(eval PATH_ELEMENTS := $$(wordlist  2,9999,$$(PATH_ELEMENTS)))
+endef
+
+# We change the / to spaces so that we more easily can work with the elements 
+# separately
+PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
+# Initialize the path elements list for further processing
+$(eval $(call NEXT_PATH_ELEMENT))
+
+# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct 
+# variables depending on which directory you stand in.
+# It's really a very simple if else chain, if you squint enough, 
+# but the makefile syntax makes it very verbose. 
+# If we are in a subfolder of keyboards
+ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
+    $(eval $(call NEXT_PATH_ELEMENT))
+    KEYBOARD := $(CURRENT_PATH_ELEMENT)
+    $(eval $(call NEXT_PATH_ELEMENT))
+    # If we are in a subfolder of keymaps, or in other words in a keymap
+    # folder
+    ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
+        $(eval $(call NEXT_PATH_ELEMENT))
+        KEYMAP := $(CURRENT_PATH_ELEMENT)
+     # else if we are not in the keyboard folder itself
+    else ifneq ($(CURRENT_PATH_ELEMENT),)
+        # the we can assume it's a subproject, as no other folders
+        # should have make files in them
+        SUBPROJECT := $(CURRENT_PATH_ELEMENT)
+        $(eval $(call NEXT_PATH_ELEMENT))
+        # if we are inside a keymap folder of a subproject
+        ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
+            $(eval $(call NEXT_PATH_ELEMENT))
+            KEYMAP := $(CURRENT_PATH_ELEMENT)
+        endif
+    endif
+endif
+
+# Only consider folders with makefiles, to prevent errors in case there are extra folders
+KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile)))
+
+#Compability with the old make variables, anything you specify directly on the command line
+# always overrides the detected folders
 ifdef keyboard
-       KEYBOARD ?= $(keyboard)
-endif
-ifdef KEYBOARD_DIR
-       KEYBOARD ?= $(KEYBOARD_DIR)
-endif
-ifndef KEYBOARD
-       KEYBOARD=planck
+    KEYBOARD := $(keyboard)
 endif
-
-MASTER ?= left
-ifdef master
-       MASTER = $(master)
-endif
-
-
-# converts things to keyboards/subproject
-ifneq (,$(findstring /,$(KEYBOARD)))
-       TEMP:=$(KEYBOARD)
-       KEYBOARD:=$(firstword $(subst /, ,$(TEMP)))
-       SUBPROJECT:=$(lastword $(subst /, ,$(TEMP)))
-endif
-
-KEYBOARD_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)
-
 ifdef sub
-       SUBPROJECT=$(sub)
+    SUBPROJECT := $(sub)
 endif
 ifdef subproject
-       SUBPROJECT=$(subproject)
-endif
-
-ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","")
-       KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c
-       ifneq ($(call ESCAPED_ABS_PATH,$(KEYBOARD_PATH)/Makefile),$(starting_makefile))
-               -include $(KEYBOARD_PATH)/Makefile
-       endif
-else 
-$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist)
-endif
-
-ifdef SUBPROJECT_DEFAULT
-       SUBPROJECT?=$(SUBPROJECT_DEFAULT)
-endif
-
-ifdef SUBPROJECT
-       SUBPROJECT_PATH = $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT)
-       ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","")
-               OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
-               SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c
-               ifneq ($(call ESCAPED_ABS_PATH,$(SUBPROJECT_PATH)/Makefile),$(starting_makefile))
-                       -include $(SUBPROJECT_PATH)/Makefile
-               endif
-       else 
-$(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
-       endif
+    SUBPROJECT := $(subproject)
 endif
-
 ifdef keymap
-       KEYMAP ?= $(keymap)
-endif
-ifdef KEYMAP_DIR
-       KEYMAP ?= $(KEYMAP_DIR)
-endif
-ifndef KEYMAP
-       KEYMAP = default
-endif
-KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
-ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","")
-       KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c
-       ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile))
-               -include $(KEYMAP_PATH)/Makefile
-       endif
-else 
-       ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/keymap.c)","")
-$(error "$(KEYMAP_PATH)/keymap.c" does not exist)
-       else
-               KEYMAP_PATH = $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
-               KEYMAP_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/keymap.c
-               ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile))
-                       -include $(KEYMAP_PATH)/Makefile
-               endif
-       endif
+    KEYMAP := $(keymap)
 endif
 
-ifdef SUBPROJECT
-       TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
-else
-       TARGET ?= $(KEYBOARD)_$(KEYMAP)
-endif
-
-BUILD_DIR = $(TOP_DIR)/.build
-
-# Object files directory
-#     To put object files in current directory, use a dot (.), do NOT make
-#     this an empty or blank macro!
-OBJDIR = $(BUILD_DIR)/obj_$(TARGET)
-
+# Uncomment these for debugging
+#$(info Keyboard: $(KEYBOARD))
+#$(info Keymap: $(KEYMAP))
+#$(info Subproject: $(SUBPROJECT))
+#$(info Keyboards: $(KEYBOARDS))
 
 
-ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
-       CONFIG_H = $(KEYMAP_PATH)/config.h
-else
-       CONFIG_H = $(KEYBOARD_PATH)/config.h
-       ifdef SUBPROJECT
-               ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","")
-                       CONFIG_H = $(SUBPROJECT_PATH)/config.h
-               endif
-       endif
-endif
-
-# # project specific files
-SRC += $(KEYBOARD_FILE) \
-       $(KEYMAP_FILE) \
-       $(QUANTUM_DIR)/quantum.c \
-       $(QUANTUM_DIR)/keymap_common.c \
-       $(QUANTUM_DIR)/keycode_config.c \
-       $(QUANTUM_DIR)/process_keycode/process_leader.c
-
-ifdef SUBPROJECT
-       SRC += $(SUBPROJECT_FILE)
-endif
-
-ifdef SUBPROJECT
-       SRC += $(SUBPROJECT_FILE)
-endif
-
-ifdef SUBPROJECT
-       SRC += $(SUBPROJECT_FILE)
-endif
-
-ifndef CUSTOM_MATRIX
-       SRC += $(QUANTUM_DIR)/matrix.c
-endif
-
-ifeq ($(strip $(MIDI_ENABLE)), yes)
-    OPT_DEFS += -DMIDI_ENABLE
-       SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
-endif
-
-ifeq ($(strip $(VIRTSER_ENABLE)), yes)
-    OPT_DEFS += -DVIRTSER_ENABLE
-endif
-
-ifeq ($(strip $(AUDIO_ENABLE)), yes)
-    OPT_DEFS += -DAUDIO_ENABLE
-       SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
-       SRC += $(QUANTUM_DIR)/audio/audio.c
-       SRC += $(QUANTUM_DIR)/audio/voices.c
-       SRC += $(QUANTUM_DIR)/audio/luts.c
-endif
-
-ifeq ($(strip $(UCIS_ENABLE)), yes)
-       OPT_DEFS += -DUCIS_ENABLE
-       UNICODE_ENABLE = yes
-endif
-
-ifeq ($(strip $(UNICODE_ENABLE)), yes)
-    OPT_DEFS += -DUNICODE_ENABLE
-       SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
-endif
-
-ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
-       OPT_DEFS += -DRGBLIGHT_ENABLE
-       SRC += $(QUANTUM_DIR)/light_ws2812.c
-       SRC += $(QUANTUM_DIR)/rgblight.c
-endif
-
-ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
-       OPT_DEFS += -DTAP_DANCE_ENABLE
-       SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
-endif
-
-ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
-       SERIAL_DIR = $(QUANTUM_DIR)/serial_link
-       SERIAL_PATH = $(QUANTUM_PATH)/serial_link
-       SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c)
-       SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
-       SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
-       OPT_DEFS += -DSERIAL_LINK_ENABLE
-       VAPTH += $(SERIAL_PATH)
-endif
-
-# Optimize size but this may cause error "relocation truncated to fit"
-#EXTRALDFLAGS = -Wl,--relax
-
-# Search Path
-VPATH += $(KEYMAP_PATH)
-ifdef SUBPROJECT
-       VPATH += $(SUBPROJECT_PATH)
-endif
-VPATH += $(KEYBOARD_PATH)
-VPATH += $(TOP_DIR)
-VPATH += $(TMK_PATH)
-VPATH += $(QUANTUM_PATH)
-VPATH += $(QUANTUM_PATH)/keymap_extras
-VPATH += $(QUANTUM_PATH)/audio
-VPATH += $(QUANTUM_PATH)/process_keycode
-
-
-# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
-ifdef MCU_FAMILY
-       PLATFORM=CHIBIOS
-else
-       PLATFORM=AVR
-endif
-
-include $(TMK_PATH)/common.mk
-ifeq ($(PLATFORM),AVR)
-       include $(TMK_PATH)/protocol/lufa.mk
-       include $(TMK_PATH)/avr.mk
-else ifeq ($(PLATFORM),CHIBIOS)
-       include $(TMK_PATH)/protocol/chibios.mk
-       include $(TMK_PATH)/chibios.mk
-       OPT_OS = chibios
-else
-       $(error Unknown platform)
-endif
-
-ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
-       VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
-       VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
-       include $(VISUALIZER_PATH)/visualizer.mk
-endif
-
-include $(TMK_PATH)/rules.mk
-
+# Set the default goal depening on where we are running make from
+# this handles the case where you run make without any arguments
+.DEFAULT_GOAL := all
+ifneq ($(KEYMAP),)
+    ifeq ($(SUBPROJECT),)
+         # Inside a keymap folder, just build the keymap, with the 
+         # default subproject
+        .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
+    else
+         # Inside a subproject keyamp folder, build the keymap
+         # for that subproject
+        .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP)
+    endif
+else ifneq ($(SUBPROJECT),)
+     # Inside a subproject folder, build all keymaps for that subproject
+    .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm
+else ifneq ($(KEYBOARD),)
+     # Inside a keyboard folder, build all keymaps for all subprojects
+     # Note that this is different from the old behaviour, which would
+     # build only the default keymap of the default keyboard
+    .DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm
+endif
+
+
+# Compare the start of the RULE variable with the first argument($1)
+# If the rules equals $1 or starts with $1-, RULE_FOUND is set to true
+#     and $1 is removed from the RULE variable
+# Otherwise the RULE_FOUND variable is set to false, and RULE left as it was
+# The function is a bit tricky, since there's no built in $(startswith) function
+define COMPARE_AND_REMOVE_FROM_RULE_HELPER
+    ifeq ($1,$$(RULE))
+        RULE:=
+        RULE_FOUND := true
+    else
+        STARTDASH_REMOVED=$$(subst START$1-,,START$$(RULE))
+        ifneq ($$(STARTDASH_REMOVED),START$$(RULE))
+            RULE_FOUND := true
+            RULE := $$(STARTDASH_REMOVED)
+        else
+            RULE_FOUND := false
+        endif
+    endif
+endef
+
+# This makes it easier to call COMPARE_AND_REMOVE_FROM_RULE, since it makes it behave like
+# a function that returns the value
+COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND)
+
+
+# Recursively try to find a match for the start of the rule to be checked
+# $1 The list to be checked
+# If a match is found, then RULE_FOUND is set to true
+# and MATCHED_ITEM to the item that was matched
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3
+    ifneq ($1,)
+        ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
+            MATCHED_ITEM := $$(firstword $1)
+        else 
+            $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1)))
+        endif
+    endif
+endef
+
+# A recursive helper function for finding the longest match
+# $1 The list to be checed
+# It works by always removing the currently matched item from the list 
+# and call itself recursively, until a match is found
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
+    # Stop the recursion when the list is empty 
+    ifneq ($1,)
+        RULE_BEFORE := $$(RULE)
+        $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
+        # If a match is found in the current list, otherwise just return what we had before
+        ifeq ($$(RULE_FOUND),true)
+            # Save the best match so far and call itself recursivel
+            BEST_MATCH := $$(MATCHED_ITEM)
+            BEST_MATCH_RULE := $$(RULE)
+            RULE_FOUND := false
+            RULE := $$(RULE_BEFORE)
+            $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1)))
+        endif
+     endif
+endef
+
+
+# Recursively try to find the longest match for the start of the rule to be checked
+# $1 The list to be checked
+# If a match is found, then RULE_FOUND is set to true
+# and MATCHED_ITEM to the item that was matched
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER
+    BEST_MATCH :=
+    $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1))
+    ifneq ($$(BEST_MATCH),)
+        RULE_FOUND := true
+        RULE := $$(BEST_MATCH_RULE)
+        MATCHED_ITEM := $$(BEST_MATCH)
+    else
+        RULE_FOUND := false
+        MATCHED_ITEM :=
+    endif
+endef
+
+# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST
+TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND)
+
+define ALL_IN_LIST_LOOP
+    OLD_RULE$1 := $$(RULE)
+    $$(eval $$(call $1,$$(ITEM$1)))
+    RULE := $$(OLD_RULE$1)
+endef
+
+define PARSE_ALL_IN_LIST
+    $$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1)))
+endef
+
+# The entry point for rule parsing
+# parses a rule in the format <keyboard>-<subproject>-<keymap>-<target>
+# but this particular function only deals with the first <keyboard> part
+define PARSE_RULE
+    RULE := $1
+    COMMANDS :=
+    # If the rule starts with allkb, then continue the parsing from
+    # PARSE_ALL_KEYBOARDS
+    ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true)
+        $$(eval $$(call PARSE_ALL_KEYBOARDS))
+    else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
+        $$(eval $$(call PARSE_TEST))
+    # If the rule starts with the name of a known keyboard, then continue
+    # the parsing from PARSE_KEYBOARD
+    else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
+        $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
+    # Otherwise use the KEYBOARD variable, which is determined either by
+    # the current directory you run make from, or passed in as an argument
+    else ifneq ($$(KEYBOARD),)
+        $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
+    else
+        $$(info make: *** No rule to make target '$1'. Stop.)
+        # Notice the tab instead of spaces below!
+               exit 1
+    endif
+endef
+
+# $1 = Keyboard
+# Parses a rule in the format <subproject>-<keymap>-<target>
+# the keyboard is already known when entering this function
+define PARSE_KEYBOARD
+    CURRENT_KB := $1
+    # A subproject is any keyboard subfolder with a makefile
+    SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile)))
+    # if the rule starts with allsp, then continue with looping over all subprojects
+    ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true)
+        $$(eval $$(call PARSE_ALL_SUBPROJECTS))
+    # A special case for matching the defaultsp (default subproject)
+    else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true)
+        $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
+    # If the rule starts with the name of a known subproject
+    else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true)
+        $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM)))
+    # Try to use the SUBPROJECT variable, which is either determined by the
+    # directory which invoked make, or passed as an argument to make
+    else ifneq ($$(SUBPROJECT),)
+        $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT)))
+       # If there's no matching subproject, we assume it's the default
+       # This will allow you to leave the subproject part of the target out
+    else 
+        $$(eval $$(call PARSE_SUBPROJECT,))
+    endif
+endef
+
+# if we are going to compile all keyboards, match the rest of the rule
+# for each of them
+define PARSE_ALL_KEYBOARDS
+    $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
+endef
+
+# $1 Subproject
+# When entering this, the keyboard and subproject are known, so now we need
+# to determine which keymaps are going to get compiled
+define PARSE_SUBPROJECT
+    # If we want to compile the default subproject, then we need to 
+    # include the correct makefile to determine the actual name of it
+    CURRENT_SP := $1
+    ifeq ($$(CURRENT_SP),)
+        CURRENT_SP := defaultsp
+    endif
+    ifeq ($$(CURRENT_SP),defaultsp)
+        SUBPROJECT_DEFAULT=
+        $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
+        CURRENT_SP := $$(SUBPROJECT_DEFAULT)
+    endif
+    # If current subproject is empty (the default was not defined), and we have a list of subproject
+    # then make all of them
+    ifeq ($$(CURRENT_SP),)
+        ifneq ($$(SUBPROJECTS),)
+            CURRENT_SP := allsp
+         endif
+    endif
+    # The special allsp is handled later
+    ifneq ($$(CURRENT_SP),allsp) 
+        # get a list of all keymaps
+        KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
+        ifneq ($$(CURRENT_SP),)
+            # if the subproject is defined, then also look for keymaps inside the subproject folder
+            SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
+            KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
+        endif
+        # if the rule after removing the start of it is empty (we haven't specified a kemap or target)
+        # compile all the keymaps
+        ifeq ($$(RULE),)
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        # The same if allkm was specified
+        else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        # Try to match the specified keyamp with the list of known keymaps
+        else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
+            $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
+        # Otherwise try to match the keymap from the current folder, or arguments to the make command
+        else ifneq ($$(KEYMAP),)
+            $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
+        # No matching keymap found, so we assume that the rest of the rule is the target
+        # If we haven't been able to parse out a subproject, then make all of them
+        # This is consistent with running make without any arguments from the keyboard
+        # folder
+        else ifeq ($1,)
+            $$(eval $$(call PARSE_ALL_SUBPROJECTS))
+        # Otherwise, make all keymaps, again this is consistent with how it works without
+        # any arguments
+        else
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        endif
+    else
+        # As earlier mentione,d when allsb is specified, we call our self recursively
+        # for all of the subprojects
+        $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS)))
+    endif
+endef
+
+# If we want to parse all subprojects, but the keyboard doesn't have any, 
+# then use defaultsp instead
+define PARSE_ALL_SUBPROJECTS
+    ifeq ($$(SUBPROJECTS),)
+        $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
+    else
+        $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
+    endif
+endef
+
+# $1 Keymap
+# This is the meat of compiling a keyboard, when entering this, everything is known
+# keyboard, subproject, and keymap
+# Note that we are not directly calling the command here, but instead building a list,
+# which will later be processed
+define PARSE_KEYMAP
+    CURRENT_KM = $1
+    # The rest of the rule is the target
+    # Remove the leading "-" from the target, as it acts as a separator
+    MAKE_TARGET := $$(patsubst -%,%,$$(RULE))
+    # We need to generate an unique indentifer to append to the COMMANDS list
+    COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM)
+    # If we are compiling a keyboard without a subproject, we want to display just the name
+    # of the keyboard, otherwise keyboard/subproject
+    ifeq ($$(CURRENT_SP),)
+        KB_SP := $(CURRENT_KB)
+    else
+        KB_SP := $(CURRENT_KB)/$$(CURRENT_SP)
+    endif
+    # Format it in bold
+    KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
+    # Specify the variables that we are passing forward to submake
+    MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM)
+    # And the first part of the make command
+    MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
+    # The message to display
+    MAKE_MSG := $$(MSG_MAKE_KB)
+    # We run the command differently, depending on if we want more output or not
+    # The true version for silent output and the false version otherwise
+    $$(eval $$(call BUILD))
+endef
+
+define BUILD
+    MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR)
+    COMMANDS += $$(COMMAND)
+    COMMAND_true_$$(COMMAND) := \
+        printf "$$(MAKE_MSG)" | \
+        $$(MAKE_MSG_FORMAT); \
+        LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
+        if [ $$$$? -gt 0 ]; \
+            then $$(PRINT_ERROR_PLAIN); \
+        elif [ "$$$$LOG" != "" ] ; \
+            then $$(PRINT_WARNING_PLAIN); \
+        else \
+            $$(PRINT_OK); \
+        fi;
+    COMMAND_false_$$(COMMAND) := \
+        printf "$$(MAKE_MSG)\n\n"; \
+        $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; \
+        if [ $$$$? -gt 0 ]; \
+            then error_occured=1; \
+        fi;
+endef
+
+# Just parse all the keymaps for a specifc keyboard
+define PARSE_ALL_KEYMAPS
+    $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS)))
+endef
+
+define BUILD_TEST
+    TEST_NAME := $1
+    MAKE_TARGET := $2
+    COMMAND := $1
+    MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
+    MAKE_VARS := TEST=$$(TEST_NAME)
+    MAKE_MSG := $$(MSG_MAKE_TEST)
+    $$(eval $$(call BUILD))
+    ifneq ($$(MAKE_TARGET),clean)
+        TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
+        TESTS += $$(TEST_NAME)
+        TEST_MSG := $$(MSG_TEST)
+        $$(TEST_NAME)_COMMAND := \
+            printf "$$(TEST_MSG)\n"; \
+            $$(TEST_EXECUTABLE); \
+            if [ $$$$? -gt 0 ]; \
+                then error_occured=1; \
+            fi; \
+            printf "\n";
+    endif
+endef
+
+define PARSE_TEST
+    TESTS :=
+    TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
+    TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE)))
+    ifeq ($$(TEST_NAME),all)
+        MATCHED_TESTS := $$(TEST_LIST)
+    else
+        MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
+    endif
+    $$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
+endef
+
+
+# Set the silent mode depending on if we are trying to compile multiple keyboards or not
+# By default it's on in that case, but it can be overriden by specifying silent=false 
+# from the command line
+define SET_SILENT_MODE
+    ifdef SUB_IS_SILENT
+        SILENT_MODE := $(SUB_IS_SILENT)
+    else ifeq ($$(words $$(COMMANDS)),1)
+        SILENT_MODE := false
+    else
+        SILENT_MODE := true
+    endif
+endef
+
+include $(ROOT_DIR)/message.mk
+
+RUN_COMMAND = \
+$(COMMAND_$(SILENT_MODE)_$(COMMAND))
+
+# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
+SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile)))
+.PHONY: $(SUBPROJECTS)
+$(SUBPROJECTS): %: %-allkm 
+
+# Let's match everything, we handle all the rule parsing ourselves
+.PHONY: %
+%: 
+       # Check if we have the CMP tool installed
+       cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
+       # Check if the submodules are dirty, and display a warning if they are
+       git submodule status --recursive 2>/dev/null | \
+       while IFS= read -r x; do \
+               case "$$x" in \
+                       \ *) ;; \
+                       *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
+               esac \
+       done
+       $(eval $(call PARSE_RULE,$@))
+       $(eval $(call SET_SILENT_MODE))
+       # Run all the commands in the same shell, notice the + at the first line
+       # it has to be there to allow parallel execution of the submake
+       # This always tries to compile everything, even if error occurs in the middle
+       # But we return the error code at the end, to trigger travis failures
+       +error_occured=0; \
+       $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \
+       if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
+       $(foreach TEST,$(TESTS),$($(TEST)_COMMAND)) \
+       if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
+
+# All should compile everything
+.PHONY: all
+all: all-keyboards test-all
+
+# Define some shortcuts, mostly for compability with the old syntax
+.PHONY: all-keyboards
+all-keyboards: allkb-allsp-allkm
+
+.PHONY: all-keyboards-defaults
+all-keyboards-defaults: allkb-allsp-default
+
+.PHONY: test
+test: test-all
+
+.PHONY: test-clean
+test-clean: test-all-clean
+
+# Generate the version.h file
 GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
 BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
-OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
+$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
+$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
 
-$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h)
-$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h)
+include $(ROOT_DIR)/testlist.mk
\ No newline at end of file
diff --git a/build_keyboard.mk b/build_keyboard.mk
new file mode 100644 (file)
index 0000000..04632c1
--- /dev/null
@@ -0,0 +1,221 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+.DEFAULT_GOAL := all
+
+include common.mk
+
+ifneq ($(SUBPROJECT),)
+       TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
+       KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT)
+else
+       TARGET ?= $(KEYBOARD)_$(KEYMAP)
+       KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
+endif
+
+# Force expansion
+TARGET := $(TARGET)
+
+
+MASTER ?= left
+ifdef master
+       MASTER = $(master)
+endif
+
+ifeq ($(MASTER),right) 
+       OPT_DEFS += -DMASTER_IS_ON_RIGHT
+else 
+       ifneq ($(MASTER),left)
+$(error MASTER does not have a valid value(left/right))
+       endif
+endif
+
+
+
+KEYBOARD_PATH := keyboards/$(KEYBOARD)
+KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c
+
+ifneq ("$(wildcard $(KEYBOARD_C))","")
+    include $(KEYBOARD_PATH)/rules.mk
+else 
+    $(error "$(KEYBOARD_C)" does not exist)
+endif
+
+
+ifneq ($(SUBPROJECT),)
+    SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
+    SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c
+    ifneq ("$(wildcard $(SUBPROJECT_C))","")
+        OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
+        include $(SUBPROJECT_PATH)/rules.mk
+    else 
+        $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
+    endif
+endif
+
+# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
+ifdef MCU_FAMILY
+       PLATFORM=CHIBIOS
+else
+       PLATFORM=AVR
+endif
+
+ifeq ($(PLATFORM),CHIBIOS)
+       include $(TMK_PATH)/protocol/chibios.mk
+       include $(TMK_PATH)/chibios.mk
+       OPT_OS = chibios
+       ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","")
+               OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h
+       else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
+               OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h
+       else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
+               OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
+       else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
+               OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
+       endif
+endif
+
+CONFIG_H = $(KEYBOARD_PATH)/config.h
+ifneq ($(SUBPROJECT),)
+       ifneq ("$(wildcard $(SUBPROJECT_C))","")
+               CONFIG_H = $(SUBPROJECT_PATH)/config.h
+       endif
+endif
+
+# Save the defines and includes here, so we don't include any keymap specific ones 
+PROJECT_DEFS := $(OPT_DEFS)
+PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
+PROJECT_CONFIG := $(CONFIG_H)
+
+MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
+MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
+SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
+SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c
+ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","")
+    -include $(SUBPROJ_KEYMAP_PATH)/Makefile
+    KEYMAP_C := $(SUBPROJ_KEYMAP_C)
+    KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH)
+else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","")
+    -include $(MAIN_KEYMAP_PATH)/Makefile
+    KEYMAP_C := $(MAIN_KEYMAP_C)
+    KEYMAP_PATH := $(MAIN_KEYMAP_PATH)
+else
+    $(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist)
+endif
+
+
+# Object files directory
+#     To put object files in current directory, use a dot (.), do NOT make
+#     this an empty or blank macro!
+KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
+
+
+ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
+       CONFIG_H = $(KEYMAP_PATH)/config.h
+endif
+
+# # project specific files
+SRC += $(KEYBOARD_C) \
+       $(KEYMAP_C) \
+       $(QUANTUM_DIR)/quantum.c \
+       $(QUANTUM_DIR)/keymap_common.c \
+       $(QUANTUM_DIR)/keycode_config.c \
+       $(QUANTUM_DIR)/process_keycode/process_leader.c
+
+ifneq ($(SUBPROJECT),)
+       SRC += $(SUBPROJECT_C)
+endif
+
+ifndef CUSTOM_MATRIX
+       SRC += $(QUANTUM_DIR)/matrix.c
+endif
+
+ifeq ($(strip $(MIDI_ENABLE)), yes)
+    OPT_DEFS += -DMIDI_ENABLE
+       SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
+endif
+
+ifeq ($(strip $(VIRTSER_ENABLE)), yes)
+    OPT_DEFS += -DVIRTSER_ENABLE
+endif
+
+ifeq ($(strip $(AUDIO_ENABLE)), yes)
+    OPT_DEFS += -DAUDIO_ENABLE
+       SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
+       SRC += $(QUANTUM_DIR)/audio/audio.c
+       SRC += $(QUANTUM_DIR)/audio/voices.c
+       SRC += $(QUANTUM_DIR)/audio/luts.c
+endif
+
+ifeq ($(strip $(UNICODE_ENABLE)), yes)
+    OPT_DEFS += -DUNICODE_ENABLE
+       SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
+endif
+
+ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
+       OPT_DEFS += -DRGBLIGHT_ENABLE
+       SRC += $(QUANTUM_DIR)/light_ws2812.c
+       SRC += $(QUANTUM_DIR)/rgblight.c
+endif
+
+ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
+       OPT_DEFS += -DTAP_DANCE_ENABLE
+       SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
+endif
+
+ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
+       SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
+       OPT_DEFS += $(SERIAL_DEFS)
+       VAPTH += $(SERIAL_PATH)
+endif
+
+# Optimize size but this may cause error "relocation truncated to fit"
+#EXTRALDFLAGS = -Wl,--relax
+
+# Search Path
+VPATH += $(KEYMAP_PATH)
+ifneq ($(SUBPROJECT),)
+       VPATH += $(SUBPROJECT_PATH)
+endif
+VPATH += $(KEYBOARD_PATH)
+VPATH += $(COMMON_VPATH)
+
+
+include $(TMK_PATH)/common.mk
+SRC += $(TMK_COMMON_SRC)
+OPT_DEFS += $(TMK_COMMON_DEFS)
+EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
+
+ifeq ($(PLATFORM),AVR)
+       include $(TMK_PATH)/protocol/lufa.mk
+       include $(TMK_PATH)/avr.mk
+endif
+
+ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
+       VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
+       VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
+       include $(VISUALIZER_PATH)/visualizer.mk
+endif
+
+OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
+$(KEYMAP_OUTPUT)_SRC := $(SRC)
+$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 
+$(KEYMAP_OUTPUT)_INC :=  $(VPATH) $(EXTRAINCDIRS)
+$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
+$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
+$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
+$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
+$(KEYBOARD_OUTPUT)_CONFIG  := $(PROJECT_CONFIG)
+
+# Default target.
+all: build sizeafter
+
+# Change the build target to build a HEX file or a library.
+build: elf hex
+#build: elf hex eep lss sym
+#build: lib
+
+
+include $(TMK_PATH)/rules.mk
+
diff --git a/build_test.mk b/build_test.mk
new file mode 100644 (file)
index 0000000..ee15a45
--- /dev/null
@@ -0,0 +1,57 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+.DEFAULT_GOAL := all
+
+include common.mk
+
+TARGET=test/$(TEST)
+
+GTEST_OUTPUT = $(BUILD_DIR)/gtest
+
+TEST_OBJ = $(BUILD_DIR)/test_obj
+
+OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
+
+GTEST_INC := \
+       $(LIB_PATH)/googletest/googletest/include\
+       $(LIB_PATH)/googletest/googlemock/include\
+       
+GTEST_INTERNAL_INC :=\
+       $(LIB_PATH)/googletest/googletest\
+       $(LIB_PATH)/googletest/googlemock
+
+$(GTEST_OUTPUT)_SRC :=\
+       googletest/src/gtest-all.cc\
+       googletest/src/gtest_main.cc\
+       googlemock/src/gmock-all.cc
+
+$(GTEST_OUTPUT)_DEFS := 
+$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
+
+LDFLAGS += -lstdc++ -lpthread -shared-libgcc
+CREATE_MAP := no
+
+VPATH +=\
+       $(LIB_PATH)/googletest\
+       $(LIB_PATH)/googlemock
+
+all: elf
+
+VPATH += $(COMMON_VPATH)
+
+include $(TMK_PATH)/common.mk
+include $(QUANTUM_PATH)/serial_link/tests/rules.mk
+
+$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
+$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
+$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
+
+include $(TMK_PATH)/native.mk
+include $(TMK_PATH)/rules.mk
+
+
+$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
+$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
+
diff --git a/common.mk b/common.mk
new file mode 100644 (file)
index 0000000..18751cd
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,26 @@
+include message.mk
+
+# Directory common source files exist
+TOP_DIR = .
+TMK_DIR = tmk_core
+TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
+LIB_PATH = $(TOP_DIR)/lib
+
+QUANTUM_DIR = quantum
+QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
+
+BUILD_DIR := $(TOP_DIR)/.build
+
+SERIAL_DIR := $(QUANTUM_DIR)/serial_link
+SERIAL_PATH := $(QUANTUM_PATH)/serial_link
+SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
+SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
+SERIAL_DEFS += -DSERIAL_LINK_ENABLE
+
+COMMON_VPATH := $(TOP_DIR)
+COMMON_VPATH += $(TMK_PATH)
+COMMON_VPATH += $(QUANTUM_PATH)
+COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
+COMMON_VPATH += $(QUANTUM_PATH)/audio
+COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
+COMMON_VPATH += $(SERIAL_PATH)
\ No newline at end of file
index d8325e6c89dbd33bb251f75e15ece8fcb5804339..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,70 +1,3 @@
-
-
-# Target file name (without extension).
-
-# project specific files
-SRC = led.c
-
-# MCU name
-MCU = atmega32u2
-
-# 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
-#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-#NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/alps64/rules.mk b/keyboards/alps64/rules.mk
new file mode 100644 (file)
index 0000000..c326d3e
--- /dev/null
@@ -0,0 +1,66 @@
+
+
+# Target file name (without extension).
+
+# project specific files
+SRC = led.c
+
+# MCU name
+MCU = atmega32u2
+
+# 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
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
\ No newline at end of file
index 1f695aa4d8a524ae33e03fdb5066c545bc6218a1..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,70 +1,3 @@
-
-# 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 ?= no  # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE  ?= no  # 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
-NKRO_ENABLE      ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-RGBLIGHT_ENABLE  ?= yes # Enable keyboard underlight functionality (+4870)
-BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
-MIDI_ENABLE      ?= no  # MIDI controls
-AUDIO_ENABLE     ?= no
-UNICODE_ENABLE   ?= no  # Unicode
-BLUETOOTH_ENABLE ?= no  # Enable Bluetooth with the Adafruit EZ-Key HID
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/amj60/rules.mk b/keyboards/amj60/rules.mk
new file mode 100644 (file)
index 0000000..18403ac
--- /dev/null
@@ -0,0 +1,66 @@
+
+# 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 ?= no  # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE  ?= no  # 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
+NKRO_ENABLE      ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE  ?= yes # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE      ?= no  # MIDI controls
+AUDIO_ENABLE     ?= no
+UNICODE_ENABLE   ?= no  # Unicode
+BLUETOOTH_ENABLE ?= no  # Enable Bluetooth with the Adafruit EZ-Key HID
index 09fcf3e7a0e1b61072575f177ce84bc6867167fe..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,74 +1,3 @@
-
-
-# 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=512
-
-
-# Build Options
-#   change yes to no to disable
-#
-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 ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= yes           # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
index 5aa44cce541548bff51f0d2caf1bfbec19520e66..2e9a64f2ef2378b78d808a8e8404b31e6b1b5cfb 100644 (file)
@@ -12,13 +12,15 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol
 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`.
+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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
\ No newline at end of file
diff --git a/keyboards/arrow_pad/rules.mk b/keyboards/arrow_pad/rules.mk
new file mode 100644 (file)
index 0000000..3dca9b6
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+# 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=512
+
+
+# Build Options
+#   change yes to no to disable
+#
+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 ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= yes           # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
\ No newline at end of file
index 08e9205cbf1f30a6223dd98f0f40f094288556d8..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,73 +1,3 @@
-
-
-# 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
-#   change to "no" to disable the options, or define them in the Makefile in 
-#   the appropriate keymap folder that will get included automatically
-#
-BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no         # Console for debug(+400)
-COMMAND_ENABLE ?= yes        # Commands for debug and configuration
-NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
-AUDIO_ENABLE ?= no           # Audio output on port C6
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
index ab1e7ba1ff8ded2afe672b0276d7742ef50f0e52..674dcf113b394ea3cd17c863f55408bf351e13f3 100644 (file)
@@ -13,13 +13,14 @@ Download or clone the whole firmware and navigate to the keyboards/atomic folder
 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`.
+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 a file in the keymaps folder named `<name>.c` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/atomic/rules.mk b/keyboards/atomic/rules.mk
new file mode 100644 (file)
index 0000000..d0f3a3a
--- /dev/null
@@ -0,0 +1,69 @@
+
+
+# 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
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= yes        # Commands for debug and configuration
+NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
+AUDIO_ENABLE ?= no           # Audio output on port C6
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
\ No newline at end of file
index 5894d231f9dd9661eb223ddd0e8bf611fc6937b6..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,88 +1,3 @@
-
-
-ifdef TEENSY2
-    OPT_DEFS += -DATREUS_TEENSY2
-    ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
-else
-    OPT_DEFS += -DATREUS_ASTAR
-    OPT_DEFS += -DCATERINA_BOOTLOADER
-    ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
-                            avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
-endif
-
-# 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
-# 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 - not yet supported in LUFA
-# 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
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-USB ?= /dev/cu.usbmodem1411
-
-upload: build
-       $(ATREUS_UPLOAD_COMMAND)
-       
+endif
\ No newline at end of file
index 734f58f0f095602ca5882ff53c130cb9ab588ea9..a4077668e3662895f7b6e1b5fbff63236a59893a 100644 (file)
@@ -174,13 +174,14 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder
 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`.
+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` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk
new file mode 100644 (file)
index 0000000..d71f50b
--- /dev/null
@@ -0,0 +1,82 @@
+
+
+ifdef TEENSY2
+    OPT_DEFS += -DATREUS_TEENSY2
+    ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
+else
+    OPT_DEFS += -DATREUS_ASTAR
+    OPT_DEFS += -DCATERINA_BOOTLOADER
+    ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
+                            avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
+endif
+
+# 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
+# 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 - not yet supported in LUFA
+# 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
+
+USB ?= /dev/cu.usbmodem1411
+
+upload: build
+       $(ATRUES_UPLOAD_COMMAND)
\ No newline at end of file
index 03893dbf8905f5f364d10d28a048cf9593b461b7..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,72 +1,3 @@
-
-
-# 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=512
-
-
-# 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
-# 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
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
+endif
\ No newline at end of file
index 89d7f9d053e4e72ae1cb40bad7dbc0bdd92f92d4..462f67c12458caed189ca2ddd12eb76fdbff515c 100644 (file)
@@ -12,13 +12,14 @@ Download or clone the whole firmware and navigate to the keyboards/Bantam44 fold
 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`.
+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` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
\ No newline at end of file
diff --git a/keyboards/bantam44/rules.mk b/keyboards/bantam44/rules.mk
new file mode 100644 (file)
index 0000000..baa0e9e
--- /dev/null
@@ -0,0 +1,67 @@
+
+
+# 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=512
+
+
+# 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
+# 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
index d9f2b8b83bac6ab7d23b3a1ee4ccc52668e0bdc8..4b07a623432e97ec31a0e244cbf084a6d14a9200 100644 (file)
@@ -1,14 +1,5 @@
 SUBPROJECT_DEFAULT = stm32_f072_onekey
 
-#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-CONSOLE_ENABLE ?= yes  # Console for debug
-COMMAND_ENABLE ?= yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes         # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
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
diff --git a/keyboards/chibios_test/rules.mk b/keyboards/chibios_test/rules.mk
new file mode 100644 (file)
index 0000000..4b5a845
--- /dev/null
@@ -0,0 +1,8 @@
+#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration
+MOUSEKEY_ENABLE ?= yes # Mouse keys
+EXTRAKEY_ENABLE ?= yes # Audio control and System control
+CONSOLE_ENABLE ?= yes  # Console for debug
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= yes         # USB Nkey Rollover
+CUSTOM_MATRIX ?= yes # Custom matrix file
\ No newline at end of file
index eae38c4b2bcdbccab742299d693940a5bc4e0dc0..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,41 +1,3 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-## chip/board settings
-# the next two should match the directories in
-#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-MCU_FAMILY = STM32
-MCU_SERIES = STM32F0xx
-# linker script to use
-# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#  or <this_dir>/ld/
-MCU_LDSCRIPT = STM32F072xB
-# startup code to use
-# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-MCU_STARTUP = stm32f0xx
-# it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-BOARD = ST_STM32F072B_DISCOVERY
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m0
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-ARMV = 6
-# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
-# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
-# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
-# a custom board definition that you plan to reuse).
-# If you're not setting it here, leave it commented out.
-# It is chip dependent, the correct number can be looked up here (page 175):
-# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
-# This also requires a patch to chibios:
-#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
-#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
-
-# Build Options
-#   comment out to disable the options.
-#
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
+endif
\ No newline at end of file
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_ */
diff --git a/keyboards/chibios_test/stm32_f072_onekey/rules.mk b/keyboards/chibios_test/stm32_f072_onekey/rules.mk
new file mode 100644 (file)
index 0000000..eae38c4
--- /dev/null
@@ -0,0 +1,41 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+## chip/board settings
+# the next two should match the directories in
+#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+MCU_FAMILY = STM32
+MCU_SERIES = STM32F0xx
+# linker script to use
+# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#  or <this_dir>/ld/
+MCU_LDSCRIPT = STM32F072xB
+# startup code to use
+# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+MCU_STARTUP = stm32f0xx
+# it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+BOARD = ST_STM32F072B_DISCOVERY
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m0
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ARMV = 6
+# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
+# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
+# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
+# a custom board definition that you plan to reuse).
+# If you're not setting it here, leave it commented out.
+# It is chip dependent, the correct number can be looked up here (page 175):
+# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+# This also requires a patch to chibios:
+#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
+
+# Build Options
+#   comment out to disable the options.
+#
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
index 307ca5b198ef28222c00f8f3b4b1cc357f9776fa..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,52 +1,3 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-# GENERIC STM32F103C8T6 board - stm32duino bootloader
-OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
-MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
-BOARD = GENERIC_STM32_F103
-
-# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
-# OPT_DEFS =
-# MCU_LDSCRIPT = STM32F103x8
-# BOARD = GENERIC_STM32_F103
-
-# MAPLE MINI
-# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
-# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
-# BOARD = MAPLEMINI_STM32_F103
-
-## chip/board settings
-# the next two should match the directories in
-#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-MCU_FAMILY = STM32
-MCU_SERIES = STM32F1xx
-# linker script to use
-# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#  or <this_dir>/ld/
-# startup code to use
-# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-MCU_STARTUP = stm32f1xx
-# it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m3
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-ARMV = 7
-# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
-# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
-# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
-# a custom board definition that you plan to reuse).
-# If you're not setting it here, leave it commented out.
-# It is chip dependent, the correct number can be looked up here (page 175):
-# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
-# This also requires a patch to chibios:
-#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
-#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
+endif
\ No newline at end of file
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_ */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/rules.mk b/keyboards/chibios_test/stm32_f103_onekey/rules.mk
new file mode 100644 (file)
index 0000000..307ca5b
--- /dev/null
@@ -0,0 +1,52 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+# GENERIC STM32F103C8T6 board - stm32duino bootloader
+OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
+MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
+BOARD = GENERIC_STM32_F103
+
+# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
+# OPT_DEFS =
+# MCU_LDSCRIPT = STM32F103x8
+# BOARD = GENERIC_STM32_F103
+
+# MAPLE MINI
+# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
+# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
+# BOARD = MAPLEMINI_STM32_F103
+
+## chip/board settings
+# the next two should match the directories in
+#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+MCU_FAMILY = STM32
+MCU_SERIES = STM32F1xx
+# linker script to use
+# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#  or <this_dir>/ld/
+# startup code to use
+# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+MCU_STARTUP = stm32f1xx
+# it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m3
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ARMV = 7
+# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
+# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
+# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
+# a custom board definition that you plan to reuse).
+# If you're not setting it here, leave it commented out.
+# It is chip dependent, the correct number can be looked up here (page 175):
+# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+# This also requires a patch to chibios:
+#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
+
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
index 43ea9d82d93830d3786e57b76160a2fea1401135..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,49 +1,3 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-MCU_FAMILY = KINETIS
-MCU_SERIES = KL2x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-MCU_LDSCRIPT = MKL26Z64
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0
-#   - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = kl2x
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-BOARD = PJRC_TEENSY_LC
-
-# Cortex version
-# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
-MCU  = cortex-m0plus
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
 endif
\ No newline at end of file
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_ */
diff --git a/keyboards/chibios_test/teensy_lc_onekey/rules.mk b/keyboards/chibios_test/teensy_lc_onekey/rules.mk
new file mode 100644 (file)
index 0000000..43ea9d8
--- /dev/null
@@ -0,0 +1,49 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+MCU_FAMILY = KINETIS
+MCU_SERIES = KL2x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+MCU_LDSCRIPT = MKL26Z64
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0
+#   - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = kl2x
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+BOARD = PJRC_TEENSY_LC
+
+# Cortex version
+# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
+MCU  = cortex-m0plus
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
\ No newline at end of file
index e6b13f955abe4438937801760515b7a6c8cbfa6b..b9bada8f8d73aa3a06f9f27ca37f0129e4c19728 100644 (file)
@@ -1,109 +1,5 @@
-#----------------------------------------------------------------------------
-# 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".
-#----------------------------------------------------------------------------
-
 SUBPROJECT_DEFAULT = rev2
 
-# MCU name
-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
-#   change to no to disable the options.
-#
-BOOTMAGIC_ENABLE ?= yes        # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= no  # 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
-NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-AUDIO_ENABLE ?= no
-RGBLIGHT_ENABLE ?= no   # Enable keyboard underlight functionality
-MIDI_ENABLE ?= no              # MIDI controls
-UNICODE_ENABLE ?= no           # Unicode
-BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
index 6c29c09eca23a6c9e6c3763d0d4bf81f0ccb81cb..4a76e2908c5e76615bd95ae8d0de707e2d75a31c 100644 (file)
@@ -31,36 +31,36 @@ If you would like to use one of the alternative keymaps, or create your own, see
 
 ## Clueboard 1.0
 
-If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `SUBPROJECT=rev1` to your make command, like this:
+If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `rev1` to your make command, like this:
 
 ```
-$ make SUBPROJECT=rev1
+$ make rev1
 ```
 
 And when flashing your keyboard:
 
 ```
-$ make SUBPROJECT=rev1 dfu
+$ make rev1-dfu
 ```
 
-If you are flashing an alternative layout to your rev1, include both `SUBPROJECT=rev1` and `KEYMAP=<keymap>` in your command, for example when flashing max:
+If you are flashing an alternative layout to your rev1, include both `rev1` and `<keymap>` in your command, for example when flashing max:
 
 ```
-$ make SUBPROJECT=rev1 KEYMAP=max dfu
+$ make rev1-max-dfu
 ```
 
 ## Alternate Keymaps
 
-There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `KEYMAP=<keymap>` to your command:
+There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `<keymap>` to your command:
 
 ```
-$ make KEYMAP=skully
+$ make skully
 ```
 
-And when flashing your keyboard, put `KEYMAP=<keymap>` between "make" and "dfu":
+And when flashing your keyboard, put `<keymap>` between "make" and "dfu":
 
 ```
-$ make KEYMAP=skully dfu
+$ make skully-dfu
 ```
 
 ### Notable Layouts
@@ -76,15 +76,15 @@ These layouts are notable for one reason or another. If you are looking for idea
 There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend:
 
 * Copy `[keymaps/default](keymaps/default/)` to `keymaps/<your_layout>`.
-* Compile the firmware (`$ make KEYMAP=<your_layout>`)
-* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
+* Compile the firmware (`$ make <your_layout>`)
+* Flash the firmware (`$ make <your_layout>-dfu`)
 * Make sure everything works like the default keyboard
 * Modify `keymaps/<your_layout>/readme.md` to tell others about your layout.
 * Modify `keymaps/<your_layout>/keymap.c` to reflect your desired layout.
-* Compile your new custom firmware (`$ make KEYMAP=<your_layout>`)
+* Compile your new custom firmware (`$ make <your_layout>`)
 ** If you have warnings you may flash without fixing them, but something may not work right.
 ** If you have any errors you must fix them before continuing.
-* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
+* Flash the firmware (`$ make <your_layout>-dfu`)
 
 ## Share Your Keymap
 
index 80a942d06f7cc35dc8abf7a43d371a2381a84204..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,5 +1,3 @@
-BACKLIGHT_ENABLE = no
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/clueboard/rev1/rules.mk b/keyboards/clueboard/rev1/rules.mk
new file mode 100644 (file)
index 0000000..80a942d
--- /dev/null
@@ -0,0 +1,5 @@
+BACKLIGHT_ENABLE = no
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
index cea967b7955c7958daea51ae2380494d782922fc..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,5 +1,3 @@
-BACKLIGHT_ENABLE = yes
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/clueboard/rev2/rules.mk b/keyboards/clueboard/rev2/rules.mk
new file mode 100644 (file)
index 0000000..cea967b
--- /dev/null
@@ -0,0 +1,5 @@
+BACKLIGHT_ENABLE = yes
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
diff --git a/keyboards/clueboard/rules.mk b/keyboards/clueboard/rules.mk
new file mode 100644 (file)
index 0000000..3909fbd
--- /dev/null
@@ -0,0 +1,103 @@
+#----------------------------------------------------------------------------
+# 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 = 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 ?= no  # 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
+NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+AUDIO_ENABLE ?= no
+RGBLIGHT_ENABLE ?= no   # Enable keyboard underlight functionality
+MIDI_ENABLE ?= no              # MIDI controls
+UNICODE_ENABLE ?= no           # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
\ No newline at end of file
index 029d0b96700a70c62131a8263e1546bdf9eea1a0..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,76 +1,3 @@
-
-
-# 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
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # 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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-RGBLIGHT_ENABLE ?= yes       # Enable keyboard underlight functionality (+4870)
-BACKLIGHT_ENABLE ?= yes       # Enable keyboard backlight functionality by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= yes           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
index ae1afbbfddb179364ca070adab7e512430100edf..be13fc01713cbb21b1c52e653a9addee55358d6f 100644 (file)
@@ -13,16 +13,16 @@ Depending on which keymap you would like to use, you will have to compile slight
 
 ### Default
 
-To build with the default keymap, simply run `make`.
+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 a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
 
-To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
 
 ```
-$ make keymap=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 
 Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
diff --git a/keyboards/cluecard/rules.mk b/keyboards/cluecard/rules.mk
new file mode 100644 (file)
index 0000000..4542358
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+# 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
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # 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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+RGBLIGHT_ENABLE ?= yes       # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= yes       # Enable keyboard backlight functionality by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= yes           # Audio output on port C6
index a331ff4dcd97b9a66fa8ddc990f1f89529459ca4..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,70 +1,3 @@
-
-# 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
-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 numpad's backlight functionality
-RGBLIGHT_ENABLE ?= yes
-# MIDI_ENABLE ?= YES           # MIDI controls
-# UNICODE_ENABLE ?= YES                # Unicode
-# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/cluepad/rules.mk b/keyboards/cluepad/rules.mk
new file mode 100644 (file)
index 0000000..19b16b9
--- /dev/null
@@ -0,0 +1,65 @@
+
+# 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
+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 numpad's backlight functionality
+RGBLIGHT_ENABLE ?= yes
+# MIDI_ENABLE ?= YES           # MIDI controls
+# UNICODE_ENABLE ?= YES                # Unicode
+# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
\ No newline at end of file
index 05fb588d110b8333bd6da8eb23eaf3b2fda34e4a..7165350050a6296d0f6cfec18d16b7341b051cda 100644 (file)
@@ -1,34 +1,5 @@
-#----------------------------------------------------------------------------
-# On command line:
-#
-# make = Make software.
-#
-# make clean = Clean out built project files.
-#
-# That's pretty much all you need. To compile, always go make clean, 
-# followed by make.
-#
-# For advanced users only:
-# make teensy = Download the hex file to the device, using teensy_loader_cli.
-#               (must have teensy_loader_cli installed).
-#
-#----------------------------------------------------------------------------
 SUBPROJECT_DEFAULT = ez
 
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE ?= no  # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE  ?= yes # Mouse keys(+4700)
-EXTRAKEY_ENABLE  ?= yes # Audio control and System control(+450)
-CONSOLE_ENABLE   ?= no  # Console for debug(+400)
-COMMAND_ENABLE   ?= yes # Commands for debug and configuration
-CUSTOM_MATRIX    ?= yes # Custom matrix file for the ErgoDox EZ
-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
-MIDI_ENABLE      ?= no  # MIDI controls
-UNICODE_ENABLE   ?= yes # Unicode
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
index 37e554b30457804a43576c2c13856f5ab6ee35dc..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,76 +1,3 @@
-#----------------------------------------------------------------------------
-# On command line:
-#
-# make = Make software.
-#
-# make clean = Clean out built project files.
-#
-# That's pretty much all you need. To compile, always go make clean, 
-# followed by make.
-#
-# For advanced users only:
-# make teensy = Download the hex file to the device, using teensy_loader_cli.
-#               (must have teensy_loader_cli installed).
-#
-#----------------------------------------------------------------------------
-
-# # project specific files
-SRC = twimaster.c \
-         matrix.c
-
-# MCU name
-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=512
-
-
-# Build Options
-#   comment out to disable the options.
-#
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk
new file mode 100644 (file)
index 0000000..37e554b
--- /dev/null
@@ -0,0 +1,76 @@
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make = Make software.
+#
+# make clean = Clean out built project files.
+#
+# That's pretty much all you need. To compile, always go make clean, 
+# followed by make.
+#
+# For advanced users only:
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+#               (must have teensy_loader_cli installed).
+#
+#----------------------------------------------------------------------------
+
+# # project specific files
+SRC = twimaster.c \
+         matrix.c
+
+# MCU name
+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=512
+
+
+# Build Options
+#   comment out to disable the options.
+#
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
index ccb735a485beede2222294951d429ab0e754dc79..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,77 +1,3 @@
-# project specific files
-SRC =  matrix.c \
-       led.c
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-# - For Infinity KB, SERIES = K20x
-MCU_FAMILY = KINETIS
-MCU_SERIES = K20x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-#   - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
-#   - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
-MCU_LDSCRIPT = MK20DX256BLDR8
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0 and Infinity 60%
-#   - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
-MCU_STARTUP = k20x7
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-#   - MCHCK_K20 for Infinity KB
-#BOARD = MCHCK_K20
-BOARD = PJRC_TEENSY_3_1
-
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m4
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 7
-
-# Vector table for application
-# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
-# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
-OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
-
-# Build Options
-#   comment out to disable the options.
-#
-CUSTOM_MATRIX ?= yes # Custom matrix file
-SERIAL_LINK_ENABLE = yes
-VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
-LCD_ENABLE ?= yes
-LED_ENABLE ?= yes
-LCD_BACKLIGHT_ENABLE ?= yes
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
-
-ifdef LCD_ENABLE
-include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
-endif
-
-ifdef LED_ENABLE
-include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk
new file mode 100644 (file)
index 0000000..ccb735a
--- /dev/null
@@ -0,0 +1,77 @@
+# project specific files
+SRC =  matrix.c \
+       led.c
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+# - For Infinity KB, SERIES = K20x
+MCU_FAMILY = KINETIS
+MCU_SERIES = K20x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+#   - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
+#   - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
+MCU_LDSCRIPT = MK20DX256BLDR8
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0 and Infinity 60%
+#   - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
+MCU_STARTUP = k20x7
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+#   - MCHCK_K20 for Infinity KB
+#BOARD = MCHCK_K20
+BOARD = PJRC_TEENSY_3_1
+
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m4
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 7
+
+# Vector table for application
+# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
+# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
+OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
+
+# Build Options
+#   comment out to disable the options.
+#
+CUSTOM_MATRIX ?= yes # Custom matrix file
+SERIAL_LINK_ENABLE = yes
+VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
+LCD_ENABLE ?= yes
+LED_ENABLE ?= yes
+LCD_BACKLIGHT_ENABLE ?= yes
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
+
+ifdef LCD_ENABLE
+include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
+endif
+
+ifdef LED_ENABLE
+include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
+endif
index b113ca7dd2fd5cdc7b1e4b918cac5e1d9f0828b5..3bbe98fd699b1532d182e0f9fca88ca88d09ac3a 100644 (file)
@@ -72,9 +72,7 @@ Some distributions provide a binary, maybe called `teensy-loader-cli`).
 
 To flash the firmware:
 
-  - Build the firmware with `make keymap=keymapname`, for example `make
-    keymap=default`
-
+  - Build the firmware with `make keymapname`, for example `make default` 
   - This will result in a hex file called `ergodox_ez_keymapname.hex`, e.g.
     `ergodox_ez_default.hex`
 
@@ -92,21 +90,21 @@ To flash the firmware:
 The Infinity is two completely independent keyboards, and needs to be flashed
 for the left and right halves seperately.  To flash them:
 
-  - Build the firmware with `make keymap=keymapname subproject=infinity`
+  - Build the firmware with `make infinity-keymapname`
 
   - Plug in the left hand keyboard only.
 
   - Press the program button (back of keyboard, above thumb pad).
 
-  - Install the firmware with `sudo make dfu-util keymap=keymapname subproject=infinity`
+  - Install the firmware with `sudo make infinity-keymapname-dfu-util`
 
-  - Build left hand firmware with `make keymap=keymapname subproject=infinity MASTER=right`
+  - Build left hand firmware with `make infinity-keymapname MASTER=right`
 
   - Plug in the right hand keyboard only.
 
   - Press the program button (back of keyboard, above thumb pad).
 
-  - Install the firmware with `sudo make dfu-util keymap=keymapname subproject=infinity MASTER=right`
+  - Install the firmware with `sudo make infinity-keymapname-dfu-util MASTER=right`
 
 More information on the Infinity firmware is available in the [TMK/chibios for
 Input Club Infinity Ergodox](https://github.com/fredizzimo/infinity_ergodox/blob/master/README.md)
diff --git a/keyboards/ergodox/rules.mk b/keyboards/ergodox/rules.mk
new file mode 100644 (file)
index 0000000..ac63d4e
--- /dev/null
@@ -0,0 +1,28 @@
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make = Make software.
+#
+# make clean = Clean out built project files.
+#
+# That's pretty much all you need. To compile, always go make clean, 
+# followed by make.
+#
+# For advanced users only:
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+#               (must have teensy_loader_cli installed).
+#
+#----------------------------------------------------------------------------
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE ?= no  # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE  ?= yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE  ?= yes # Audio control and System control(+450)
+CONSOLE_ENABLE   ?= no  # Console for debug(+400)
+COMMAND_ENABLE   ?= yes # Commands for debug and configuration
+CUSTOM_MATRIX    ?= yes # Custom matrix file for the ErgoDox EZ
+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
+MIDI_ENABLE      ?= no  # MIDI controls
+UNICODE_ENABLE   ?= yes # Unicode
index 39a9cc0ae1caa9204284c01c754ea897d2a69018..57b2ef62e5f3a43b7338f789a5d4800c577b763d 100644 (file)
@@ -1,74 +1,3 @@
-\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
-\r
-\r
-ifndef QUANTUM_DIR\r
-       include ../../Makefile\r
-endif\r
-\r
+ifndef MAKEFILE_INCLUDED
+       include ../../Makefile
+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 92302d507ccb4d22d9e70b17bc4bc9104fe162ea..8c744bfd3c5327e44111cf0dfa23d579614ce878 100644 (file)
@@ -1,60 +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`.\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 `KEYMAP` option like:\r
-```\r
-$ make KEYMAP=[default|jack|<name>]\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.
diff --git a/keyboards/gh60/rules.mk b/keyboards/gh60/rules.mk
new file mode 100644 (file)
index 0000000..aba680e
--- /dev/null
@@ -0,0 +1,66 @@
+# 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
index 711759917370a6886c1e3e79a9fde4c7a5fff1f7..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,73 +1,3 @@
-
-# MCU name
-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=512
-
-
-# Build Options
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # 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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
-
-
+endif
\ No newline at end of file
diff --git a/keyboards/handwired/CMD60/rules.mk b/keyboards/handwired/CMD60/rules.mk
new file mode 100644 (file)
index 0000000..7117599
--- /dev/null
@@ -0,0 +1,73 @@
+
+# MCU name
+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=512
+
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # 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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
+
+
index 57493a47caffa019f6112be7d716a01f18e7b6ab..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,3 +1,3 @@
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
index 711759917370a6886c1e3e79a9fde4c7a5fff1f7..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,73 +1,3 @@
-
-# MCU name
-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=512
-
-
-# Build Options
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # 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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
-
-
+endif
\ No newline at end of file
diff --git a/keyboards/handwired/fivethirteen/rules.mk b/keyboards/handwired/fivethirteen/rules.mk
new file mode 100644 (file)
index 0000000..7117599
--- /dev/null
@@ -0,0 +1,73 @@
+
+# MCU name
+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=512
+
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # 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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
+
+
index 155c1f9a296fff6fbebdc5876b8331354fd5c8e8..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,71 +1,3 @@
-# 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=512
-
-# Build Options
-#   change to "no" to disable the options, or define them in the Makefile in 
-#   the appropriate keymap folder that will get included automatically
-#
-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 ?= no         # Console for debug(+400)
-COMMAND_ENABLE ?= yes        # Commands for debug and configuration
-NKRO_ENABLE ?= yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality
-MIDI_ENABLE ?= no            # MIDI controls
-AUDIO_ENABLE ?= no           # Audio output on port C6
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE ?= yes       # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/handwired/minorca/rules.mk b/keyboards/handwired/minorca/rules.mk
new file mode 100644 (file)
index 0000000..c51371a
--- /dev/null
@@ -0,0 +1,67 @@
+# 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=512
+
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+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 ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= yes        # Commands for debug and configuration
+NKRO_ENABLE ?= yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no            # MIDI controls
+AUDIO_ENABLE ?= no           # Audio output on port C6
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= yes       # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
\ No newline at end of file
index c6d10856a187c74e24d0c916c83f406418128090..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,65 +1,3 @@
-
-
-# MCU name
-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 ?= no # 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
-#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-#NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk
new file mode 100644 (file)
index 0000000..c6d1085
--- /dev/null
@@ -0,0 +1,65 @@
+
+
+# MCU name
+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 ?= no # 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
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/handwired/rules.mk b/keyboards/handwired/rules.mk
new file mode 100644 (file)
index 0000000..e69de29
index 12a4b71f4e13e2eebea753d346231d16b1572c9e..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,89 +1,3 @@
-
-#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
-
-# for avr upload
-USB ?= /dev/cu.usbmodem1421
-#
-# 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)
-
-
-ifdef TEENSY2
-    OPT_DEFS += -DATREUS_TEENSY2
-    ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
-else
-    OPT_DEFS += -DATREUS_ASTAR
-    OPT_DEFS += -DCATERINA_BOOTLOADER
-    ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
-                            avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
-endif
-# Interrupt driven control endpoint task(+60)
-OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
-
-
-# MCU name
-
-# 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
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
-EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no        # Console for debug(+400)
-COMMAND_ENABLE ?= no        # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-RGBLIGHT_ENABLE = yes
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
-endif
-
-upload: build
-       $(ATREUS_UPLOAD_COMMAND)
-
+endif
\ No newline at end of file
diff --git a/keyboards/handwired/traveller/rules.mk b/keyboards/handwired/traveller/rules.mk
new file mode 100644 (file)
index 0000000..12a4b71
--- /dev/null
@@ -0,0 +1,89 @@
+
+#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
+
+# for avr upload
+USB ?= /dev/cu.usbmodem1421
+#
+# 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)
+
+
+ifdef TEENSY2
+    OPT_DEFS += -DATREUS_TEENSY2
+    ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
+else
+    OPT_DEFS += -DATREUS_ASTAR
+    OPT_DEFS += -DCATERINA_BOOTLOADER
+    ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
+                            avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
+endif
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# MCU name
+
+# 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
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no        # Console for debug(+400)
+COMMAND_ENABLE ?= no        # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+RGBLIGHT_ENABLE = yes
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
+
+upload: build
+       $(ATREUS_UPLOAD_COMMAND)
+
index 6fe973e1ebb6892e542e618d4a3e783cf586664a..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,90 +1,3 @@
-
-
-# project specific files
-SRC = matrix.c
-
-# 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
-
-# as per original hasu settings
-OPT_DEFS += -DBOOTLOADER_SIZE=512
-
-# 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
-CUSTOM_MATRIX    ?= yes # Custom matrix file for the HHKB
-# 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
-
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-ifneq (, $(findstring yes, $(HHKB_JP)))
-       OPT_DEFS += -DHHKB_JP
-endif
-
-debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION
-debug-on: all
-
-debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT
-debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS))
-debug-off: all
+endif
\ No newline at end of file
index 39d49b32a1766312c361e1cbdbf7cf77300ff93e..367c0a08f7e51b866594ad3d7608f31f46bfe34a 100644 (file)
@@ -168,13 +168,15 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder
 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`.
+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 a file in the keymaps folder named `<name>.c` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/hhkb/rules.mk b/keyboards/hhkb/rules.mk
new file mode 100644 (file)
index 0000000..b43b5e2
--- /dev/null
@@ -0,0 +1,84 @@
+
+
+# project specific files
+SRC = matrix.c
+
+# 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
+
+# as per original hasu settings
+OPT_DEFS += -DBOOTLOADER_SIZE=512
+
+# 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
+CUSTOM_MATRIX    ?= yes # Custom matrix file for the HHKB
+# 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
+
+ifneq (, $(findstring yes, $(HHKB_JP)))
+       OPT_DEFS += -DHHKB_JP
+endif
+
+debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION
+debug-on: all
+
+debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT
+debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS))
+debug-off: all
diff --git a/keyboards/infinity60/MEMO.txt b/keyboards/infinity60/MEMO.txt
new file mode 100644 (file)
index 0000000..e2886aa
--- /dev/null
@@ -0,0 +1,385 @@
+flabbergast's TMK/ChibiOS port
+==============================
+2015/10/16
+
+
+Build
+-----
+$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git
+
+$ cd tmk_keyboard
+$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
+or
+$ cd tmk_keyboard/tmk_core/tool/chibios
+$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
+
+$ cd tmk_keyboard/keyboard/infinity_chibios
+$ make
+
+
+
+
+Chibios Configuration
+---------------------
+halconf.h: for HAL configuration
+    placed in project directory
+    read in chibios/os/hal/hal.mk
+    included in chibios/os/hal/include/hal.h
+mcuconf.h: for MCU configuration
+    placed in project directory
+    included in halconf.h
+
+
+Chibios Term
+------------
+PAL = Port Abstraction Layer
+    palWritePad
+    palReadPad
+    palSetPad
+    chibios/os/hal/include/pal.h
+
+LLD = Low Level Driver
+
+
+Makefile
+--------
+    #   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+    MCU_FAMILY = KINETIS
+    MCU_SERIES = KL2x
+
+    # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+    #   or <this_dir>/ld/
+    MCU_LDSCRIPT = MKL26Z64
+
+    #  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+    MCU_STARTUP = kl2x
+
+    # Board: it should exist either in <chibios>/os/hal/boards/
+    #  or <this_dir>/boards
+    BOARD = PJRC_TEENSY_LC
+
+    MCU  = cortex-m0
+
+    # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+    ARMV = 6
+
+
+halconf.h
+---------
+
+
+mcuconf.h
+---------
+
+
+chconf.h
+--------
+
+
+ld script
+---------
+--- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld     2015-10-15 09:08:58.732904304 +0900
++++ ld/MKL26Z64.ld      2015-10-15 08:48:06.430215496 +0900
+@@ -27,7 +27,8 @@
+ {
+   flash0   :  org = 0x00000000,  len = 0xc0
+   flashcfg :  org = 0x00000400,  len = 0x10
+-  flash    :  org = 0x00000410,  len = 64k - 0x410
++  flash    :  org = 0x00000410,  len = 62k - 0x410
++  eeprom_emu : org = 0x0000F800, len = 2k
+   ram      :  org = 0x1FFFF800,  len = 8k
+ }
+
+@@ -35,6 +36,10 @@
+ __ram_size__            = LENGTH(ram);
+ __ram_end__             = __ram_start__ + __ram_size__;
+
++__eeprom_workarea_start__ = ORIGIN(eeprom_emu);
++__eeprom_workarea_size__  = LENGTH(eeprom_emu);
++__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;
++
+ SECTIONS
+ {
+   . = 0;
+
+
+
+Configuration/Startup for Infinity 60%
+--------------------------------------
+Configuration:
+
+
+Clock:
+Inifinity   
+    FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz
+    Clock dividor:
+    SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock
+    SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock
+    SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock
+    Internal reference clock:
+    MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL
+    MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable
+    FLL multipilication:
+    MCG_C4[DMX32] = 1
+    MCG_C4[DRST_DRS] = 01   FLL factor 1464 * 32.768kHz = 48MHz
+
+chibios/os/hal/ports/KINETIS/K20x/hal_lld.c
+    k20x_clock_init(): called in __early_init() defined in board.c
+        disable watchdog and configure clock
+
+        configurable macros:
+        KINETIS_NO_INIT: whether init or not
+        KINETIS_MCG_MODE: clock mode   
+            KINETIS_MCG_MODE_FEI
+            KINETIS_MCG_MODE_PEE
+                hal/ports/KINETIS/K20x/hal_lld.h
+            
+
+chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h
+    PALConfig pal_default_config
+    boardInit()
+    __early_init()
+    macro definitions for board infos, freq and mcu type
+
+chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c
+
+USB
+
+
+Startup
+-------
+    common/ports/ARMCMx/GCC/crt0_v[67]m.s
+        Reset_Handler: startup code
+    common/ports/ARMCMx/GCC/crt1.c
+        __core_init(): weak
+        __early_init(): weak
+        __late_init(): weak
+        __default_exit(): weak
+            called from Reset_Handler of crt0
+    common/ports/ARMCMx/GCC/vector.c
+    common/ports/ARMCMx/GCC/ld/*.ld
+
+chibios/os/common/ports/ARMCMx/compilers/GCC/
+├── crt0_v6m.s
+├── crt0_v7m.s
+├── crt1.c
+├── ld
+│   â”œâ”€â”€ MK20DX128BLDR3.ld
+│   â”œâ”€â”€ MK20DX128BLDR4.ld
+│   â”œâ”€â”€ MK20DX128.ld
+│   â”œâ”€â”€ MK20DX256.ld
+│   â”œâ”€â”€ MKL25Z128.ld
+│   â”œâ”€â”€ MKL26Z128.ld
+│   â”œâ”€â”€ MKL26Z64.ld
+│   â””── STM32L476xG.ld
+├── mk
+│   â”œâ”€â”€ startup_k20x5.mk
+│   â”œâ”€â”€ startup_k20x7.mk
+│   â”œâ”€â”€ startup_k20x.mk
+│   â”œâ”€â”€ startup_kl2x.mk
+│   â””── startup_stm32l4xx.mk
+├── rules.ld
+├── rules.mk
+└── vectors.c
+
+chibios/os/hal/
+├── boards
+│   â”œâ”€â”€ FREESCALE_FREEDOM_K20D50M
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ MCHCK_K20
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ PJRC_TEENSY_3
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ PJRC_TEENSY_3_1
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ PJRC_TEENSY_LC
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ readme.txt
+│   â”œâ”€â”€ simulator
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â””── board.mk
+│   â”œâ”€â”€ ST_NUCLEO_F030R8
+│   â”‚   â”œâ”€â”€ board.c
+│   â”‚   â”œâ”€â”€ board.h
+│   â”‚   â”œâ”€â”€ board.mk
+│   â”‚   â””── cfg
+│   â”‚       â””── board.chcfg
+├── hal.mk
+├── include
+│   â”œâ”€â”€ adc.h
+│   â”œâ”€â”€ can.h
+│   â”œâ”€â”€ dac.h
+│   â”œâ”€â”€ ext.h
+│   â”œâ”€â”€ gpt.h
+│   â”œâ”€â”€ hal_channels.h
+│   â”œâ”€â”€ hal_files.h
+│   â”œâ”€â”€ hal.h
+│   â”œâ”€â”€ hal_ioblock.h
+│   â”œâ”€â”€ hal_mmcsd.h
+│   â”œâ”€â”€ hal_queues.h
+│   â”œâ”€â”€ hal_streams.h
+│   â”œâ”€â”€ i2c.h
+│   â”œâ”€â”€ i2s.h
+│   â”œâ”€â”€ icu.h
+│   â”œâ”€â”€ mac.h
+│   â”œâ”€â”€ mii.h
+│   â”œâ”€â”€ mmc_spi.h
+│   â”œâ”€â”€ pal.h
+│   â”œâ”€â”€ pwm.h
+│   â”œâ”€â”€ rtc.h
+│   â”œâ”€â”€ sdc.h
+│   â”œâ”€â”€ serial.h
+│   â”œâ”€â”€ serial_usb.h
+│   â”œâ”€â”€ spi.h
+│   â”œâ”€â”€ st.h
+│   â”œâ”€â”€ uart.h
+│   â””── usb.h
+├── lib
+│   â””── streams
+│       â”œâ”€â”€ chprintf.c
+│       â”œâ”€â”€ chprintf.h
+│       â”œâ”€â”€ memstreams.c
+│       â”œâ”€â”€ memstreams.h
+│       â”œâ”€â”€ nullstreams.c
+│       â””── nullstreams.h
+├── osal
+│   â”œâ”€â”€ nil
+│   â”‚   â”œâ”€â”€ osal.c
+│   â”‚   â”œâ”€â”€ osal.h
+│   â”‚   â””── osal.mk
+│   â”œâ”€â”€ os-less
+│   â”‚   â””── ARMCMx
+│   â”‚       â”œâ”€â”€ osal.c
+│   â”‚       â”œâ”€â”€ osal.h
+│   â”‚       â””── osal.mk
+│   â””── rt
+│       â”œâ”€â”€ osal.c
+│       â”œâ”€â”€ osal.h
+│       â””── osal.mk
+├── ports
+│   â”œâ”€â”€ AVR
+│   â”œâ”€â”€ common
+│   â”‚   â””── ARMCMx
+│   â”‚       â”œâ”€â”€ mpu.h
+│   â”‚       â”œâ”€â”€ nvic.c
+│   â”‚       â””── nvic.h
+│   â”œâ”€â”€ KINETIS
+│   â”‚   â”œâ”€â”€ K20x
+│   â”‚   â”‚   â”œâ”€â”€ hal_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ hal_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ kinetis_registry.h
+│   â”‚   â”‚   â”œâ”€â”€ platform.dox
+│   â”‚   â”‚   â”œâ”€â”€ platform.mk
+│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ spi_lld.c
+│   â”‚   â”‚   â””── spi_lld.h
+│   â”‚   â”œâ”€â”€ KL2x
+│   â”‚   â”‚   â”œâ”€â”€ hal_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ hal_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ kinetis_registry.h
+│   â”‚   â”‚   â”œâ”€â”€ platform.mk
+│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.c
+│   â”‚   â”‚   â””── pwm_lld.h
+│   â”‚   â”œâ”€â”€ LLD
+│   â”‚   â”‚   â”œâ”€â”€ adc_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ adc_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ ext_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ ext_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ gpt_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ gpt_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ i2c_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ i2c_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ pal_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ pal_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ serial_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ serial_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ st_lld.c
+│   â”‚   â”‚   â”œâ”€â”€ st_lld.h
+│   â”‚   â”‚   â”œâ”€â”€ usb_lld.c
+│   â”‚   â”‚   â””── usb_lld.h
+│   â”‚   â””── README.md
+│   â”œâ”€â”€ LPC
+│   â”œâ”€â”€ simulator
+│   â””── STM32
+├── src
+│   â”œâ”€â”€ adc.c
+│   â”œâ”€â”€ can.c
+│   â”œâ”€â”€ dac.c
+│   â”œâ”€â”€ ext.c
+│   â”œâ”€â”€ gpt.c
+│   â”œâ”€â”€ hal.c
+│   â”œâ”€â”€ hal_mmcsd.c
+│   â”œâ”€â”€ hal_queues.c
+│   â”œâ”€â”€ i2c.c
+│   â”œâ”€â”€ i2s.c
+│   â”œâ”€â”€ icu.c
+│   â”œâ”€â”€ mac.c
+│   â”œâ”€â”€ mmc_spi.c
+│   â”œâ”€â”€ pal.c
+│   â”œâ”€â”€ pwm.c
+│   â”œâ”€â”€ rtc.c
+│   â”œâ”€â”€ sdc.c
+│   â”œâ”€â”€ serial.c
+│   â”œâ”€â”€ serial_usb.c
+│   â”œâ”€â”€ spi.c
+│   â”œâ”€â”€ st.c
+│   â”œâ”€â”€ uart.c
+│   â””── usb.c
+└── templates
+    â”œâ”€â”€ adc_lld.c
+    â”œâ”€â”€ adc_lld.h
+    â”œâ”€â”€ can_lld.c
+    â”œâ”€â”€ can_lld.h
+    â”œâ”€â”€ dac_lld.c
+    â”œâ”€â”€ dac_lld.h
+    â”œâ”€â”€ ext_lld.c
+    â”œâ”€â”€ ext_lld.h
+    â”œâ”€â”€ gpt_lld.c
+    â”œâ”€â”€ gpt_lld.h
+    â”œâ”€â”€ halconf.h
+    â”œâ”€â”€ hal_lld.c
+    â”œâ”€â”€ hal_lld.h
+    â”œâ”€â”€ i2c_lld.c
+    â”œâ”€â”€ i2c_lld.h
+    â”œâ”€â”€ i2s_lld.c
+    â”œâ”€â”€ i2s_lld.h
+    â”œâ”€â”€ icu_lld.c
+    â”œâ”€â”€ icu_lld.h
+    â”œâ”€â”€ mac_lld.c
+    â”œâ”€â”€ mac_lld.h
+    â”œâ”€â”€ mcuconf.h
+    â”œâ”€â”€ osal
+    â”‚   â”œâ”€â”€ osal.c
+    â”‚   â”œâ”€â”€ osal.h
+    â”‚   â””── osal.mk
+    â”œâ”€â”€ pal_lld.c
+    â”œâ”€â”€ pal_lld.h
+    â”œâ”€â”€ platform.mk
+    â”œâ”€â”€ pwm_lld.c
+    â”œâ”€â”€ pwm_lld.h
+    â”œâ”€â”€ rtc_lld.c
+    â”œâ”€â”€ rtc_lld.h
+    â”œâ”€â”€ sdc_lld.c
+    â”œâ”€â”€ sdc_lld.h
+    â”œâ”€â”€ serial_lld.c
+    â”œâ”€â”€ serial_lld.h
+    â”œâ”€â”€ spi_lld.c
+    â”œâ”€â”€ spi_lld.h
+    â”œâ”€â”€ st_lld.c
+    â”œâ”€â”€ st_lld.h
+    â”œâ”€â”€ uart_lld.c
+    â”œâ”€â”€ uart_lld.h
+    â”œâ”€â”€ usb_lld.c
+    â””── usb_lld.h
diff --git a/keyboards/infinity60/Makefile b/keyboards/infinity60/Makefile
new file mode 100644 (file)
index 0000000..4e2a6f0
--- /dev/null
@@ -0,0 +1,3 @@
+ifndef MAKEFILE_INCLUDED
+       include ../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/infinity60/bootloader_defs.h b/keyboards/infinity60/bootloader_defs.h
new file mode 100644 (file)
index 0000000..c67153b
--- /dev/null
@@ -0,0 +1 @@
+#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity60/chconf.h b/keyboards/infinity60/chconf.h
new file mode 100644 (file)
index 0000000..43c8457
--- /dev/null
@@ -0,0 +1,524 @@
+/*
+    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 */
+
+/** @} */
diff --git a/keyboards/infinity60/config.h b/keyboards/infinity60/config.h
new file mode 100644 (file)
index 0000000..f8346fe
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+Copyright 2015 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
+
+#define PREVENT_STUCK_MODIFIERS
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6464
+#define DEVICE_VER      0x0001
+/* in python2: list(u"whatever".encode('utf-16-le')) */
+/*   at most 32 characters or the ugly hack in usb_main.c borks */
+#define MANUFACTURER "Input Club"
+#define USBSTR_MANUFACTURER    'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00'
+#define PRODUCT "Infinity keyboard/QMK"
+#define USBSTR_PRODUCT         'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00'
+/* key matrix size */
+#define MATRIX_ROWS 9
+#define MATRIX_COLS 7
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCE    5
+
+/* 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
+
+/* key combination for command */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+/* Keymap for Infinity prototype */
+//#define INFINITY_PROTOTYPE
+
+/* Keymap for Infinity 1.1a (first revision with LED support) */
+//#define INFINITY_LED
+
+/*
+ * 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
diff --git a/keyboards/infinity60/halconf.h b/keyboards/infinity60/halconf.h
new file mode 100644 (file)
index 0000000..46b37a4
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+    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_ */
+
+/** @} */
diff --git a/keyboards/infinity60/infinity60.c b/keyboards/infinity60/infinity60.c
new file mode 100644 (file)
index 0000000..e471250
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+Copyright 2012,2013 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/>.
+*/
+#include "infinity60.h"
diff --git a/keyboards/infinity60/infinity60.h b/keyboards/infinity60/infinity60.h
new file mode 100644 (file)
index 0000000..f1ba15e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+Copyright 2014 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 KEYMAP_COMMON_H
+#define KEYMAP_COMMON_H
+
+#include "quantum.h"
+
+#ifdef INFINITY_PROTOTYPE
+
+/* Infinity prototype */
+#define KEYMAP( \
+    K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K86, \
+    K51, K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, \
+    K13, K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, \
+    K54, K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, \
+    K06, K16, K26,           K36,                K46, K56, K66, K76 \
+) { \
+    { K00, K01, K02, K03, K04, K05, K06 }, \
+    { K10, K11, K12, K13, K14, K15, K16 }, \
+    { K20, K21, K22, K23, K24, K25, K26 }, \
+    { K30, K31, K32, K33, K34, K35, K36 }, \
+    { K40, K41, K42, K43, K44, K45, K46 }, \
+    { K50, K51, K52, K53, K54, K55, K56 }, \
+    { K60, K61, K62, K63, K64, K65, K66 }, \
+    { K70, K71, K72, K73, K74, K75, K76 }, \
+    { K80, K81, K82, K83, K84, K85, K86 }  \
+}
+
+#else
+
+/* Infinity production */
+#define KEYMAP( \
+    K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, \
+    K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, \
+    K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, \
+    K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, K06, \
+    K16, K26, K36,           K46,                K56, K66, K76, K86 \
+) { \
+    { K00, K01, K02, K03, K04, K05, K06 }, \
+    { K10, K11, K12, K13, K14, K15, K16 }, \
+    { K20, K21, K22, K23, K24, K25, K26 }, \
+    { K30, K31, K32, K33, K34, K35, K36 }, \
+    { K40, K41, K42, K43, K44, K45, K46 }, \
+    { K50, K51, K52, K53, K54, K55, K56 }, \
+    { K60, K61, K62, K63, K64, K65, K66 }, \
+    { K70, K71, K72, K73, K74, K75, K76 }, \
+    { K80, K81, K82, K83, K84, K85, K86 }  \
+}
+
+#endif
+
+#endif
diff --git a/keyboards/infinity60/keymaps/default/keymap.c b/keyboards/infinity60/keymaps/default/keymap.c
new file mode 100644 (file)
index 0000000..4434128
--- /dev/null
@@ -0,0 +1,48 @@
+#include "infinity60.h"
+
+const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Layer 0: Default Layer
+     * ,-----------------------------------------------------------.
+     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  `|BSp|
+     * |-----------------------------------------------------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
+     * |-----------------------------------------------------------|
+     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
+     * |-----------------------------------------------------------|
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
+     * |-----------------------------------------------------------'
+     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
+     * `-----------------------------------------------------------'
+     */
+    [0] = KEYMAP(
+      KC_ESC, KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,   KC_MINS,KC_EQL, KC_BSLS, KC_GRV, \
+      KC_TAB, KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,   KC_LBRC,KC_RBRC,KC_BSPC, \
+      KC_LCTL,KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,KC_QUOT,KC_ENT,  \
+      KC_LSFT,KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,MO(1), \
+      KC_NO,  KC_LGUI,KC_LALT,          KC_SPC,                KC_RALT,KC_RGUI,KC_NO, KC_NO),
+
+    /* Layer 1: HHKB mode (HHKB Fn)
+     * ,-----------------------------------------------------------.
+     * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
+     * |-----------------------------------------------------------|
+     * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
+     * |-----------------------------------------------------------|
+     * |      |VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
+     * |-----------------------------------------------------------|
+     * |        |   |   |   |   |   |  +|  -|End|PgD|Dow|      |   |
+     * `-----------------------------------------------------------'
+     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
+     * `-----------------------------------------------------------'
+     */ 
+    [1] = KEYMAP(
+      KC_PWR, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,   \
+      KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC,      \
+      KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT,            \
+      KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS,            \
+      KC_TRNS,KC_TRNS,KC_TRNS,          KC_TRNS,               KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
+};
+
+const uint16_t fn_actions[] = {
+    
+};
+
diff --git a/keyboards/infinity60/keymaps/depariel/keymap.c b/keyboards/infinity60/keymaps/depariel/keymap.c
new file mode 100755 (executable)
index 0000000..7412b9b
--- /dev/null
@@ -0,0 +1,82 @@
+#include "infinity60.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Layer 0: Default Layer
+     * ,-----------------------------------------------------------.
+     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|
+     * |-----------------------------------------------------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Bksp|
+     * |-----------------------------------------------------------|
+     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
+     * |-----------------------------------------------------------|
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn2|
+     * |-----------------------------------------------------------'
+     * |Fn2 |Gui |Alt |         Space           |RAlt|Prv|PlPs|Next|
+     * `-----------------------------------------------------------'
+     */
+    [0] = KEYMAP(
+        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,            KC_BSLS,  KC_GRV, \
+        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC,           KC_BSPC, \
+        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, LT(5, KC_ENT),  \
+        KC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSPC, MO(4), \
+        MO(4),   KC_LGUI, KC_LALT,               LT(3, KC_SPC),                 KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT),
+
+    /* Layer 1: "Toggle" off SpaceFn for League of Legends
+     */
+    [1] = KEYMAP(
+        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSLS,  KC_GRV, \
+        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSPC, \
+        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_ENT,  \
+        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT, MO(4), \
+        MO(4),   KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT),
+           
+    /* Layer 2: "Toggle" off SpaceFn for MapleRoyals
+     */
+    [2] = KEYMAP(
+        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSLS,  KC_GRV, \
+        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSPC, \
+        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_ENT,  \
+        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_UP,   KC_LSFT, \
+        MO(4),   KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT),
+
+    /* Layer 3: FN layer 1
+     */ 
+    [3] = KEYMAP(
+        KC_NO,           KC_F1,   KC_F2,   KC_F3,   KC_F4,          KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NO,   KC_NO,   \
+        KC_NO,           KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4),    KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP,   KC_NO,   KC_LPRN, KC_RPRN, KC_DEL,      \
+        MO(6),           KC_MS_L, KC_MS_D, KC_MS_R, KC_NO,          KC_END,  KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO,   KC_NO,           \
+        LGUI(KC_SPC),    KC_NO,   KC_NO,   KC_NO,   KC_NO,          KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_CALC, KC_MENU, KC_TRNS, TG(4),           \
+        KC_TRNS,         KC_TRNS, KC_TRNS,                       LT(3, KC_SPC),                KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU),
+    
+    /* Layer 4: FN layer 2
+     */ 
+    [4] = KEYMAP(
+        KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_PMNS, KC_PPLS, KC_PSLS, TG(2),   \
+        KC_CAPS, KC_NO,   KC_UP,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_PSCR, KC_NO,   KC_P7,   KC_P8,   KC_P9,   KC_PAST, KC_BSPC,      \
+        KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_P4,   KC_P5,   KC_P6,   KC_PENT,           \
+        KC_LSFT, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_P1,   KC_P2,   KC_P3,   KC_RSFT, MO(4),           \
+        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                   KC_P0,   KC_PDOT, KC_NO,   TG(1)),
+    
+    /* Layer 5: FN layer 3
+     */ 
+    [5] = KEYMAP(
+        KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,            KC_NO,   KC_NO,   \
+        KC_TAB , KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_NO,            KC_TRNS,      \
+        KC_TRNS, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F17,  KC_F18,  KC_F19,  KC_F20,  LT(5, KC_ENT),           \
+        KC_TRNS, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F21,  KC_F22,  KC_F23,  KC_F24,  KC_TRNS, KC_TRNS,           \
+        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                   KC_RALT, KC_NO,   KC_NO,  KC_NO),
+    
+    /* Layer 6: FN layer 4
+     */ 
+    [6] = KEYMAP(
+        KC_NO,                 KC_NO,            KC_NO,          KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   \
+        LCTL(LSFT(KC_TAB)),    KC_NO,            LGUI(KC_UP),    KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,      \
+        MO(6),                 LGUI(KC_LEFT),    LGUI(KC_DOWN),  LGUI(KC_RGHT),    KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,       \
+        KC_TRNS,               KC_NO,            KC_NO,          KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_TRNS, KC_TRNS,           \
+        KC_TRNS,               KC_TRNS,          KC_TRNS,                   KC_TRNS,                 KC_TRNS, KC_NO,   KC_NO,   KC_NO),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+
+};
+
diff --git a/keyboards/infinity60/keymaps/hasu/keymap.c b/keyboards/infinity60/keymaps/hasu/keymap.c
new file mode 100644 (file)
index 0000000..d372886
--- /dev/null
@@ -0,0 +1,113 @@
+#include "infinity60.h"
+
+const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Layer 0: Default Layer
+     * ,-----------------------------------------------------------.
+     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  `|BSp|
+     * |-----------------------------------------------------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
+     * |-----------------------------------------------------------|
+     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
+     * |-----------------------------------------------------------|
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
+     * |-----------------------------------------------------------'
+     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
+     * `-----------------------------------------------------------'
+     */
+    [0] = KEYMAP(
+        KC_ESC,    KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,           KC_MINS,KC_EQL, KC_BSLS,KC_GRV, \
+        KC_TAB,    KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,           KC_LBRC,KC_RBRC,KC_BSPC, \
+        KC_LCTL,   KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,   LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \
+        OSM(MOD_LSFT), KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \
+        KC_NO,     KC_LGUI,KC_LALT,         LT(4, KC_SPC),                 MO(4),  KC_RGUI,KC_NO,          KC_NO),
+
+    /* Layer 1: HHKB mode (HHKB Fn)
+     * ,-----------------------------------------------------------.
+     * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
+     * |-----------------------------------------------------------|
+     * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
+     * |-----------------------------------------------------------|
+     * |      |VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
+     * |-----------------------------------------------------------|
+     * |        |   |   |   |   |   |  +|  -|End|PgD|Dow|      |   |
+     * `-----------------------------------------------------------'
+     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
+     * `-----------------------------------------------------------'
+     */ 
+    [1] = KEYMAP(
+        KC_PWR, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
+        KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,  KC_TRNS,KC_BSPC, \
+        KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \
+        KC_LSFT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_RSFT,KC_TRNS, \
+        KC_TRNS,KC_LGUI,KC_LALT,          KC_TRNS,                      KC_RALT,KC_RGUI,KC_TRNS,KC_TRNS),
+
+    /* Layer 2: Vi mode[Slash]
+     * ,-----------------------------------------------------------.
+     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
+     * |-----------------------------------------------------------|
+     * |Tab  |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd|   |   |   |Backs|
+     * |-----------------------------------------------------------|
+     * |Contro|   |Lef|Dow|Rig|   |Lef|Dow|Up |Rig|   |   |Return  |
+     * |-----------------------------------------------------------|
+     * |Shift   |   |   |   |   |   |Hom|PgD|PgUlEnd|Fn0|Shift |   |
+     * `-----------------------------------------------------------'
+     *       |Gui|Alt  |          Space        |Alt  |Gui|
+     *       `-------------------------------------------'
+     */
+    [2] = KEYMAP(
+        KC_GRV, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10,         KC_F11, KC_F12, KC_INS, KC_DEL, \
+        KC_TAB, KC_HOME,KC_PGDN,KC_UP,  KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO,          KC_NO,  KC_NO,  KC_BSPC, \
+        KC_LCTL,KC_NO,  KC_LEFT,KC_DOWN,KC_RGHT,KC_NO,  KC_LEFT,KC_DOWN,KC_UP,  KC_RGHT,KC_NO,          KC_NO,  KC_ENT, \
+        KC_LSFT,KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_HOME,KC_PGDN,KC_PGUP,KC_END, LT(2, KC_SLSH), KC_RSFT,KC_TRNS, \
+        KC_TRNS,KC_LGUI,KC_LALT,          KC_SPC,                       KC_RALT,KC_RGUI,KC_TRNS,        KC_TRNS),
+
+    /* Layer 3: Mouse mode(IJKL)[Semicolon]
+     * ,-----------------------------------------------------------.
+     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
+     * |-----------------------------------------------------------|
+     * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
+     * |-----------------------------------------------------------|
+     * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Fn |   |Return  |
+     * |-----------------------------------------------------------|
+     * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
+     * `-----------------------------------------------------------'
+     *      |Gui |Alt  |          Mb1          |Fn   |Fn |
+     *      `--------------------------------------------'
+     * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
+     */
+    [3] = KEYMAP(
+        KC_GRV,       KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,          KC_F9,          KC_F10,         KC_F11,         KC_F12,        KC_INS, KC_DEL, \
+        LALT(KC_TAB), KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_WH_L,KC_WH_D,KC_MS_U,        KC_WH_U,        KC_WH_R,        ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \
+        KC_LCTL,      KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO,  KC_NO,  KC_MS_L,KC_MS_D,        KC_MS_R,        LT(3, KC_SCLN), KC_NO,          KC_ENT, \
+        KC_LSFT,      KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT), ALT_T(KC_RGHT), KC_NO,          KC_RSFT,        KC_TRNS, \
+        KC_TRNS,      KC_LGUI,KC_LALT,          KC_BTN1,                      KC_TRNS,        KC_TRNS,        KC_TRNS,        KC_TRNS),
+
+    /* Layer 4: Mouse mode(IJKL)[Space]
+     * ,-----------------------------------------------------------.
+     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
+     * |-----------------------------------------------------------|
+     * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
+     * |-----------------------------------------------------------|
+     * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Mb1|   |Return  |
+     * |-----------------------------------------------------------|
+     * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
+     * `-----------------------------------------------------------'
+     *      |Gui |Alt  |          Mb1          |Fn   |Fn |
+     *      `--------------------------------------------'
+     * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
+     */
+    [4] = KEYMAP(
+        KC_GRV,       KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,         KC_F9,         KC_F10, KC_F11, KC_F12, KC_INS,       KC_DEL, \
+        LALT(KC_TAB), KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_WH_L,KC_WH_D,KC_MS_U,       KC_WH_U,       KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \
+        KC_LCTL,      KC_VOLD,KC_VOLU,KC_MUTE,KC_NO,  KC_NO,  KC_NO,  KC_MS_L,KC_MS_D,       KC_MS_R,       KC_BTN1,KC_NO,  KC_ENT, \
+        KC_LSFT,      KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT),ALT_T(KC_RGHT),KC_NO,  KC_RSFT,KC_TRNS, \
+        KC_TRNS,      KC_LGUI,KC_LALT,          KC_TRNS,                      KC_TRNS,       KC_TRNS,       KC_TRNS,KC_TRNS),
+
+};
+
+/*
+ * Fn action definition
+ */
+const uint16_t fn_actions[] = {
+
+};
diff --git a/keyboards/infinity60/led.c b/keyboards/infinity60/led.c
new file mode 100644 (file)
index 0000000..aed66c7
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+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/>.
+*/
+
+#include "hal.h"
+
+#include "led.h"
+
+
+void led_set(uint8_t usb_led) {
+}
diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c
new file mode 100644 (file)
index 0000000..62c165a
--- /dev/null
@@ -0,0 +1,171 @@
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include "hal.h"
+#include "timer.h"
+#include "wait.h"
+#include "print.h"
+#include "matrix.h"
+
+
+/*
+ * Infinity Pinusage:
+ * Column pins are input with internal pull-down. Row pins are output and strobe with high.
+ * Key is high or 1 when it turns on.
+ *  INFINITY PRODUCTION (NO LED)
+ *     col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 }
+ *     row: { PTB0, PTB1, PTB2, PTB3, PTB16, PTB17, PTC4, PTC5, PTD0 }
+ *  INFINITY PRODUCTION (WITH LED)
+ *     col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 }
+ *     row: { PTC0, PTC1, PTC2, PTC3, PTC4, PTC5, PTC6, PTC7, PTD0 }
+ */
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+static bool debouncing = false;
+static uint16_t debouncing_time = 0;
+
+
+void matrix_init(void)
+{
+    /* Column(sense) */
+    palSetPadMode(GPIOD, 1,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 2,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 3,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 4,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 5,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 6,  PAL_MODE_INPUT_PULLDOWN);
+    palSetPadMode(GPIOD, 7,  PAL_MODE_INPUT_PULLDOWN);
+
+#ifdef INFINITY_LED
+    /* Row(strobe) */
+    palSetPadMode(GPIOC, 0,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 1,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 2,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 3,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 4,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 5,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 6,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 7,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOD, 0,  PAL_MODE_OUTPUT_PUSHPULL);
+#else
+    /* Row(strobe) */
+    palSetPadMode(GPIOB, 0,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOB, 1,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOB, 2,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOB, 3,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOB, 17, PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 4,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOC, 5,  PAL_MODE_OUTPUT_PUSHPULL);
+    palSetPadMode(GPIOD, 0,  PAL_MODE_OUTPUT_PUSHPULL);
+#endif
+    memset(matrix, 0, MATRIX_ROWS);
+    memset(matrix_debouncing, 0, MATRIX_ROWS);
+}
+
+uint8_t matrix_scan(void)
+{
+    for (int row = 0; row < MATRIX_ROWS; row++) {
+        matrix_row_t data = 0;
+    #ifdef INFINITY_LED
+        // strobe row
+        switch (row) {
+            case 0: palSetPad(GPIOC, 0);    break;
+            case 1: palSetPad(GPIOC, 1);    break;
+            case 2: palSetPad(GPIOC, 2);    break;
+            case 3: palSetPad(GPIOC, 3);    break;
+            case 4: palSetPad(GPIOC, 4);    break;
+            case 5: palSetPad(GPIOC, 5);    break;
+            case 6: palSetPad(GPIOC, 6);    break;
+            case 7: palSetPad(GPIOC, 7);    break;
+            case 8: palSetPad(GPIOD, 0);    break;
+        }
+    #else
+        // strobe row
+        switch (row) {
+            case 0: palSetPad(GPIOB, 0);    break;
+            case 1: palSetPad(GPIOB, 1);    break;
+            case 2: palSetPad(GPIOB, 2);    break;
+            case 3: palSetPad(GPIOB, 3);    break;
+            case 4: palSetPad(GPIOB, 16);   break;
+            case 5: palSetPad(GPIOB, 17);   break;
+            case 6: palSetPad(GPIOC, 4);    break;
+            case 7: palSetPad(GPIOC, 5);    break;
+            case 8: palSetPad(GPIOD, 0);    break;
+        }
+    #endif
+
+        wait_us(1); // need wait to settle pin state
+
+        // read col data
+        data = (palReadPort(GPIOD)>>1);
+    #ifdef INFINITY_LED
+        // un-strobe row
+        switch (row) {
+            case 0: palClearPad(GPIOC, 0);    break;
+            case 1: palClearPad(GPIOC, 1);    break;
+            case 2: palClearPad(GPIOC, 2);    break;
+            case 3: palClearPad(GPIOC, 3);    break;
+            case 4: palClearPad(GPIOC, 4);    break;
+            case 5: palClearPad(GPIOC, 5);    break;
+            case 6: palClearPad(GPIOC, 6);    break;
+            case 7: palClearPad(GPIOC, 7);    break;
+            case 8: palClearPad(GPIOD, 0);    break;
+        }
+    #else
+        // un-strobe row
+        switch (row) {
+            case 0: palClearPad(GPIOB, 0);    break;
+            case 1: palClearPad(GPIOB, 1);    break;
+            case 2: palClearPad(GPIOB, 2);    break;
+            case 3: palClearPad(GPIOB, 3);    break;
+            case 4: palClearPad(GPIOB, 16);   break;
+            case 5: palClearPad(GPIOB, 17);   break;
+            case 6: palClearPad(GPIOC, 4);    break;
+            case 7: palClearPad(GPIOC, 5);    break;
+            case 8: palClearPad(GPIOD, 0);    break;
+        }
+    #endif
+
+        if (matrix_debouncing[row] != data) {
+            matrix_debouncing[row] = data;
+            debouncing = true;
+            debouncing_time = timer_read();
+        }
+    }
+
+    if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
+        for (int row = 0; row < MATRIX_ROWS; row++) {
+            matrix[row] = matrix_debouncing[row];
+        }
+        debouncing = false;
+    }
+    return 1;
+}
+
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+    return (matrix[row] & (1<<col));
+}
+
+matrix_row_t matrix_get_row(uint8_t row)
+{
+    return matrix[row];
+}
+
+void matrix_print(void)
+{
+    xprintf("\nr/c 01234567\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        xprintf("%02X: ");
+        matrix_row_t data = matrix_get_row(row);
+        for (int col = 0; col < MATRIX_COLS; col++) {
+            if (data & (1<<col))
+                xprintf("1");
+            else
+                xprintf("0");
+        }
+        xprintf("\n");
+    }
+}
diff --git a/keyboards/infinity60/mcuconf.h b/keyboards/infinity60/mcuconf.h
new file mode 100644 (file)
index 0000000..f453304
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+    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_ */
diff --git a/keyboards/infinity60/readme.md b/keyboards/infinity60/readme.md
new file mode 100644 (file)
index 0000000..97457b4
--- /dev/null
@@ -0,0 +1,29 @@
+Infinity 60% keyboard firmware
+======================
+
+## Quantum MK Firmware
+
+For the full Quantum feature list, see [the parent readme](/).
+
+## Keymaps
+
+Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
+
+Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
+
+
+## Compiling
+
+Download or clone the whole firmware and navigate to the keyboards/infinity60 folder. Once your dev env is setup, you'll be able to use the `make` command to both compile your keymap and flash it to your keyboard.
+
+To just compile, which generates the output files in the `.build` folder at the root of the repository, run `make keymap`, where keymap is the name of the keymap that you want to compile.
+
+## Flashing
+
+To flash the firmware to the keyboard
+
+1. First press the flash button on the bottom of the keyboard. If you already have a flah button mapped in a keyboard layout running on the keyboard, you can also use that.
+2. Then run `make keymap-dfu-util`, where keymap is the name of the keymap you want to flash. On Linux based operating systems you might need to run the comamnd as root, for example `sudo make keymap-dfu-util` on Ubuntu.
+
+**Tip** `make keymap-dfu-util` will also compile the keymap if needed, so you can skip the compilation step if you want to.
+
diff --git a/keyboards/infinity60/rules.mk b/keyboards/infinity60/rules.mk
new file mode 100644 (file)
index 0000000..56d6470
--- /dev/null
@@ -0,0 +1,66 @@
+# project specific files
+SRC =  matrix.c \
+       led.c
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+# - For Infinity KB, SERIES = K20x
+MCU_FAMILY = KINETIS
+MCU_SERIES = K20x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+#   - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
+MCU_LDSCRIPT = MK20DX128BLDR4
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0 and Infinity KB
+#   - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = k20x5
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+#   - MCHCK_K20 for Infinity KB
+BOARD = MCHCK_K20
+
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m4
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 7
+
+# Vector table for application
+# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
+# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
+OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE ?= yes        # Virtual DIP switch configuration
+## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
+MOUSEKEY_ENABLE ?= yes # Mouse keys
+EXTRAKEY_ENABLE ?= yes # Audio control and System control
+CONSOLE_ENABLE ?= yes  # Console for debug
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= yes         # USB Nkey Rollover
+CUSTOM_MATRIX ?= yes # Custom matrix file
\ No newline at end of file
diff --git a/keyboards/infinity_chibios/MEMO.txt b/keyboards/infinity_chibios/MEMO.txt
deleted file mode 100644 (file)
index e2886aa..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-flabbergast's TMK/ChibiOS port
-==============================
-2015/10/16
-
-
-Build
------
-$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git
-
-$ cd tmk_keyboard
-$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
-or
-$ cd tmk_keyboard/tmk_core/tool/chibios
-$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
-
-$ cd tmk_keyboard/keyboard/infinity_chibios
-$ make
-
-
-
-
-Chibios Configuration
----------------------
-halconf.h: for HAL configuration
-    placed in project directory
-    read in chibios/os/hal/hal.mk
-    included in chibios/os/hal/include/hal.h
-mcuconf.h: for MCU configuration
-    placed in project directory
-    included in halconf.h
-
-
-Chibios Term
-------------
-PAL = Port Abstraction Layer
-    palWritePad
-    palReadPad
-    palSetPad
-    chibios/os/hal/include/pal.h
-
-LLD = Low Level Driver
-
-
-Makefile
---------
-    #   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-    MCU_FAMILY = KINETIS
-    MCU_SERIES = KL2x
-
-    # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-    #   or <this_dir>/ld/
-    MCU_LDSCRIPT = MKL26Z64
-
-    #  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-    MCU_STARTUP = kl2x
-
-    # Board: it should exist either in <chibios>/os/hal/boards/
-    #  or <this_dir>/boards
-    BOARD = PJRC_TEENSY_LC
-
-    MCU  = cortex-m0
-
-    # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-    ARMV = 6
-
-
-halconf.h
----------
-
-
-mcuconf.h
----------
-
-
-chconf.h
---------
-
-
-ld script
----------
---- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld     2015-10-15 09:08:58.732904304 +0900
-+++ ld/MKL26Z64.ld      2015-10-15 08:48:06.430215496 +0900
-@@ -27,7 +27,8 @@
- {
-   flash0   :  org = 0x00000000,  len = 0xc0
-   flashcfg :  org = 0x00000400,  len = 0x10
--  flash    :  org = 0x00000410,  len = 64k - 0x410
-+  flash    :  org = 0x00000410,  len = 62k - 0x410
-+  eeprom_emu : org = 0x0000F800, len = 2k
-   ram      :  org = 0x1FFFF800,  len = 8k
- }
-
-@@ -35,6 +36,10 @@
- __ram_size__            = LENGTH(ram);
- __ram_end__             = __ram_start__ + __ram_size__;
-
-+__eeprom_workarea_start__ = ORIGIN(eeprom_emu);
-+__eeprom_workarea_size__  = LENGTH(eeprom_emu);
-+__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;
-+
- SECTIONS
- {
-   . = 0;
-
-
-
-Configuration/Startup for Infinity 60%
---------------------------------------
-Configuration:
-
-
-Clock:
-Inifinity   
-    FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz
-    Clock dividor:
-    SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock
-    SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock
-    SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock
-    Internal reference clock:
-    MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL
-    MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable
-    FLL multipilication:
-    MCG_C4[DMX32] = 1
-    MCG_C4[DRST_DRS] = 01   FLL factor 1464 * 32.768kHz = 48MHz
-
-chibios/os/hal/ports/KINETIS/K20x/hal_lld.c
-    k20x_clock_init(): called in __early_init() defined in board.c
-        disable watchdog and configure clock
-
-        configurable macros:
-        KINETIS_NO_INIT: whether init or not
-        KINETIS_MCG_MODE: clock mode   
-            KINETIS_MCG_MODE_FEI
-            KINETIS_MCG_MODE_PEE
-                hal/ports/KINETIS/K20x/hal_lld.h
-            
-
-chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h
-    PALConfig pal_default_config
-    boardInit()
-    __early_init()
-    macro definitions for board infos, freq and mcu type
-
-chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c
-
-USB
-
-
-Startup
--------
-    common/ports/ARMCMx/GCC/crt0_v[67]m.s
-        Reset_Handler: startup code
-    common/ports/ARMCMx/GCC/crt1.c
-        __core_init(): weak
-        __early_init(): weak
-        __late_init(): weak
-        __default_exit(): weak
-            called from Reset_Handler of crt0
-    common/ports/ARMCMx/GCC/vector.c
-    common/ports/ARMCMx/GCC/ld/*.ld
-
-chibios/os/common/ports/ARMCMx/compilers/GCC/
-├── crt0_v6m.s
-├── crt0_v7m.s
-├── crt1.c
-├── ld
-│   â”œâ”€â”€ MK20DX128BLDR3.ld
-│   â”œâ”€â”€ MK20DX128BLDR4.ld
-│   â”œâ”€â”€ MK20DX128.ld
-│   â”œâ”€â”€ MK20DX256.ld
-│   â”œâ”€â”€ MKL25Z128.ld
-│   â”œâ”€â”€ MKL26Z128.ld
-│   â”œâ”€â”€ MKL26Z64.ld
-│   â””── STM32L476xG.ld
-├── mk
-│   â”œâ”€â”€ startup_k20x5.mk
-│   â”œâ”€â”€ startup_k20x7.mk
-│   â”œâ”€â”€ startup_k20x.mk
-│   â”œâ”€â”€ startup_kl2x.mk
-│   â””── startup_stm32l4xx.mk
-├── rules.ld
-├── rules.mk
-└── vectors.c
-
-chibios/os/hal/
-├── boards
-│   â”œâ”€â”€ FREESCALE_FREEDOM_K20D50M
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ MCHCK_K20
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ PJRC_TEENSY_3
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ PJRC_TEENSY_3_1
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ PJRC_TEENSY_LC
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ readme.txt
-│   â”œâ”€â”€ simulator
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â””── board.mk
-│   â”œâ”€â”€ ST_NUCLEO_F030R8
-│   â”‚   â”œâ”€â”€ board.c
-│   â”‚   â”œâ”€â”€ board.h
-│   â”‚   â”œâ”€â”€ board.mk
-│   â”‚   â””── cfg
-│   â”‚       â””── board.chcfg
-├── hal.mk
-├── include
-│   â”œâ”€â”€ adc.h
-│   â”œâ”€â”€ can.h
-│   â”œâ”€â”€ dac.h
-│   â”œâ”€â”€ ext.h
-│   â”œâ”€â”€ gpt.h
-│   â”œâ”€â”€ hal_channels.h
-│   â”œâ”€â”€ hal_files.h
-│   â”œâ”€â”€ hal.h
-│   â”œâ”€â”€ hal_ioblock.h
-│   â”œâ”€â”€ hal_mmcsd.h
-│   â”œâ”€â”€ hal_queues.h
-│   â”œâ”€â”€ hal_streams.h
-│   â”œâ”€â”€ i2c.h
-│   â”œâ”€â”€ i2s.h
-│   â”œâ”€â”€ icu.h
-│   â”œâ”€â”€ mac.h
-│   â”œâ”€â”€ mii.h
-│   â”œâ”€â”€ mmc_spi.h
-│   â”œâ”€â”€ pal.h
-│   â”œâ”€â”€ pwm.h
-│   â”œâ”€â”€ rtc.h
-│   â”œâ”€â”€ sdc.h
-│   â”œâ”€â”€ serial.h
-│   â”œâ”€â”€ serial_usb.h
-│   â”œâ”€â”€ spi.h
-│   â”œâ”€â”€ st.h
-│   â”œâ”€â”€ uart.h
-│   â””── usb.h
-├── lib
-│   â””── streams
-│       â”œâ”€â”€ chprintf.c
-│       â”œâ”€â”€ chprintf.h
-│       â”œâ”€â”€ memstreams.c
-│       â”œâ”€â”€ memstreams.h
-│       â”œâ”€â”€ nullstreams.c
-│       â””── nullstreams.h
-├── osal
-│   â”œâ”€â”€ nil
-│   â”‚   â”œâ”€â”€ osal.c
-│   â”‚   â”œâ”€â”€ osal.h
-│   â”‚   â””── osal.mk
-│   â”œâ”€â”€ os-less
-│   â”‚   â””── ARMCMx
-│   â”‚       â”œâ”€â”€ osal.c
-│   â”‚       â”œâ”€â”€ osal.h
-│   â”‚       â””── osal.mk
-│   â””── rt
-│       â”œâ”€â”€ osal.c
-│       â”œâ”€â”€ osal.h
-│       â””── osal.mk
-├── ports
-│   â”œâ”€â”€ AVR
-│   â”œâ”€â”€ common
-│   â”‚   â””── ARMCMx
-│   â”‚       â”œâ”€â”€ mpu.h
-│   â”‚       â”œâ”€â”€ nvic.c
-│   â”‚       â””── nvic.h
-│   â”œâ”€â”€ KINETIS
-│   â”‚   â”œâ”€â”€ K20x
-│   â”‚   â”‚   â”œâ”€â”€ hal_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ hal_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ kinetis_registry.h
-│   â”‚   â”‚   â”œâ”€â”€ platform.dox
-│   â”‚   â”‚   â”œâ”€â”€ platform.mk
-│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ spi_lld.c
-│   â”‚   â”‚   â””── spi_lld.h
-│   â”‚   â”œâ”€â”€ KL2x
-│   â”‚   â”‚   â”œâ”€â”€ hal_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ hal_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ kinetis_registry.h
-│   â”‚   â”‚   â”œâ”€â”€ platform.mk
-│   â”‚   â”‚   â”œâ”€â”€ pwm_lld.c
-│   â”‚   â”‚   â””── pwm_lld.h
-│   â”‚   â”œâ”€â”€ LLD
-│   â”‚   â”‚   â”œâ”€â”€ adc_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ adc_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ ext_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ ext_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ gpt_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ gpt_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ i2c_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ i2c_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ pal_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ pal_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ serial_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ serial_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ st_lld.c
-│   â”‚   â”‚   â”œâ”€â”€ st_lld.h
-│   â”‚   â”‚   â”œâ”€â”€ usb_lld.c
-│   â”‚   â”‚   â””── usb_lld.h
-│   â”‚   â””── README.md
-│   â”œâ”€â”€ LPC
-│   â”œâ”€â”€ simulator
-│   â””── STM32
-├── src
-│   â”œâ”€â”€ adc.c
-│   â”œâ”€â”€ can.c
-│   â”œâ”€â”€ dac.c
-│   â”œâ”€â”€ ext.c
-│   â”œâ”€â”€ gpt.c
-│   â”œâ”€â”€ hal.c
-│   â”œâ”€â”€ hal_mmcsd.c
-│   â”œâ”€â”€ hal_queues.c
-│   â”œâ”€â”€ i2c.c
-│   â”œâ”€â”€ i2s.c
-│   â”œâ”€â”€ icu.c
-│   â”œâ”€â”€ mac.c
-│   â”œâ”€â”€ mmc_spi.c
-│   â”œâ”€â”€ pal.c
-│   â”œâ”€â”€ pwm.c
-│   â”œâ”€â”€ rtc.c
-│   â”œâ”€â”€ sdc.c
-│   â”œâ”€â”€ serial.c
-│   â”œâ”€â”€ serial_usb.c
-│   â”œâ”€â”€ spi.c
-│   â”œâ”€â”€ st.c
-│   â”œâ”€â”€ uart.c
-│   â””── usb.c
-└── templates
-    â”œâ”€â”€ adc_lld.c
-    â”œâ”€â”€ adc_lld.h
-    â”œâ”€â”€ can_lld.c
-    â”œâ”€â”€ can_lld.h
-    â”œâ”€â”€ dac_lld.c
-    â”œâ”€â”€ dac_lld.h
-    â”œâ”€â”€ ext_lld.c
-    â”œâ”€â”€ ext_lld.h
-    â”œâ”€â”€ gpt_lld.c
-    â”œâ”€â”€ gpt_lld.h
-    â”œâ”€â”€ halconf.h
-    â”œâ”€â”€ hal_lld.c
-    â”œâ”€â”€ hal_lld.h
-    â”œâ”€â”€ i2c_lld.c
-    â”œâ”€â”€ i2c_lld.h
-    â”œâ”€â”€ i2s_lld.c
-    â”œâ”€â”€ i2s_lld.h
-    â”œâ”€â”€ icu_lld.c
-    â”œâ”€â”€ icu_lld.h
-    â”œâ”€â”€ mac_lld.c
-    â”œâ”€â”€ mac_lld.h
-    â”œâ”€â”€ mcuconf.h
-    â”œâ”€â”€ osal
-    â”‚   â”œâ”€â”€ osal.c
-    â”‚   â”œâ”€â”€ osal.h
-    â”‚   â””── osal.mk
-    â”œâ”€â”€ pal_lld.c
-    â”œâ”€â”€ pal_lld.h
-    â”œâ”€â”€ platform.mk
-    â”œâ”€â”€ pwm_lld.c
-    â”œâ”€â”€ pwm_lld.h
-    â”œâ”€â”€ rtc_lld.c
-    â”œâ”€â”€ rtc_lld.h
-    â”œâ”€â”€ sdc_lld.c
-    â”œâ”€â”€ sdc_lld.h
-    â”œâ”€â”€ serial_lld.c
-    â”œâ”€â”€ serial_lld.h
-    â”œâ”€â”€ spi_lld.c
-    â”œâ”€â”€ spi_lld.h
-    â”œâ”€â”€ st_lld.c
-    â”œâ”€â”€ st_lld.h
-    â”œâ”€â”€ uart_lld.c
-    â”œâ”€â”€ uart_lld.h
-    â”œâ”€â”€ usb_lld.c
-    â””── usb_lld.h
diff --git a/keyboards/infinity_chibios/Makefile b/keyboards/infinity_chibios/Makefile
deleted file mode 100644 (file)
index 649b43e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# project specific files
-SRC =  matrix.c \
-       led.c
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-# - For Infinity KB, SERIES = K20x
-MCU_FAMILY = KINETIS
-MCU_SERIES = K20x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-#   - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
-MCU_LDSCRIPT = MK20DX128BLDR4
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0 and Infinity KB
-#   - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = k20x5
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-#   - MCHCK_K20 for Infinity KB
-BOARD = MCHCK_K20
-
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m4
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 7
-
-# Vector table for application
-# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
-# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
-OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE ?= yes        # Virtual DIP switch configuration
-## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-CONSOLE_ENABLE ?= yes  # Console for debug
-COMMAND_ENABLE ?= yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes         # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
-ifndef QUANTUM_DIR
-       include ../../Makefile
-endif
\ No newline at end of file
diff --git a/keyboards/infinity_chibios/bootloader_defs.h b/keyboards/infinity_chibios/bootloader_defs.h
deleted file mode 100644 (file)
index c67153b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity_chibios/chconf.h b/keyboards/infinity_chibios/chconf.h
deleted file mode 100644 (file)
index b886c38..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*\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
diff --git a/keyboards/infinity_chibios/config.h b/keyboards/infinity_chibios/config.h
deleted file mode 100644 (file)
index 452cc2a..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-Copyright 2015 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
-
-#define PREVENT_STUCK_MODIFIERS
-
-/* USB Device descriptor parameter */
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6464
-#define DEVICE_VER      0x0001
-/* in python2: list(u"whatever".encode('utf-16-le')) */
-/*   at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER    'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "Infinity keyboard/TMK"
-#define USBSTR_PRODUCT         'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00'
-
-/* key matrix size */
-#define MATRIX_ROWS 9
-#define MATRIX_COLS 7
-
-/* define if matrix has ghost */
-//#define MATRIX_HAS_GHOST
-
-/* Set 0 if debouncing isn't needed */
-#define DEBOUNCE    5
-
-/* 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
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-/* Keymap for Infinity prototype */
-//#define INFINITY_PROTOTYPE
-
-/* Keymap for Infinity 1.1a (first revision with LED support) */
-//#define INFINITY_LED
-
-/*
- * 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
diff --git a/keyboards/infinity_chibios/halconf.h b/keyboards/infinity_chibios/halconf.h
deleted file mode 100644 (file)
index 53538de..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-/*\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
diff --git a/keyboards/infinity_chibios/infinity_chibios.c b/keyboards/infinity_chibios/infinity_chibios.c
deleted file mode 100644 (file)
index 845eda0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-Copyright 2012,2013 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/>.
-*/
-#include "infinity_chibios.h"
diff --git a/keyboards/infinity_chibios/infinity_chibios.h b/keyboards/infinity_chibios/infinity_chibios.h
deleted file mode 100644 (file)
index f1ba15e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Copyright 2014 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 KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include "quantum.h"
-
-#ifdef INFINITY_PROTOTYPE
-
-/* Infinity prototype */
-#define KEYMAP( \
-    K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K86, \
-    K51, K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, \
-    K13, K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, \
-    K54, K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, \
-    K06, K16, K26,           K36,                K46, K56, K66, K76 \
-) { \
-    { K00, K01, K02, K03, K04, K05, K06 }, \
-    { K10, K11, K12, K13, K14, K15, K16 }, \
-    { K20, K21, K22, K23, K24, K25, K26 }, \
-    { K30, K31, K32, K33, K34, K35, K36 }, \
-    { K40, K41, K42, K43, K44, K45, K46 }, \
-    { K50, K51, K52, K53, K54, K55, K56 }, \
-    { K60, K61, K62, K63, K64, K65, K66 }, \
-    { K70, K71, K72, K73, K74, K75, K76 }, \
-    { K80, K81, K82, K83, K84, K85, K86 }  \
-}
-
-#else
-
-/* Infinity production */
-#define KEYMAP( \
-    K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, \
-    K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, \
-    K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, \
-    K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, K06, \
-    K16, K26, K36,           K46,                K56, K66, K76, K86 \
-) { \
-    { K00, K01, K02, K03, K04, K05, K06 }, \
-    { K10, K11, K12, K13, K14, K15, K16 }, \
-    { K20, K21, K22, K23, K24, K25, K26 }, \
-    { K30, K31, K32, K33, K34, K35, K36 }, \
-    { K40, K41, K42, K43, K44, K45, K46 }, \
-    { K50, K51, K52, K53, K54, K55, K56 }, \
-    { K60, K61, K62, K63, K64, K65, K66 }, \
-    { K70, K71, K72, K73, K74, K75, K76 }, \
-    { K80, K81, K82, K83, K84, K85, K86 }  \
-}
-
-#endif
-
-#endif
diff --git a/keyboards/infinity_chibios/keymaps/default/keymap.c b/keyboards/infinity_chibios/keymaps/default/keymap.c
deleted file mode 100644 (file)
index 5f3b46a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "infinity_chibios.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* Layer 0: Default Layer
-     * ,-----------------------------------------------------------.
-     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  `|BSp|
-     * |-----------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
-     * |-----------------------------------------------------------|
-     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
-     * |-----------------------------------------------------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
-     * |-----------------------------------------------------------'
-     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
-     * `-----------------------------------------------------------'
-     */
-    [0] = KEYMAP(
-      KC_ESC, KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,   KC_MINS,KC_EQL, KC_BSLS, KC_GRV, \
-      KC_TAB, KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,   KC_LBRC,KC_RBRC,KC_BSPC, \
-      KC_LCTL,KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,   KC_SCLN,KC_QUOT,KC_ENT,  \
-      KC_LSFT,KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,MO(1), \
-      KC_NO,  KC_LGUI,KC_LALT,          KC_SPC,                KC_RALT,KC_RGUI,KC_NO, KC_NO),
-
-    /* Layer 1: HHKB mode (HHKB Fn)
-     * ,-----------------------------------------------------------.
-     * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-     * |-----------------------------------------------------------|
-     * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
-     * |-----------------------------------------------------------|
-     * |      |VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
-     * |-----------------------------------------------------------|
-     * |        |   |   |   |   |   |  +|  -|End|PgD|Dow|      |   |
-     * `-----------------------------------------------------------'
-     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
-     * `-----------------------------------------------------------'
-     */ 
-    [1] = KEYMAP(
-      KC_PWR, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,   \
-      KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC,      \
-      KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT,            \
-      KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS,            \
-      KC_TRNS,KC_TRNS,KC_TRNS,          KC_TRNS,               KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
-};
-
-const uint16_t fn_actions[] = {
-    
-};
-
diff --git a/keyboards/infinity_chibios/keymaps/depariel/keymap.c b/keyboards/infinity_chibios/keymaps/depariel/keymap.c
deleted file mode 100755 (executable)
index e68891f..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "infinity_chibios.h"
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* Layer 0: Default Layer
-     * ,-----------------------------------------------------------.
-     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|
-     * |-----------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Bksp|
-     * |-----------------------------------------------------------|
-     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
-     * |-----------------------------------------------------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn2|
-     * |-----------------------------------------------------------'
-     * |Fn2 |Gui |Alt |         Space           |RAlt|Prv|PlPs|Next|
-     * `-----------------------------------------------------------'
-     */
-    [0] = KEYMAP(
-        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,            KC_BSLS,  KC_GRV, \
-        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC,           KC_BSPC, \
-        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, LT(5, KC_ENT),  \
-        KC_LSPO, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSPC, MO(4), \
-        MO(4),   KC_LGUI, KC_LALT,               LT(3, KC_SPC),                 KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT),
-
-    /* Layer 1: "Toggle" off SpaceFn for League of Legends
-     */
-    [1] = KEYMAP(
-        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSLS,  KC_GRV, \
-        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSPC, \
-        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_ENT,  \
-        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT, MO(4), \
-        MO(4),   KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT),
-           
-    /* Layer 2: "Toggle" off SpaceFn for MapleRoyals
-     */
-    [2] = KEYMAP(
-        KC_ESC,  KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_MINS, KC_EQL,  KC_BSLS,  KC_GRV, \
-        KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSPC, \
-        KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, KC_ENT,  \
-        KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_UP,   KC_LSFT, \
-        MO(4),   KC_LGUI, KC_LALT,                   KC_SPC,                    KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT),
-
-    /* Layer 3: FN layer 1
-     */ 
-    [3] = KEYMAP(
-        KC_NO,           KC_F1,   KC_F2,   KC_F3,   KC_F4,          KC_F5,   KC_F6,   KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_NO,   KC_NO,   \
-        KC_NO,           KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4),    KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP,   KC_NO,   KC_LPRN, KC_RPRN, KC_DEL,      \
-        MO(6),           KC_MS_L, KC_MS_D, KC_MS_R, KC_NO,          KC_END,  KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO,   KC_NO,           \
-        LGUI(KC_SPC),    KC_NO,   KC_NO,   KC_NO,   KC_NO,          KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_CALC, KC_MENU, KC_TRNS, TG(4),           \
-        KC_TRNS,         KC_TRNS, KC_TRNS,                       LT(3, KC_SPC),                KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU),
-    
-    /* Layer 4: FN layer 2
-     */ 
-    [4] = KEYMAP(
-        KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_PMNS, KC_PPLS, KC_PSLS, TG(2),   \
-        KC_CAPS, KC_NO,   KC_UP,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_PSCR, KC_NO,   KC_P7,   KC_P8,   KC_P9,   KC_PAST, KC_BSPC,      \
-        KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_P4,   KC_P5,   KC_P6,   KC_PENT,           \
-        KC_LSFT, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_P1,   KC_P2,   KC_P3,   KC_RSFT, MO(4),           \
-        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                   KC_P0,   KC_PDOT, KC_NO,   TG(1)),
-    
-    /* Layer 5: FN layer 3
-     */ 
-    [5] = KEYMAP(
-        KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,            KC_NO,   KC_NO,   \
-        KC_TAB , KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F13,  KC_F14,  KC_F15,  KC_F16,  KC_NO,            KC_TRNS,      \
-        KC_TRNS, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F17,  KC_F18,  KC_F19,  KC_F20,  LT(5, KC_ENT),           \
-        KC_TRNS, KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_F21,  KC_F22,  KC_F23,  KC_F24,  KC_TRNS, KC_TRNS,           \
-        KC_TRNS, KC_TRNS, KC_TRNS,                   KC_TRNS,                   KC_RALT, KC_NO,   KC_NO,  KC_NO),
-    
-    /* Layer 6: FN layer 4
-     */ 
-    [6] = KEYMAP(
-        KC_NO,                 KC_NO,            KC_NO,          KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   \
-        LCTL(LSFT(KC_TAB)),    KC_NO,            LGUI(KC_UP),    KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,      \
-        MO(6),                 LGUI(KC_LEFT),    LGUI(KC_DOWN),  LGUI(KC_RGHT),    KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,       \
-        KC_TRNS,               KC_NO,            KC_NO,          KC_NO,            KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_NO,   KC_TRNS, KC_TRNS,           \
-        KC_TRNS,               KC_TRNS,          KC_TRNS,                   KC_TRNS,                 KC_TRNS, KC_NO,   KC_NO,   KC_NO),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-
-};
-
diff --git a/keyboards/infinity_chibios/keymaps/hasu/keymap.c b/keyboards/infinity_chibios/keymaps/hasu/keymap.c
deleted file mode 100644 (file)
index a1954d2..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#include "infinity_chibios.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* Layer 0: Default Layer
-     * ,-----------------------------------------------------------.
-     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  `|BSp|
-     * |-----------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
-     * |-----------------------------------------------------------|
-     * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
-     * |-----------------------------------------------------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
-     * |-----------------------------------------------------------'
-     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
-     * `-----------------------------------------------------------'
-     */
-    [0] = KEYMAP(
-        KC_ESC,    KC_1,   KC_2,   KC_3,   KC_4,   KC_5,   KC_6,   KC_7,   KC_8,   KC_9,   KC_0,           KC_MINS,KC_EQL, KC_BSLS,KC_GRV, \
-        KC_TAB,    KC_Q,   KC_W,   KC_E,   KC_R,   KC_T,   KC_Y,   KC_U,   KC_I,   KC_O,   KC_P,           KC_LBRC,KC_RBRC,KC_BSPC, \
-        KC_LCTL,   KC_A,   KC_S,   KC_D,   KC_F,   KC_G,   KC_H,   KC_J,   KC_K,   KC_L,   LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \
-        OSM(MOD_LSFT), KC_Z,   KC_X,   KC_C,   KC_V,   KC_B,   KC_N,   KC_M,   KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \
-        KC_NO,     KC_LGUI,KC_LALT,         LT(4, KC_SPC),                 MO(4),  KC_RGUI,KC_NO,          KC_NO),
-
-    /* Layer 1: HHKB mode (HHKB Fn)
-     * ,-----------------------------------------------------------.
-     * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-     * |-----------------------------------------------------------|
-     * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
-     * |-----------------------------------------------------------|
-     * |      |VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
-     * |-----------------------------------------------------------|
-     * |        |   |   |   |   |   |  +|  -|End|PgD|Dow|      |   |
-     * `-----------------------------------------------------------'
-     * |     |Gui|Alt  |         Space         |Alt  |Gui|   |     |
-     * `-----------------------------------------------------------'
-     */ 
-    [1] = KEYMAP(
-        KC_PWR, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
-        KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,  KC_TRNS,KC_BSPC, \
-        KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \
-        KC_LSFT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_RSFT,KC_TRNS, \
-        KC_TRNS,KC_LGUI,KC_LALT,          KC_TRNS,                      KC_RALT,KC_RGUI,KC_TRNS,KC_TRNS),
-
-    /* Layer 2: Vi mode[Slash]
-     * ,-----------------------------------------------------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-     * |-----------------------------------------------------------|
-     * |Tab  |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd|   |   |   |Backs|
-     * |-----------------------------------------------------------|
-     * |Contro|   |Lef|Dow|Rig|   |Lef|Dow|Up |Rig|   |   |Return  |
-     * |-----------------------------------------------------------|
-     * |Shift   |   |   |   |   |   |Hom|PgD|PgUlEnd|Fn0|Shift |   |
-     * `-----------------------------------------------------------'
-     *       |Gui|Alt  |          Space        |Alt  |Gui|
-     *       `-------------------------------------------'
-     */
-    [2] = KEYMAP(
-        KC_GRV, KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,  KC_F9,  KC_F10,         KC_F11, KC_F12, KC_INS, KC_DEL, \
-        KC_TAB, KC_HOME,KC_PGDN,KC_UP,  KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO,          KC_NO,  KC_NO,  KC_BSPC, \
-        KC_LCTL,KC_NO,  KC_LEFT,KC_DOWN,KC_RGHT,KC_NO,  KC_LEFT,KC_DOWN,KC_UP,  KC_RGHT,KC_NO,          KC_NO,  KC_ENT, \
-        KC_LSFT,KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_HOME,KC_PGDN,KC_PGUP,KC_END, LT(2, KC_SLSH), KC_RSFT,KC_TRNS, \
-        KC_TRNS,KC_LGUI,KC_LALT,          KC_SPC,                       KC_RALT,KC_RGUI,KC_TRNS,        KC_TRNS),
-
-    /* Layer 3: Mouse mode(IJKL)[Semicolon]
-     * ,-----------------------------------------------------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-     * |-----------------------------------------------------------|
-     * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
-     * |-----------------------------------------------------------|
-     * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Fn |   |Return  |
-     * |-----------------------------------------------------------|
-     * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
-     * `-----------------------------------------------------------'
-     *      |Gui |Alt  |          Mb1          |Fn   |Fn |
-     *      `--------------------------------------------'
-     * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
-     */
-    [3] = KEYMAP(
-        KC_GRV,       KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,          KC_F9,          KC_F10,         KC_F11,         KC_F12,        KC_INS, KC_DEL, \
-        LALT(KC_TAB), KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_WH_L,KC_WH_D,KC_MS_U,        KC_WH_U,        KC_WH_R,        ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \
-        KC_LCTL,      KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO,  KC_NO,  KC_MS_L,KC_MS_D,        KC_MS_R,        LT(3, KC_SCLN), KC_NO,          KC_ENT, \
-        KC_LSFT,      KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT), ALT_T(KC_RGHT), KC_NO,          KC_RSFT,        KC_TRNS, \
-        KC_TRNS,      KC_LGUI,KC_LALT,          KC_BTN1,                      KC_TRNS,        KC_TRNS,        KC_TRNS,        KC_TRNS),
-
-    /* Layer 4: Mouse mode(IJKL)[Space]
-     * ,-----------------------------------------------------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-     * |-----------------------------------------------------------|
-     * |Tab  |   |   |   |   |   |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T|
-     * |-----------------------------------------------------------|
-     * |Contro|   |   |   |   |   |Mb2|McL|McD|McR|Mb1|   |Return  |
-     * |-----------------------------------------------------------|
-     * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
-     * `-----------------------------------------------------------'
-     *      |Gui |Alt  |          Mb1          |Fn   |Fn |
-     *      `--------------------------------------------'
-     * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
-     */
-    [4] = KEYMAP(
-        KC_GRV,       KC_F1,  KC_F2,  KC_F3,  KC_F4,  KC_F5,  KC_F6,  KC_F7,  KC_F8,         KC_F9,         KC_F10, KC_F11, KC_F12, KC_INS,       KC_DEL, \
-        LALT(KC_TAB), KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_WH_L,KC_WH_D,KC_MS_U,       KC_WH_U,       KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \
-        KC_LCTL,      KC_VOLD,KC_VOLU,KC_MUTE,KC_NO,  KC_NO,  KC_NO,  KC_MS_L,KC_MS_D,       KC_MS_R,       KC_BTN1,KC_NO,  KC_ENT, \
-        KC_LSFT,      KC_NO,  KC_NO,  KC_NO,  KC_NO,  KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT),ALT_T(KC_RGHT),KC_NO,  KC_RSFT,KC_TRNS, \
-        KC_TRNS,      KC_LGUI,KC_LALT,          KC_TRNS,                      KC_TRNS,       KC_TRNS,       KC_TRNS,KC_TRNS),
-
-};
-
-/*
- * Fn action definition
- */
-const uint16_t fn_actions[] = {
-
-};
diff --git a/keyboards/infinity_chibios/led.c b/keyboards/infinity_chibios/led.c
deleted file mode 100644 (file)
index aed66c7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-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/>.
-*/
-
-#include "hal.h"
-
-#include "led.h"
-
-
-void led_set(uint8_t usb_led) {
-}
diff --git a/keyboards/infinity_chibios/matrix.c b/keyboards/infinity_chibios/matrix.c
deleted file mode 100644 (file)
index 62c165a..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#include <stdint.h>
-#include <stdbool.h>
-#include <string.h>
-#include "hal.h"
-#include "timer.h"
-#include "wait.h"
-#include "print.h"
-#include "matrix.h"
-
-
-/*
- * Infinity Pinusage:
- * Column pins are input with internal pull-down. Row pins are output and strobe with high.
- * Key is high or 1 when it turns on.
- *  INFINITY PRODUCTION (NO LED)
- *     col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 }
- *     row: { PTB0, PTB1, PTB2, PTB3, PTB16, PTB17, PTC4, PTC5, PTD0 }
- *  INFINITY PRODUCTION (WITH LED)
- *     col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 }
- *     row: { PTC0, PTC1, PTC2, PTC3, PTC4, PTC5, PTC6, PTC7, PTD0 }
- */
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-static bool debouncing = false;
-static uint16_t debouncing_time = 0;
-
-
-void matrix_init(void)
-{
-    /* Column(sense) */
-    palSetPadMode(GPIOD, 1,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 2,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 3,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 4,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 5,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 6,  PAL_MODE_INPUT_PULLDOWN);
-    palSetPadMode(GPIOD, 7,  PAL_MODE_INPUT_PULLDOWN);
-
-#ifdef INFINITY_LED
-    /* Row(strobe) */
-    palSetPadMode(GPIOC, 0,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 1,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 2,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 3,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 4,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 5,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 6,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 7,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOD, 0,  PAL_MODE_OUTPUT_PUSHPULL);
-#else
-    /* Row(strobe) */
-    palSetPadMode(GPIOB, 0,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOB, 1,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOB, 2,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOB, 3,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOB, 17, PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 4,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOC, 5,  PAL_MODE_OUTPUT_PUSHPULL);
-    palSetPadMode(GPIOD, 0,  PAL_MODE_OUTPUT_PUSHPULL);
-#endif
-    memset(matrix, 0, MATRIX_ROWS);
-    memset(matrix_debouncing, 0, MATRIX_ROWS);
-}
-
-uint8_t matrix_scan(void)
-{
-    for (int row = 0; row < MATRIX_ROWS; row++) {
-        matrix_row_t data = 0;
-    #ifdef INFINITY_LED
-        // strobe row
-        switch (row) {
-            case 0: palSetPad(GPIOC, 0);    break;
-            case 1: palSetPad(GPIOC, 1);    break;
-            case 2: palSetPad(GPIOC, 2);    break;
-            case 3: palSetPad(GPIOC, 3);    break;
-            case 4: palSetPad(GPIOC, 4);    break;
-            case 5: palSetPad(GPIOC, 5);    break;
-            case 6: palSetPad(GPIOC, 6);    break;
-            case 7: palSetPad(GPIOC, 7);    break;
-            case 8: palSetPad(GPIOD, 0);    break;
-        }
-    #else
-        // strobe row
-        switch (row) {
-            case 0: palSetPad(GPIOB, 0);    break;
-            case 1: palSetPad(GPIOB, 1);    break;
-            case 2: palSetPad(GPIOB, 2);    break;
-            case 3: palSetPad(GPIOB, 3);    break;
-            case 4: palSetPad(GPIOB, 16);   break;
-            case 5: palSetPad(GPIOB, 17);   break;
-            case 6: palSetPad(GPIOC, 4);    break;
-            case 7: palSetPad(GPIOC, 5);    break;
-            case 8: palSetPad(GPIOD, 0);    break;
-        }
-    #endif
-
-        wait_us(1); // need wait to settle pin state
-
-        // read col data
-        data = (palReadPort(GPIOD)>>1);
-    #ifdef INFINITY_LED
-        // un-strobe row
-        switch (row) {
-            case 0: palClearPad(GPIOC, 0);    break;
-            case 1: palClearPad(GPIOC, 1);    break;
-            case 2: palClearPad(GPIOC, 2);    break;
-            case 3: palClearPad(GPIOC, 3);    break;
-            case 4: palClearPad(GPIOC, 4);    break;
-            case 5: palClearPad(GPIOC, 5);    break;
-            case 6: palClearPad(GPIOC, 6);    break;
-            case 7: palClearPad(GPIOC, 7);    break;
-            case 8: palClearPad(GPIOD, 0);    break;
-        }
-    #else
-        // un-strobe row
-        switch (row) {
-            case 0: palClearPad(GPIOB, 0);    break;
-            case 1: palClearPad(GPIOB, 1);    break;
-            case 2: palClearPad(GPIOB, 2);    break;
-            case 3: palClearPad(GPIOB, 3);    break;
-            case 4: palClearPad(GPIOB, 16);   break;
-            case 5: palClearPad(GPIOB, 17);   break;
-            case 6: palClearPad(GPIOC, 4);    break;
-            case 7: palClearPad(GPIOC, 5);    break;
-            case 8: palClearPad(GPIOD, 0);    break;
-        }
-    #endif
-
-        if (matrix_debouncing[row] != data) {
-            matrix_debouncing[row] = data;
-            debouncing = true;
-            debouncing_time = timer_read();
-        }
-    }
-
-    if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
-        for (int row = 0; row < MATRIX_ROWS; row++) {
-            matrix[row] = matrix_debouncing[row];
-        }
-        debouncing = false;
-    }
-    return 1;
-}
-
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-matrix_row_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    xprintf("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
-        xprintf("%02X: ");
-        matrix_row_t data = matrix_get_row(row);
-        for (int col = 0; col < MATRIX_COLS; col++) {
-            if (data & (1<<col))
-                xprintf("1");
-            else
-                xprintf("0");
-        }
-        xprintf("\n");
-    }
-}
diff --git a/keyboards/infinity_chibios/mcuconf.h b/keyboards/infinity_chibios/mcuconf.h
deleted file mode 100644 (file)
index 66b6ce2..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*\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
index 75d544f16aa8e07d059adef8c5c75aa8f321b797..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,71 +1,3 @@
-
-
-# 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
-# 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 - not yet supported in LUFA
-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
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/jd45/rules.mk b/keyboards/jd45/rules.mk
new file mode 100644 (file)
index 0000000..2f1e266
--- /dev/null
@@ -0,0 +1,67 @@
+
+
+# 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
+# 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 - not yet supported in LUFA
+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
\ No newline at end of file
index 0d17d32dac89751c375f8f79205f0270b4053f97..57b2ef62e5f3a43b7338f789a5d4800c577b763d 100644 (file)
@@ -1,77 +1,3 @@
-# project specific files
-SRC = led.c
-
-# 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
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no       # 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 ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
-
diff --git a/keyboards/kc60/keymaps/workman-dead/README.md b/keyboards/kc60/keymaps/workman-dead/README.md
deleted file mode 100644 (file)
index f1fcdc9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# Workman dead with spacefn (kc60 @ QMK)
-
-## Layout reference
-![workman dead with spacefn](./kc60-wm-dead.png)
-
-## Build
-
-To build this keymap, simply run `make KEYMAP=workman-dead`.
-
-## Notes
-
-* the default layout is `workman` (try it out, it's awesome!), but it can be changed to `qwerty` with the `rebel` key (the function layer won't change though)
-* `comma` acts as a dead key, that means tapping/holding it will activate the **oneshot** `dead key` layer (marked red in the reference)
-* hold `space` to access the `function` layer (marked blue in the reference)
-* hold `tab` to activate the mouse layer
-* the `function` layer contains mostly osx specific shortcuts
-* on the right side of the bottom row `alt` and `super` are switched compared to a standard layout
index 9786e37d8ce132eb70ef3bd4325a215ed3c7b7fe..9e3b9bb656a80a3287c4be898e17957eec70b80b 100644 (file)
@@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   KC_TABM,          KC_Q,    KC_D,    KC_R,    KC_W,    KC_B,    KC_J,    KC_F,    KC_U,    KC_P,    KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \
   KC_LCTL,          KC_A,    KC_S,    KC_H,    KC_T,    KC_G,    KC_Y,    KC_N,    KC_E,    KC_O,    KC_I,    KC_QUOT, _______, KC_ENT,  \
   KC_LSFT, _______, KC_Z,    KC_X,    KC_M,    KC_C,    KC_V,    KC_K,    KC_L,    DK_ACT,  KC_DOT,  KC_SLSH,          _______, KC_RSFT, \
-  KC_LCTL, KC_LALT, KC_LGUI,                   KC_SPFN,          KC_NO,   KC_RALT, KC_RGUI, KC_RCTL, KC_DFQW),
+  KC_LCTL, KC_LALT, KC_LGUI,                   KC_SPFN,          _______, KC_RALT, KC_RGUI, KC_RCTL, KC_DFQW),
 
 // QWERTY
 /*
@@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   KC_TABM,          KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC, KC_RBRC, KC_BSLS, \
   KC_LCTL,          KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT, _______, KC_ENT,  \
   KC_LSFT, _______, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    DK_ACT,  KC_DOT,  KC_SLSH,          _______, KC_RSFT, \
-  KC_LCTL, KC_LALT, KC_LGUI,                   KC_SPFN,          KC_NO,   KC_RALT, KC_RGUI, KC_RCTL, KC_DOWN),
+  KC_LCTL, KC_LALT, KC_LGUI,                   KC_SPFN,          _______, KC_RALT, KC_RGUI, KC_RCTL, KC_DFWM),
 
 // dead key layer
 /*
@@ -98,7 +98,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   XXXXXXX,          KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT,   KC_DLR,  KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, KC_TILD, KC_CIRC, _______, \
   _______,          KC_HASH, KC_LPRN, KC_EQL,  KC_0,    KC_LCBR, KC_RCBR, KC_1,    KC_ASTR, KC_RPRN, KC_MINS, KC_GRV,  _______, KC_CENT, \
   _______, _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_PIPE, KC_BSLS, KC_2,    DK_REL,  KC_4,    KC_5,             _______, _______, \
-  KC_LCTL, KC_LALT, KC_LGUI,                   KC_COMS,          KC_NO,   KC_RALT, KC_RGUI, KC_RCTL, _______),
+  KC_LCTL, KC_LALT, KC_LGUI,                   KC_COMS,          _______, KC_RALT, KC_RGUI, KC_RCTL, _______),
 
 // function layer
 /*
@@ -119,7 +119,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
   KC_ESC,           KC_CMDQ, KC_CMDD, KC_CSTB, KC_C_TB, _______, _______, KC_PGDN, KC_UP,   KC_PGUP, _______, _______, _______, KC_INS,  \
   KC_LSFT,          KC_CMDA, KC_CMDS, KC_C_LF, KC_C_RT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, KC_END,  _______, KC_BSPC, \
   KC_LSFT, _______, KC_CMDZ, KC_CMDX, _______, KC_CMDC, KC_CMDV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______,          _______, _______, \
-  KC_LCTL, KC_LALT, KC_LGUI,                   KC_TRNS,          KC_NO,   KC_RALT, KC_RGUI, KC_RCTL, RESET),
+  KC_LCTL, KC_LALT, KC_LGUI,                   KC_TRNS,          _______, KC_RALT, KC_RGUI, KC_RCTL, RESET),
 
 // mouse layer
 /*
diff --git a/keyboards/kc60/keymaps/workman-dead/readme.md b/keyboards/kc60/keymaps/workman-dead/readme.md
new file mode 100644 (file)
index 0000000..f1fcdc9
--- /dev/null
@@ -0,0 +1,17 @@
+# Workman dead with spacefn (kc60 @ QMK)
+
+## Layout reference
+![workman dead with spacefn](./kc60-wm-dead.png)
+
+## Build
+
+To build this keymap, simply run `make KEYMAP=workman-dead`.
+
+## Notes
+
+* the default layout is `workman` (try it out, it's awesome!), but it can be changed to `qwerty` with the `rebel` key (the function layer won't change though)
+* `comma` acts as a dead key, that means tapping/holding it will activate the **oneshot** `dead key` layer (marked red in the reference)
+* hold `space` to access the `function` layer (marked blue in the reference)
+* hold `tab` to activate the mouse layer
+* the `function` layer contains mostly osx specific shortcuts
+* on the right side of the bottom row `alt` and `super` are switched compared to a standard layout
index b29c6be302879c615a59bb789590e986502b9b68..da84f6159afef6516686c6e319a9e17d08213a06 100644 (file)
@@ -10,25 +10,27 @@ Download or clone the whole firmware and navigate to the keyboards/kc60 folder.
 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`.
+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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
 
 ## WS2812 Support
 ![Image of KC60 with RGB Underglow](keymaps/ws2812/ws2812_example.jpg)
 
-Build with WS2812 Support by running `make KEYMAP=ws2812`.
+Build with WS2812 Support by running `make ws2812`.
 
 ## Warning
 For those who want to use 2x1U instead of classic backspace you need to use K0D and K49 like this:
 * K0D represents the key at the right of =.
 * K49 represents the last key of the row (is wired at the right of the space key on the PCB)
 
-In kc60.h I've put several definitions' examples of possible layouts proposed by online editor (http://123.57.250.164:9128/).
\ No newline at end of file
+In kc60.h I've put several definitions' examples of possible layouts proposed by online editor (http://123.57.250.164:9128/).
diff --git a/keyboards/kc60/rules.mk b/keyboards/kc60/rules.mk
new file mode 100644 (file)
index 0000000..a935ed1
--- /dev/null
@@ -0,0 +1,71 @@
+# project specific files
+SRC = led.c
+
+# 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
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no       # 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 ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
index ca077e63662065c94c8c87adfa2ff51531b2d6fa..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,79 +1,3 @@
-
-## Project specific files
-
-SRC=  matrix.c 
-
-# MCU name
-MCU = at90usb1286
-#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=1024
-
-
-# Build Options
-#   change yes to no to disable
-#
-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 ?= no        # Console for debug(+400)
-COMMAND_ENABLE ?= no
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming
-CUSTOM_MATRIX=yes # need to do our own thing with the matrix
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
index a990f9cb997437d82a3baa90e21b0d04eae3d2e3..79c86581e6930c7bdf5121080ea16c2c2ec8d1d2 100644 (file)
@@ -27,16 +27,16 @@ Depending on which keymap you would like to use, you will have to compile slight
 
 ### Default
 
-To build with the default keymap, simply run `make`.
+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 a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
 
-To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
 
 ```
-$ make keymap=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 
 Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
diff --git a/keyboards/kinesis/rules.mk b/keyboards/kinesis/rules.mk
new file mode 100644 (file)
index 0000000..a4a2b7d
--- /dev/null
@@ -0,0 +1,73 @@
+
+## Project specific files
+
+SRC=  matrix.c 
+
+# MCU name
+MCU = at90usb1286
+#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=1024
+
+
+# Build Options
+#   change yes to no to disable
+#
+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 ?= no        # Console for debug(+400)
+COMMAND_ENABLE ?= no
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming
+CUSTOM_MATRIX=yes # need to do our own thing with the matrix
index 3b5585ed6f89bd7fd4010e24dccfc9ad0742a358..57b2ef62e5f3a43b7338f789a5d4800c577b763d 100644 (file)
@@ -1,77 +1,3 @@
-
-
-# MCU name
-#MCU = at90usb1287
-MCU = atmega32u2
-
-# 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
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # 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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-CUSTOM_MATRIX = yes
-SRC += matrix.c
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
-
diff --git a/keyboards/kitten_paw/rules.mk b/keyboards/kitten_paw/rules.mk
new file mode 100644 (file)
index 0000000..b0c909d
--- /dev/null
@@ -0,0 +1,72 @@
+
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u2
+
+# 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
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # 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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+
+CUSTOM_MATRIX = yes
+SRC += matrix.c
index b9f07636be0c25186f1fd745e46c040003b31e8d..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,78 +1,3 @@
-SRC += matrix.c \
-          i2c.c \
-          split_util.c \
-          serial.c
-
-# 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
-#   change to "no" to disable the options, or define them in the Makefile in 
-#   the appropriate keymap folder that will get included automatically
-#
-BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no         # Console for debug(+400)
-COMMAND_ENABLE ?= yes        # Commands for debug and configuration
-NKRO_ENABLE ?= no            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE ?= no      # Enable keyboard backlight functionality
-MIDI_ENABLE ?= no            # MIDI controls
-AUDIO_ENABLE ?= yes           # Audio output on port C6
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
-
-CUSTOM_MATRIX = yes
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk
new file mode 100644 (file)
index 0000000..6961fbd
--- /dev/null
@@ -0,0 +1,74 @@
+SRC += matrix.c \
+          i2c.c \
+          split_util.c \
+          serial.c
+
+# 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
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= yes        # Commands for debug and configuration
+NKRO_ENABLE ?= no            # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE ?= no      # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no            # MIDI controls
+AUDIO_ENABLE ?= yes           # Audio output on port C6
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
+
+CUSTOM_MATRIX = yes
\ No newline at end of file
index 3a71fd0ee3e56db8271343a1db792e8f57f75f16..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,74 +1,3 @@
-
-
-SRC = led.c
-
-# 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 ?= no  # 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
-NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-RGBLIGHT_ENABLE ?=yes   # Enable keyboard underlight functionality (+4870)
-BACKLIGHT_ENABLE ?= no  # Enable keyboard backlight functionality (+1150)
-MIDI_ENABLE ?= no              # MIDI controls
-AUDIO_ENABLE ?= no
-UNICODE_ENABLE ?= no           # Unicode
-BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/phantom/rules.mk b/keyboards/phantom/rules.mk
new file mode 100644 (file)
index 0000000..c6b8ca6
--- /dev/null
@@ -0,0 +1,69 @@
+
+
+SRC = led.c
+
+# 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 ?= no  # 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
+NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE ?=yes   # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= no  # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE ?= no              # MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= no           # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
index 23944f92ea3b5785ee452bf66d942951fa865cf6..7d49c5ef967d46e5f0beacd470bbc34e90b393c1 100644 (file)
@@ -1,74 +1,5 @@
-
 SUBPROJECT_DEFAULT = rev4
 
-# 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
-#   change to "no" to disable the options, or define them in the Makefile in 
-#   the appropriate keymap folder that will get included automatically
-#
-BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no         # Console for debug(+400)
-COMMAND_ENABLE ?= yes        # Commands for debug and configuration
-NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
-AUDIO_ENABLE ?= no           # Audio output on port C6
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
index f89fdeb931a9da1f8fa02def16d41fa2de94b908..4b24a690e04d2d8f3632b89a1264decc5a114511 100644 (file)
@@ -13,15 +13,17 @@ Download or clone the whole firmware and navigate to the keyboards/planck folder
 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`.
+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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
 
 ### Notable forks (which some of the keymap files are from)
index 3ed1445e434f081285ea25e3b0c6cdde98b9e62c..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,5 +1,3 @@
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/planck/rev3/rules.mk b/keyboards/planck/rev3/rules.mk
new file mode 100644 (file)
index 0000000..3ed1445
--- /dev/null
@@ -0,0 +1,5 @@
+AUDIO_ENABLE ?= no           # Audio output on port C6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
\ No newline at end of file
index ed09f85a4d49fb5ac4a2a1113f033255e2e6cab6..191c6bb664de85727cd5fb1c36ab6f14ab207d96 100644 (file)
@@ -1,5 +1,3 @@
-AUDIO_ENABLE ?= yes           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../../Makefile
 endif
\ No newline at end of file
diff --git a/keyboards/planck/rev4/rules.mk b/keyboards/planck/rev4/rules.mk
new file mode 100644 (file)
index 0000000..ed09f85
--- /dev/null
@@ -0,0 +1,5 @@
+AUDIO_ENABLE ?= yes           # Audio output on port C6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/planck/rules.mk b/keyboards/planck/rules.mk
new file mode 100644 (file)
index 0000000..25db53a
--- /dev/null
@@ -0,0 +1,67 @@
+# 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
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= yes        # Commands for debug and configuration
+NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
+AUDIO_ENABLE ?= no           # Audio output on port C6
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
\ No newline at end of file
index 08e9205cbf1f30a6223dd98f0f40f094288556d8..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,73 +1,3 @@
-
-
-# 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
-#   change to "no" to disable the options, or define them in the Makefile in 
-#   the appropriate keymap folder that will get included automatically
-#
-BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no         # Console for debug(+400)
-COMMAND_ENABLE ?= yes        # Commands for debug and configuration
-NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
-AUDIO_ENABLE ?= no           # Audio output on port C6
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
-
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
 endif
\ No newline at end of file
index f0be255a0952ce08610358115d70cf428d276184..10763ee97a406bf61082ca80ce70f342c552c4b4 100644 (file)
@@ -13,13 +13,15 @@ Download or clone the whole firmware and navigate to the keyboards/preonic folde
 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`.
+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 a file in the keymaps folder named `<name>.c` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/keyboards/preonic/rules.mk b/keyboards/preonic/rules.mk
new file mode 100644 (file)
index 0000000..d0f3a3a
--- /dev/null
@@ -0,0 +1,69 @@
+
+
+# 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
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE ?= no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= yes        # Commands for debug and configuration
+NKRO_ENABLE ?= no            # 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 ?= no            # MIDI controls
+AUDIO_ENABLE ?= no           # Audio output on port C6
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no    # Breathing sleep LED during USB suspend
\ No newline at end of file
index 4f1796219193343ae0b863fd5d1cffccd28f5c2e..81a23c7e557326e86879f418783035fecc9d64f1 100644 (file)
@@ -9,38 +9,47 @@ These keyboards are manufactured by the maintainers of QMK.
 
 What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and killer tactile feel. These are available through [olkb.com](http://olkb.com) as well as through [Massdrop](http://massdrop.com) from time to time, as easy to assemble kits.
 
-* [Planck](/keyboards/planck/) - A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine.
-* [Preonic](/keyboards/preonic/) - Like the Planck, but bigger. 50%.
-* [Atomic](/keyboards/atomic/) - Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard.
+* [Planck](/keyboards/planck/) &mdash; A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine.
+* [Preonic](/keyboards/preonic/) &mdash; Like the Planck, but bigger. 50%.
+* [Atomic](/keyboards/atomic/) &mdash; Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard.
 
 ### ErgoDox EZ - Erez Zukerman
 
 Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing. Available on [ergodox-ez.com](https://ergodox-ez.com).
 
-* [ErgoDox EZ](/keyboards/ergodox/) - Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types.
+* [ErgoDox EZ](/keyboards/ergodox/) &mdash; Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types.
 
 ### Clueboard - Zach White
 
 Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components, available on [clueboard.co](http://clueboard.co)
 
-* [Clueboard](/keyboards/clueboard/) - The 66% custom keyboard.
-* [Cluepad](/keyboards/cluepad/) - A mechanical numpad with QMK superpowers.
+* [Clueboard](/keyboards/clueboard/) &mdash; The 66% custom keyboard.
+* [Cluecard](/keyboards/cluecard/) &mdash; A small board to help you hack on QMK.
+* [Cluepad](/keyboards/cluepad/) &mdash; A mechanical numpad with QMK superpowers.
 
 
 ## Community-supported QMK Keyboards
 
 These keyboards are part of the QMK repository, but their manufacturers are not official maintainers of the repository.
 
-* [alps64](/keyboards/alps64/) &mdash; A 60% keyboard for Alps keyswitches.
-* [arrow_pad](/keyboards/arrow_pad) &mdash; A custom creation by IBNobody.
-* [atreus](/keyboards/atreus) &mdash; Made by Technomancy.
-* [bantam44](/keyboards/bantam44) &mdash; It is a 44-key 40% staggered keyboard.
-* [gh60](/keyboards/gh60) &mdash; A 60% Geekhack community-driven project.
-* [hhkb](/keyboards/hhkb) &mdash; The Happy Hacking keyboard can be hacked with a custom controller to run QMK.
-* [jd45](/keyboards/jd45) &mdash; Another Geekhack community project, designed by jdcarpe.
-* [kc60](/keyboards/kc60) &mdash; A programmable Chinese-made keyboard, lost in the mists of time.
-* [kitten_paw](/keyboards/kitten_paw) &mdash; A replacement controller (2016 revision) for the Filco Majestouch by [Bathroom Epiphanies](https://github.com/BathroomEpiphanies)
-* [phantom](/keyboards/phantom) &mdash; A tenkeyless kit by Teel, also from Geekhack.
-* [retro_refit](/keyboards/retro_refit) &mdash; Another creation by IBNobody.
-* [satan](/keyboards/satan) &mdash; A GH60 variant.
-* [sixkeyboard](/keyboards/sixkeyboard) &mdash; A 6-key keyboard made by TechKeys.
+* [Alps64](/keyboards/alps64) &mdash; A 60% keyboard for Alps keyswitches.
+* [AMJ60](/keyboards/amj60) &mdash; DIY/Assembled compact 60% keyboard.
+* [Arrow Pad](/keyboards/arrow_pad) &mdash; A custom creation by IBNobody.
+* [Atreus](/keyboards/atreus) &mdash; Made by Technomancy.
+* [Bantam44](/keyboards/bantam44) &mdash; It is a 44-key 40% staggered keyboard.
+* [Ergodox Infinity](/keyboards/ergodox) - Ergonomic Split Keyboard by Input Club.
+* [GH60](/keyboards/gh60) &mdash; A 60% Geekhack community-driven project.
+* [Happy Hacking Keyboard](/keyboards/hhkb) &mdash; The Happy Hacking keyboard can be hacked with a custom controller to run QMK.
+* [Infinity 60%](/keyboards/infinity60) - &mdash; Compact community keyboard by Input Club.
+* [JD45](/keyboards/jd45) &mdash; Another Geekhack community project, designed by jdcarpe.
+* [KC60](/keyboards/kc60) &mdash; A programmable Chinese-made keyboard, lost in the mists of time.
+* [Kinesis Advantage](/keyboards/kinesis) &mdash; Contoured ergonomic keyboard by Kinesis Computer Ergonomics.
+* [The Kitten Paw](/keyboards/kitten_paw) &mdash; A replacement controller (2016 revision) for the Filco Majestouch by [Bathroom Epiphanies](https://github.com/BathroomEpiphanies).
+* [Lets Split](/keyboards/lets_split) - Split ortholinear 40% keyboard.
+* [Phantom](/keyboards/phantom) &mdash; A tenkeyless kit by Teel, also from Geekhack.
+* [Retro Refit](/keyboards/retro_refit) &mdash; Another creation by IBNobody.
+* [S60-x](/keyboards/s60-x) &mdash; DIY compact keyboard designed by VinnyCordeiro for Sentraq.
+* [Satan](/keyboards/satan) &mdash; A GH60 variant.
+* [SixKeyBoard](/keyboards/sixkeyboard) &mdash; A 6-key keyboard made by TechKeys.
+* [TheVan 44](/keyboars/tv44) &mdash; A 44-key staggered keybard by Evangs.
+* [Vision Division](/keyboards/vision_division) &mdash; Full Size / Split Linear Keyboard by IBNobody.
index 2dd8cc5f79af574aadce97b5c477cf1fff18f0ab..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,74 +1,3 @@
-
-
-# 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=512
-
-
-# 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
-
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
+endif
\ No newline at end of file
index b01a1a9ca994ec9a8eb9d8e468a4d98bb72de050..77df861cef30ddf1b22c1dba4e37432df34c848a 100644 (file)
@@ -12,13 +12,15 @@ Download or clone the whole firmware and navigate to the keyboards/retro_refit f
 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`.
+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` 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 `KEYMAP` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
+
 ```
-$ make KEYMAP=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
+
 Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
\ No newline at end of file
diff --git a/keyboards/retro_refit/rules.mk b/keyboards/retro_refit/rules.mk
new file mode 100644 (file)
index 0000000..10fbfa5
--- /dev/null
@@ -0,0 +1,68 @@
+
+
+# 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=512
+
+
+# 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
index 8b51d4609f8edb457ae5a1fbcf1dae69b444bf60..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,75 +1,3 @@
-
-
-# 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
-#   change yes to no to disable
-#
-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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
index 099d5869914f0c4c65ac9587006d29df0a06e2d4..94ce829223b4305a4f54c2cfa005a41310c8b10a 100644 (file)
@@ -42,9 +42,9 @@ The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.
 
 ## Building the firmware
 
-To build firmware binary hex file with a certain keymap just run `make` with the `keymap` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
 
-    $ make keymap=[custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>]
+    $ make [custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|<name>]
 
 For a more detailed explanation of the build process and the environment setup, see the ["Getting Started" section](/readme.md#getting-started).
 
diff --git a/keyboards/s60-x/rules.mk b/keyboards/s60-x/rules.mk
new file mode 100644 (file)
index 0000000..7ec9393
--- /dev/null
@@ -0,0 +1,69 @@
+
+
+# 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
+#   change yes to no to disable
+#
+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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
\ No newline at end of file
index a0879fc9c9bf358ec13eba7b384a7b5ad28698e2..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,70 +1,3 @@
-
-# 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 ?= no # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= no  # 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
-NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-RGBLIGHT_ENABLE ?= yes   # Enable keyboard underlight functionality (+4870)
-BACKLIGHT_ENABLE ?= yes  # Enable keyboard backlight functionality (+1150)
-MIDI_ENABLE ?= no              # MIDI controls
-AUDIO_ENABLE ?= no
-UNICODE_ENABLE ?= no           # Unicode
-BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
+endif
\ No newline at end of file
diff --git a/keyboards/satan/rules.mk b/keyboards/satan/rules.mk
new file mode 100644 (file)
index 0000000..1102584
--- /dev/null
@@ -0,0 +1,66 @@
+
+# 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 ?= no # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no  # 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
+NKRO_ENABLE ?= yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+RGBLIGHT_ENABLE ?= yes   # Enable keyboard underlight functionality (+4870)
+BACKLIGHT_ENABLE ?= yes  # Enable keyboard backlight functionality (+1150)
+MIDI_ENABLE ?= no              # MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= no           # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
index 6f273064a7aadf589b93ede1caec4b825d5ed5eb..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,75 +1,3 @@
-
-
-SRC = matrix.c
-
-# MCU name
-#MCU = at90usb1287
-MCU = atmega16u2
-
-# 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 ?= no         # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE ?= no          # Mouse keys(+4700)
-EXTRAKEY_ENABLE ?= no          # Audio control and System control(+450)
-CONSOLE_ENABLE ?= no           # Console for debug(+400)
-COMMAND_ENABLE ?= no           # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= no                      # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
-MIDI_ENABLE ?= no                      # MIDI controls
-AUDIO_ENABLE ?= no
-UNICODE_ENABLE ?= no           # Unicode
-BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
-CUSTOM_MATRIX = yes
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
+endif
\ No newline at end of file
diff --git a/keyboards/sixkeyboard/rules.mk b/keyboards/sixkeyboard/rules.mk
new file mode 100644 (file)
index 0000000..2c99985
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+SRC = matrix.c
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega16u2
+
+# 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 ?= no         # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no          # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= no          # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no           # Console for debug(+400)
+COMMAND_ENABLE ?= no           # Commands for debug and configuration
+SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= no                      # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no                      # MIDI controls
+AUDIO_ENABLE ?= no
+UNICODE_ENABLE ?= no           # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
+CUSTOM_MATRIX = yes
\ No newline at end of file
index 45ca1278074c490f71e9f2cbbe54a6f0cd267caa..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,75 +1,3 @@
-
-
-# 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
-#   change yes to no to disable
-#
-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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= yes           # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
diff --git a/keyboards/tv44/keymaps/jeebak/Makefile b/keyboards/tv44/keymaps/jeebak/Makefile
new file mode 100644 (file)
index 0000000..f4671a9
--- /dev/null
@@ -0,0 +1,21 @@
+# Build Options
+#   change to "no" to disable the options, or define them in the Makefile in 
+#   the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
+CONSOLE_ENABLE = no         # Console for debug(+400)
+COMMAND_ENABLE = yes        # Commands for debug and configuration
+NKRO_ENABLE = yes           # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
+MIDI_ENABLE = no            # MIDI controls
+AUDIO_ENABLE = no           # Audio output on port C6
+UNICODE_ENABLE = no         # Unicode
+BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
+SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/tv44/keymaps/jeebak/config.h b/keyboards/tv44/keymaps/jeebak/config.h
new file mode 100644 (file)
index 0000000..a59ef2b
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef CONFIG_USER_H
+#define CONFIG_USER_H
+
+#include "../../config.h"
+
+/**
+ *TV44 keymap definition macro
+ */
+#define KEYMAP_TV44( \
+    K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
+    K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
+    K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
+    K37,   K38,   K39,     K40,     K41,     K42,   K43,   K44  \
+) { \
+    { K01,   K02,   K03,   K04,   K05,   K06,   K07,   K08,   K09,   K10,   K11,   K12, }, \
+    { K13,   K14,   K15,   K16,   K17,   K18,   K19,   K20,   K21,   K22,   K23,   K24, }, \
+    { K25,   K26,   K27,   K28,   K29,   K30,   K31,   K32,   K33,   K34,   K35,   K36, }, \
+    { K37,   K38,   K39,   K40, KC_NO, KC_NO,  KC_NO,  K41,   K42,   K43, KC_NO,   K44  }  \
+}
+
+#endif
diff --git a/keyboards/tv44/keymaps/jeebak/keymap.c b/keyboards/tv44/keymaps/jeebak/keymap.c
new file mode 100644 (file)
index 0000000..1bb1015
--- /dev/null
@@ -0,0 +1,425 @@
+#include "tv44.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+
+extern keymap_config_t keymap_config;
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _COLEMAK 1
+#define _DVORAK 2
+#define _LOWER 3
+#define _RAISE 4
+#define _PLOVER 5
+#define _TOUCHCURSOR 6
+#define _MOUSECURSOR 7
+#define _ADJUST 16
+
+// Keycodes
+enum planck_keycodes {
+  QWERTY = SAFE_RANGE,
+  COLEMAK,
+  DVORAK,
+  PLOVER,
+  LOWER,
+  RAISE,
+  BACKLIT,
+  EXT_PLV
+};
+
+enum macro_keycodes {
+  KC_ALT_TAB,
+  KC_CMD_TAB,
+  KC_CTL_TAB,
+  KC_CMD_SLSH,
+  KC_AG_FIND,
+  KC_AG_AGAIN,
+  KC_AG_UNDO,
+  KC_AG_CUT,
+  KC_AG_COPY,
+  KC_AG_PASTE,
+  KC_AG_DESK_L,
+  KC_AG_DESK_R,
+  KC_AG_TAB_C,
+  KC_AG_TAB_N,
+  KC_AG_TAB_R,
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+// Custom macros
+#define CTL_ESC     CTL_T(KC_ESC)               // Tap for Esc, hold for Ctrl
+#define SFT_ENT     SFT_T(KC_ENT)               // Tap for Enter, hold for Shift
+#define HPR_TAB     ALL_T(KC_TAB)               // Tap for Tab, hold for Hyper
+#define GUI_SEM     GUI_T(KC_SCLN)              // Tap for Semicolon, hold for GUI
+#define ALT_QUO     ALT_T(KC_QUOT)              // Tap for Quote, hold for Alt
+// Requires KC_TRNS/_______ for the trigger key in the destination layer
+#define LT_TC       LT(_TOUCHCURSOR, KC_SPC)    // L-ayer T-ap T-ouch C-ursor
+#define LT_MC(kc)   LT(_MOUSECURSOR, kc)        // L-ayer T-ap M-ouse C-ursor
+#define ALT_TAB     M(KC_ALT_TAB)               // Macro for Alt-Tab
+#define CMD_TAB     M(KC_CMD_TAB)               // Macro for Cmd-Tab
+#define CTL_TAB     M(KC_CTL_TAB)               // Macro for Ctl-Tab
+#define CMD_SLSH    M(KC_CMD_SLSH)              // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility)
+#define AG_FIND     M(KC_AG_FIND)               // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings
+#define AG_AGAIN    M(KC_AG_AGAIN)
+#define AG_UNDO     M(KC_AG_UNDO)
+#define AG_CUT      M(KC_AG_CUT)
+#define AG_COPY     M(KC_AG_COPY)
+#define AG_PASTE    M(KC_AG_PASTE)
+#define AG_D_L      M(KC_AG_DESK_L)             // For Virtual Desktop Switching: Left, and
+#define AG_D_R      M(KC_AG_DESK_R)             //                                Right
+#define AG_T_C      M(KC_AG_TAB_C)              // For Chrome, etc. Tab Close,
+#define AG_T_N      M(KC_AG_TAB_N)              //                  Tab New, and
+#define AG_T_R      M(KC_AG_TAB_R)              //                  Tab Reopen Closed
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ *
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |Hyper/Tab|   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  |   Bksp      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * | Ctrl/Esc |   A  |   S  | MC/D |   F  |   G  |   H  |   J  |   K  |   L  |GUI/; |   Alt/"    |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |   Shift   |   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |  Sft/Ent  |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |   Alt   |   GUI   |  Lower  |    TC/Space    |   TC/Space     |  Raise  |   Vol+  |  Play   |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_QWERTY] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    HPR_TAB,   KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    CTL_ESC ,   KC_A, KC_S,LT_MC(KC_D),    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L, GUI_SEM,    ALT_QUO     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    KC_LSFT  ,   KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M, KC_COMM,  KC_DOT, KC_SLSH,    SFT_ENT    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    KC_LALT   ,   KC_LGUI     ,   LOWER ,      LT_TC     ,      LT_TC      ,  RAISE  ,     KC_VOLU     ,    KC_MPLY   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Colemak
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |Hyper/Tab|   Q  |   W  |   F  |   P  |   G  |   J  |   L  |   U  |   Y  |   ;  |   Bksp      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * | Ctrl/Esc |   A  |   R  | MC/S |   T  |   D  |   H  |   N  |   E  |   I  |   O  |    "       |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * | Shift     |   Z  |   X  |   C  |   V  |   B  |   K  |   M  |   ,  |   .  |   /  |  Sft/Ent  |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |   Alt   |   GUI   |  Lower  |    TC/Space    |   TC/Space     |  Raise  |   Vol+  |  Play   |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_COLEMAK] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    HPR_TAB,   KC_Q,    KC_W,    KC_F,    KC_P,    KC_G,    KC_J,    KC_L,    KC_U,    KC_Y, KC_SCLN,    KC_BSPC      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    CTL_ESC ,   KC_A, KC_R,LT_MC(KC_S),    KC_T,    KC_D,    KC_H,    KC_N,    KC_E,    KC_I,    KC_O,    KC_QUOT     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    KC_LSFT  ,   KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_K,    KC_M, KC_COMM,  KC_DOT, KC_SLSH,    SFT_ENT    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    KC_LALT   ,   KC_LGUI     ,   LOWER ,      LT_TC     ,      LT_TC      ,  RAISE  ,     KC_VOLU     ,    KC_MPLY   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Dvorak
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |Hyper/Tab|   "  |   ,  |   .  |   P  |   Y  |   F  |   G  |   C  |   R  |   L  |   Bksp      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * | Ctrl/Esc |   A  |   O  | MC/E |   U  |   I  |   D  |   H  |   T  |   N  |   S  |    /       |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * | Shift     |   ;  |   Q  |   J  |   K  |   X  |   B  |   M  |   W  |   V  |   Z  |  Sft/Ent  |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |   Alt   |   GUI   |  Lower  |    TC/Space    |   TC/Space     |  Raise  |   Vol+  |  Play   |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_DVORAK] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    HPR_TAB,KC_QUOT, KC_COMM,  KC_DOT,    KC_P,    KC_Y,    KC_F,    KC_G,    KC_C,    KC_R,    KC_L,    KC_BSPC      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    CTL_ESC ,   KC_A,    KC_O,LT_MC(KC_E), KC_U,    KC_I,    KC_D,    KC_H,    KC_T,    KC_N,    KC_S,    KC_SLSH     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    KC_LSFT  , KC_SCLN,   KC_Q,    KC_J,    KC_K,    KC_X,    KC_B,    KC_M,    KC_W,    KC_V,    KC_Z,    SFT_ENT    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    KC_LALT   ,   KC_LGUI     ,   LOWER ,      LT_TC     ,      LT_TC      ,  RAISE  ,     KC_VOLU     ,    KC_MPLY   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Lower
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |   ~     |   !  |   @  |   #  |   $  |   %  |   ^  |   &  |   *  |   (  |   )  |   Bksp      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |   [      |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   _  |   +  |   {  |   }  |   "|"      |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |   ]       |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |   -  |   =  |   [  |   ]  |    \      |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |  Brite  |         |         |                |                |         |   Vol-  |   Mute  |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_LOWER] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    KC_TILD,KC_EXLM,   KC_AT, KC_HASH,  KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN,    KC_BSPC      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    KC_LBRC ,  KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR,    KC_PIPE     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    KC_RBRC  ,  KC_F7,   KC_F8,   KC_F9,  KC_F10,  KC_F11,  KC_F12, KC_MINS,  KC_EQL, KC_LBRC, KC_RBRC,    KC_BSLS    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    BACKLIT   ,    _______    , _______ ,     _______    ,     _______     , _______ ,     KC_VOLD     ,    KC_MUTE   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Raise
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |   0     |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  |   Bksp      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |   $      |   4  |   5  |   6  |   .  |   +  |   .  |   4  |   5  |   6  |   *  |   "|"      |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |   =       |   7  |   8  |   9  |   0  |   -  |   .  |   1  |   2  |   3  |   /  |    \      |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |  Brite  |         |         |                |                |         |   Vol-  |   Mute  |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_RAISE] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    KC_0   ,   KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_BSPC      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    KC_DLR  ,   KC_4,    KC_5,    KC_6,  KC_DOT, KC_PLUS,  KC_DOT,    KC_4,    KC_5,    KC_6, KC_ASTR,    KC_PIPE     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    KC_EQL   ,   KC_7,    KC_8,    KC_9,    KC_0, KC_MINS,  KC_DOT,    KC_1,    KC_2,    KC_3, KC_SLSH,    KC_BSLS    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    BACKLIT   ,    _______    , _______ ,     _______    ,     _______     , _______ ,     KC_VOLD     ,    KC_MUTE   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * | AltTab  |CmdTab|CtlTab| GUI  |Shift |  ~   |Insert| Home |  Up  | End  | Bksp |             |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |          | Alt  |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|  Desk_R    |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |           | Undo | Cut  | Copy |Paste |  `   | PgDn | Del  |Tab_N |Tab_R |iTerm2|           |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |         |         |         |                |                |         |         |         |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ *
+ * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't
+ * seem to work on Mac. Presumably they'll work under Windows.
+ */
+
+[_TOUCHCURSOR] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD,  KC_INS, KC_HOME,   KC_UP,  KC_END, KC_BSPC,    _______      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    _______ ,KC_LALT,  KC_SPC,  AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT,  AG_D_L,    AG_D_R      ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    _______  ,AG_UNDO,  AG_CUT, AG_COPY,AG_PASTE,  KC_GRV, KC_PGDN,  KC_DEL,  AG_T_N,  AG_T_R,CMD_SLSH,    _______    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    _______   ,    _______    , _______ ,     _______    ,     _______     , _______ ,     _______     ,    _______   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Mouse Layer
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |         |      |ACCL0 |      |      |      |      |WHL_L |  Up  |WHL_R | BTN2 |             |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |          |ACCL2 | BTN2 |      | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 |   BTN5     |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |           |      |      |      | BTN3 |      |WHL_Dn| BTN1 |      |      | BTN3 |           |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |         |         |         |                |                |         |         |         |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+
+[_MOUSECURSOR] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    _______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2,    _______      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    _______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4,    KC_BTN5     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    _______  ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3,    _______    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    _______   ,    _______    , _______ ,     _______    ,     _______     , _______ ,     _______     ,    _______   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Plover layer (http://opensteno.org)
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |      #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |   #  |     #       |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |         |   S  |   T  |   P  |   H  |   *  |   *  |   F  |   P  |   L  |   T  |     D       |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * | TogOut    |   S  |   K  |   W  |   R  |   *  |   *  |   R  |   B  |   G  |   S  |    Z      |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * | Exit    |    A    |    O    |                |                |    E    |    U    |         |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+
+[_PLOVER] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    KC_1   ,   KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,    KC_1,     KC_1        ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    XXXXXXX ,   KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,    KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_LBRC     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    XXXXXXX  ,   KC_A,    KC_S,    KC_D,    KC_F,    KC_G,    KC_H,    KC_J,    KC_K,    KC_L, KC_SCLN,    KC_QUOT    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    EXT_PLV   ,     KC_C      ,   KC_V  ,     XXXXXXX    ,     XXXXXXX     ,   KC_N  ,      KC_M       ,    XXXXXXX   ),
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+
+/* Adjust (Lower + Raise)
+ * ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+ * |         |      |      |      |      |      |      |      |      |      |      |    Del      |
+ * |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+ * |          |      |      |      |      |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover|            |
+ * |----------`------`------`------`------`------`------`------`------`------`------`------------|
+ * |           |      |      |      |      |     |       |      |      |      |      |           |
+ * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+ * |         |         |         |                |                |         |         |  Reset  |
+ *  `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+ */
+[_ADJUST] = KEYMAP_TV44(
+/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
+    _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,     KC_DEL      ,
+/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
+    _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP,  QWERTY, COLEMAK,  DVORAK,  PLOVER,    _______     ,
+/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
+    _______  ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,    _______    ,
+/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
+    _______   ,    _______    , _______ ,     _______    ,     _______     , _______ ,     _______     ,    RESET     )
+/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/
+};
+
+void persistant_default_layer_set(uint16_t default_layer) {
+  eeconfig_update_default_layer(default_layer);
+  default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  switch (keycode) {
+    case QWERTY:
+      if (record->event.pressed) {
+        default_layer_set(1UL<<_QWERTY);
+      }
+      return false;
+      break;
+    case COLEMAK:
+      if (record->event.pressed) {
+        default_layer_set(1UL<<_COLEMAK);
+      }
+      return false;
+      break;
+    case DVORAK:
+      if (record->event.pressed) {
+        default_layer_set(1UL<<_DVORAK);
+      }
+      return false;
+      break;
+    case LOWER:
+      if (record->event.pressed) {
+        layer_on(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_LOWER);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case RAISE:
+      if (record->event.pressed) {
+        layer_on(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      } else {
+        layer_off(_RAISE);
+        update_tri_layer(_LOWER, _RAISE, _ADJUST);
+      }
+      return false;
+      break;
+    case BACKLIT:
+      if (record->event.pressed) {
+        register_code(KC_RSFT);
+        #ifdef BACKLIGHT_ENABLE
+          backlight_step();
+        #endif
+      } else {
+        unregister_code(KC_RSFT);
+      }
+      return false;
+      break;
+    case PLOVER:
+      if (record->event.pressed) {
+        layer_off(_RAISE);
+        layer_off(_LOWER);
+        layer_off(_ADJUST);
+        layer_on(_PLOVER);
+        if (!eeconfig_is_enabled()) {
+            eeconfig_init();
+        }
+        keymap_config.raw = eeconfig_read_keymap();
+        keymap_config.nkro = 1;
+        eeconfig_update_keymap(keymap_config.raw);
+      }
+      return false;
+      break;
+    case EXT_PLV:
+      if (record->event.pressed) {
+        layer_off(_PLOVER);
+      }
+      return false;
+      break;
+  }
+  return true;
+}
+
+/*
+ * Macro definition
+ */
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+    if (!eeconfig_is_enabled()) {
+      eeconfig_init();
+    }
+
+    bool use_cmd = true;    // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc.
+    // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
+    // quantum/quantum.c
+    if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) {
+      use_cmd = false;      // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
+    }
+
+    switch (id) {
+      case KC_ALT_TAB:
+        if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT),  D(TAB), END ) : MACRO( U(TAB), END )); }
+        else        { return (record->event.pressed ? MACRO( D(LGUI),  D(TAB), END ) : MACRO( U(TAB), END )); }
+      case KC_CMD_TAB:
+        if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI),  D(TAB), END ) : MACRO( U(TAB), END )); }
+        else        { return (record->event.pressed ? MACRO( D(LALT),  D(TAB), END ) : MACRO( U(TAB), END )); }
+
+      case KC_CTL_TAB:
+        return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END ));
+      case KC_CMD_SLSH:
+        return (record->event.pressed ? MACRO( D(LGUI),  D(SLSH),END ) : MACRO( U(SLSH),END ));
+
+      case KC_AG_FIND:
+        return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END );
+      case KC_AG_AGAIN:
+        return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END );
+      case KC_AG_UNDO:
+        return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END );
+      case KC_AG_CUT:
+        return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END );
+      case KC_AG_COPY:
+        return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END );
+      case KC_AG_PASTE:
+        return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END );
+
+      case KC_AG_DESK_L:
+        return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END );
+      case KC_AG_DESK_R:
+        return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END );
+
+      case KC_AG_TAB_C:
+        return use_cmd ? MACRODOWN( D(LGUI),            T(W), END ) : MACRODOWN( D(LCTRL),            T(W), END );
+      case KC_AG_TAB_N:
+        return use_cmd ? MACRODOWN( D(LGUI),            T(T), END ) : MACRODOWN( D(LCTRL),            T(T), END );
+      case KC_AG_TAB_R:
+        return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END );
+    }
+
+    return MACRO_NONE;
+}
diff --git a/keyboards/tv44/keymaps/jeebak/readme.md b/keyboards/tv44/keymaps/jeebak/readme.md
new file mode 100644 (file)
index 0000000..43d2095
--- /dev/null
@@ -0,0 +1,129 @@
+jeebak's TV44 layout
+=======================
+NOTE: This is a port of jeebak's planck layout, for tv44.
+
+This WIP keymap attempts to minimize fingers straying away from the home row.
+To aid in this endeavor, when additional modifyer keys to switch layers are
+needed, they will be mapped to home row keys. The `keymap.c` file will contain
+the exact changes. The diagrams in this README shows the highlights of the
+changes from the default mappings.
+
+I also decided to change all calls to `persistant_default_layer_set()` to
+`default_layer_set()` since this is my personal perference.
+
+## Macros
+```
+#define ALT_TAB     M(KC_ALT_TAB)
+```
+
+## Base Layers (Qwerty/Colemak/Dvorak)
+These base layers are mostly the same as the default mappings. The interesting
+changes are shown below.
+
+- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held,
+- `GUI/;` as `;` and `GUI`,
+- `Alt/"` as `"` and `Alt`,
+- `Sft/Ent` as `Enter` and `Shift`, and
+- `Hyper/Tab` as `Tab` and `Hyper`
+
+A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped.
+The arrow keys, which have been moved to the
+[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been
+replaced with the Media keys as shown. The `MC/kc` key activates the
+`MouseCursor` layer when held, and emits the corresponding `kc` for its layer,
+when tapped.
+```
+  ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+  |Hyper/Tab|   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  |   Bksp      |
+  |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+  | Ctrl/Esc |   A  |   S  | MC/D |   F  |   G  |   H  |   J  |   K  |   L  |GUI/; |   Alt/"    |
+  |----------`------`------`------`------`------`------`------`------`------`------`------------|
+  |   Shift   |   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |  Sft/Ent  |
+  |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+  |   Alt   |   GUI   |  Lower  |    TC/Space    |   TC/Space     |  Raise  |   Vol+  |  Play   |
+   `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+```
+
+## Lower Layer (Symbols and Function Keys)
+The symbols and functions keys are essentially the same as the default mapping.
+The most notable changes are that the symbol keys from the `RAISE` layer have
+been moved here. The remaining Media keys replace those that are now on the
+base layers. The `BACKLIT` key has also been moved here.
+```
+  ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+  |   ~     |   !  |   @  |   #  |   $  |   %  |   ^  |   &  |   *  |   (  |   )  |   Bksp      |
+  |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+  |   [      |  F1  |  F2  |  F3  |  F4  |  F5  |  F6  |   _  |   +  |   {  |   }  |   "|"      |
+  |----------`------`------`------`------`------`------`------`------`------`------`------------|
+  |   ]       |  F7  |  F8  |  F9  |  F10 |  F11 |  F12 |   -  |   =  |   [  |   ]  |    \      |
+  |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+  |  Brite  |         |         |                |                |         |   Vol-  |   Mute  |
+   `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+```
+
+## Raise Layer (Numbers and Arithmetic Operators)
+All of the numbers and arithmetic operators are available on this layer. Some
+keys are duplicated for the convenience of their positions. The `0` and `$`
+keys at the far left are for quick access to beginning and end of line in vim.
+```
+  ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+  |   0     |   1  |   2  |   3  |   4  |   5  |   6  |   7  |   8  |   9  |   0  |   Bksp      |
+  |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+  |   $      |   4  |   5  |   6  |   .  |   +  |   .  |   4  |   5  |   6  |   *  |   "|"      |
+  |----------`------`------`------`------`------`------`------`------`------`------`------------|
+  |   =       |   7  |   8  |   9  |   0  |   -  |   .  |   1  |   2  |   3  |   /  |    \      |
+  |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+  |  Brite  |         |         |                |                |         |   Vol-  |   Mute  |
+   `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+```
+
+## TouchCursor layer plus personal customizations
+[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key
+as the modifier, with the `IJKL` home row keys representing the inverted-T of
+the arrow keys. All of the default TouchCursor keymappings for the right hand
+are represented below. My personalizations include all of the keys shown for
+the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key
+from the base layers) readily accessible from the home row allows quick word
+jumps and highlighting when used in conjunction with the arrow keys. The
+`Alt-Tab` macro is not only useful under Windows, but also under Mac when used
+with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch).
+The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in
+this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN`
+keycodes do not seem to work. There are macros in place that'll "automatically"
+choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`,
+etc.) depending on which layout you've currently selected (`AG_NORM` or
+`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I
+use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and
+`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as
+Google Chrome.
+```
+  ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+  | AltTab  |CmdTab|CtlTab| GUI  |Shift |  ~   |Insert| Home |  Up  | End  | Bksp |             |
+  |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+  |          | Alt  |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|  Desk_R    |
+  |----------`------`------`------`------`------`------`------`------`------`------`------------|
+  |           | Undo | Cut  | Copy |Paste |  `   | PgDn | Del  |Tab_N |Tab_R |iTerm2|           |
+  |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+  |         |         |         |                |                |         |         |         |
+   `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+```
+
+## Mouse Layer
+The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer.
+The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the
+mouse from the `doc/keycode.txt` file are represented, and logically located,
+IMHO. The left and right click buttons are duplicated; on the right hand side,
+for a quick click here and there, and again on the left hand side for when the
+buttons need to be held for dragging things or highlighting text, thus allowing
+the right hand to be free to use the up/down/left/right actions.
+```
+  ,---------+------+------+------+------+------+------+------+------+------+------+-------------.
+  |         |      |ACCL0 |      |      |      |      |WHL_L |  Up  |WHL_R | BTN2 |             |
+  |---------`------`------`------`------`------`------`------`------`------`------`-------------|
+  |          |ACCL2 | BTN2 |      | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 |   BTN5     |
+  |----------`------`------`------`------`------`------`------`------`------`------`------------|
+  |           |      |      |      | BTN3 |      |WHL_Dn| BTN1 |      |      | BTN3 |           |
+  |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------|
+  |         |         |         |                |                |         |         |         |
+   `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------'
+```
index e3b557fe2de8becaea37aad83a0b97e408f2afd4..4f691a4ca0ec1635b7826a2a09fae26e7f417aac 100644 (file)
@@ -13,16 +13,16 @@ Depending on which keymap you would like to use, you will have to compile slight
 
 ### Default
 
-To build with the default keymap, simply run `make`.
+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 a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
 
-To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
 
 ```
-$ make keymap=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 
 Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
\ No newline at end of file
diff --git a/keyboards/tv44/rules.mk b/keyboards/tv44/rules.mk
new file mode 100644 (file)
index 0000000..dbba6ba
--- /dev/null
@@ -0,0 +1,69 @@
+
+
+# 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
+#   change yes to no to disable
+#
+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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= yes           # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
index 4f3130c483250fcfd07969e49a3fa5ec4af2b3ba..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,76 +1,3 @@
-
-
-# MCU name
-MCU = at90usb1286
-# 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=1024
-
-
-# Build Options
-#   change yes to no to disable
-#
-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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= yes           # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
diff --git a/keyboards/vision_division/rules.mk b/keyboards/vision_division/rules.mk
new file mode 100644 (file)
index 0000000..063fba2
--- /dev/null
@@ -0,0 +1,70 @@
+
+
+# MCU name
+MCU = at90usb1286
+# 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=1024
+
+
+# Build Options
+#   change yes to no to disable
+#
+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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= yes           # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
\ No newline at end of file
diff --git a/lib/googletest b/lib/googletest
new file mode 160000 (submodule)
index 0000000..ec44c6c
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780
diff --git a/message.mk b/message.mk
new file mode 100644 (file)
index 0000000..fa051fd
--- /dev/null
@@ -0,0 +1,79 @@
+COLOR ?= true
+
+ifeq ($(COLOR),true)
+       NO_COLOR=\033[0m
+       OK_COLOR=\033[32;01m
+       ERROR_COLOR=\033[31;01m
+       WARN_COLOR=\033[33;01m
+       BLUE=\033[0;34m
+       BOLD=\033[1m
+endif
+
+ifneq ($(shell awk --version 2>/dev/null),)
+       AWK=awk
+else
+       AWK=cat && test
+endif
+
+ON_ERROR ?= exit 1
+
+OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
+ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
+WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
+
+TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }'
+TAB_LOG_PLAIN = printf "$$LOG\n"
+AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
+AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
+PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR)
+PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
+PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR)
+PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
+PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
+BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
+MAKE_MSG_FORMAT = $(AWK) '{ printf "%-118s", $$0;}'
+
+# Define Messages
+# English
+MSG_ERRORS_NONE = Errors: none
+MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR)
+MSG_BEGIN = -------- begin --------
+MSG_END = --------  end  --------
+MSG_SIZE_BEFORE = Size before:
+MSG_SIZE_AFTER = Size after:
+MSG_COFF = Converting to AVR COFF:
+MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
+MSG_FLASH = Creating load file for Flash:
+MSG_EEPROM = Creating load file for EEPROM:
+MSG_BIN = Creating binary load file for Flash:
+MSG_EXTENDED_LISTING = Creating Extended Listing:
+MSG_SYMBOL_TABLE = Creating Symbol Table:
+MSG_LINKING = Linking:
+MSG_COMPILING = Compiling:
+MSG_COMPILING_CPP = Compiling:
+MSG_ASSEMBLING = Assembling:
+MSG_CLEANING = Cleaning project:
+MSG_CREATING_LIBRARY = Creating library:
+MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
+       Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\
+       git submodule sync --recursive\n\
+       git submodule update --init --recursive$(NO_COLOR)\n\n\
+       You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
+       or if you have modified the ChibiOS libraries yourself. \n\n
+MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
+
+define GENERATE_MSG_MAKE_KB
+    MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR)
+    ifneq ($$(MAKE_TARGET),)
+        MSG_MAKE_KB_ACTUAL += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
+    endif
+endef
+MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL)
+define GENERATE_MSG_MAKE_TEST
+    MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_NAME)$(NO_COLOR)
+    ifneq ($$(MAKE_TARGET),)
+        MSG_MAKE_TEST_ACTUAL += with target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
+    endif
+endef
+MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL)
+MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR)
index fb4c45a8dc04a87549844e52cfa6adbec55ecc87..2c87d64c29c14b395e600ec528ccbdf1891c8d7f 100644 (file)
@@ -31,9 +31,6 @@ SOFTWARE.
 // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
 // http://www.stuartcheshire.org/papers/COBSforToN.pdf
 
-#define MAX_FRAME_SIZE 1024
-#define NUM_LINKS 2
-
 typedef struct byte_stuffer_state {
     uint16_t next_zero;
     uint16_t data_pos;
index 2cc88beb42a1144584fe0f568684ab6cc8bca6f9..97e8968564a4e9e77f09f6ba85ae67d7f1d55387 100644 (file)
@@ -27,6 +27,9 @@ SOFTWARE.
 
 #include <stdint.h>
 
+#define MAX_FRAME_SIZE 1024
+#define NUM_LINKS 2
+
 void init_byte_stuffer(void);
 void byte_stuffer_recv_byte(uint8_t link, uint8_t data);
 void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size);
index f418d11ceb68af37034670b953f80d8dcbb33768..ff795fe20176df00e21b94d8bbe2b3f398d5f623 100644 (file)
@@ -31,6 +31,10 @@ SOFTWARE.
 static remote_object_t* remote_objects[MAX_REMOTE_OBJECTS];
 static uint32_t num_remote_objects = 0;
 
+void reinitialize_serial_link_transport(void) {
+    num_remote_objects = 0;
+}
+
 void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_objects) {
     unsigned int i;
     for(i=0;i<_num_remote_objects;i++) {
index 9a052d880956c0d6fe54896d90276f2b06603407..2c5d890b219aa02bd15845922c57d82e604fa53f 100644 (file)
@@ -82,7 +82,7 @@ typedef struct { \
         remote_object_t* obj = (remote_object_t*)&remote_object_##name; \
         uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\
         triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \
-        return triple_buffer_read_internal(obj->object_size, tb); \
+        return (type*)triple_buffer_read_internal(obj->object_size, tb); \
     }
 
 #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \
@@ -112,7 +112,7 @@ typedef struct { \
         remote_object_t* obj = (remote_object_t*)&remote_object_##name; \
         uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\
         triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \
-        return triple_buffer_read_internal(obj->object_size, tb); \
+        return (type*)triple_buffer_read_internal(obj->object_size, tb); \
     }
 
 #define SLAVE_TO_MASTER_OBJECT(name, type) \
@@ -139,12 +139,13 @@ typedef struct { \
         uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\
         start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \
         triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \
-        return triple_buffer_read_internal(obj->object_size, tb); \
+        return (type*)triple_buffer_read_internal(obj->object_size, tb); \
     }
 
 #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name
 
 void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects);
+void reinitialize_serial_link_transport(void);
 void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size);
 void update_transport(void);
 
diff --git a/quantum/serial_link/tests/byte_stuffer_tests.c b/quantum/serial_link/tests/byte_stuffer_tests.c
deleted file mode 100644 (file)
index 64b170e..0000000
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 Fred Sundvik
-
-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.
-*/
-
-#include <cgreen/cgreen.h>
-#include <cgreen/mocks.h>
-#include "serial_link/protocol/byte_stuffer.h"
-#include "serial_link/protocol/byte_stuffer.c"
-#include "serial_link/protocol/frame_validator.h"
-#include "serial_link/protocol/physical.h"
-
-static uint8_t sent_data[MAX_FRAME_SIZE*2];
-static uint16_t sent_data_size;
-
-Describe(ByteStuffer);
-BeforeEach(ByteStuffer) {
-    init_byte_stuffer();
-    sent_data_size = 0;
-}
-AfterEach(ByteStuffer) {}
-
-void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) {
-    mock(data, size);
-}
-
-void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
-    memcpy(sent_data + sent_data_size, data, size);
-    sent_data_size += size;
-}
-
-Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) {
-    never_expect(validator_recv_frame);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) {
-    never_expect(validator_recv_frame);
-    byte_stuffer_recv_byte(0, 0xFF);
-}
-
-Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) {
-    never_expect(validator_recv_frame);
-    byte_stuffer_recv_byte(0, 0x4A);
-}
-
-Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) {
-    never_expect(validator_recv_frame);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_single_byte_valid_frame) {
-    uint8_t expected[] = {0x37};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(1)),
-        when(data, is_equal_to_contents_of(expected, 1))
-    );
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 0x37);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_three_bytes_valid_frame) {
-    uint8_t expected[] = {0x37, 0x99, 0xFF};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(3)),
-        when(data, is_equal_to_contents_of(expected, 3))
-    );
-    byte_stuffer_recv_byte(0, 4);
-    byte_stuffer_recv_byte(0, 0x37);
-    byte_stuffer_recv_byte(0, 0x99);
-    byte_stuffer_recv_byte(0, 0xFF);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_single_zero_valid_frame) {
-    uint8_t expected[] = {0};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(1)),
-        when(data, is_equal_to_contents_of(expected, 1))
-    );
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_valid_frame_with_zeroes) {
-    uint8_t expected[] = {5, 0, 3, 0};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(expected, 4))
-    );
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 5);
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 3);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_two_valid_frames) {
-    uint8_t expected1[] = {5, 0};
-    uint8_t expected2[] = {3};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(2)),
-        when(data, is_equal_to_contents_of(expected1, 2))
-    );
-    expect(validator_recv_frame,
-        when(size, is_equal_to(1)),
-        when(data, is_equal_to_contents_of(expected2, 1))
-    );
-    byte_stuffer_recv_byte(1, 2);
-    byte_stuffer_recv_byte(1, 5);
-    byte_stuffer_recv_byte(1, 1);
-    byte_stuffer_recv_byte(1, 0);
-    byte_stuffer_recv_byte(1, 2);
-    byte_stuffer_recv_byte(1, 3);
-    byte_stuffer_recv_byte(1, 0);
-}
-
-Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) {
-    uint8_t expected[] = {5, 7};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(2)),
-        when(data, is_equal_to_contents_of(expected, 2))
-    );
-    byte_stuffer_recv_byte(1, 3);
-    byte_stuffer_recv_byte(1, 1);
-    byte_stuffer_recv_byte(1, 0);
-    byte_stuffer_recv_byte(1, 3);
-    byte_stuffer_recv_byte(1, 5);
-    byte_stuffer_recv_byte(1, 7);
-    byte_stuffer_recv_byte(1, 0);
-}
-
-Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) {
-    uint8_t expected[] = {5, 7};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(2)),
-        when(data, is_equal_to_contents_of(expected, 2))
-    );
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 9);
-    byte_stuffer_recv_byte(0, 4); // This should have been zero
-    byte_stuffer_recv_byte(0, 0);
-    byte_stuffer_recv_byte(0, 3);
-    byte_stuffer_recv_byte(0, 5);
-    byte_stuffer_recv_byte(0, 7);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) {
-    uint8_t expected[254];
-    int i;
-    for (i=0;i<254;i++) {
-        expected[i] = i + 1;
-    }
-    expect(validator_recv_frame,
-        when(size, is_equal_to(254)),
-        when(data, is_equal_to_contents_of(expected, 254))
-    );
-    byte_stuffer_recv_byte(0, 0xFF);
-    for (i=0;i<254;i++) {
-        byte_stuffer_recv_byte(0, i+1);
-    }
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) {
-    uint8_t expected[255];
-    int i;
-    for (i=0;i<254;i++) {
-        expected[i] = i + 1;
-    }
-    expected[254] = 7;
-    expect(validator_recv_frame,
-        when(size, is_equal_to(255)),
-        when(data, is_equal_to_contents_of(expected, 255))
-    );
-    byte_stuffer_recv_byte(0, 0xFF);
-    for (i=0;i<254;i++) {
-        byte_stuffer_recv_byte(0, i+1);
-    }
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 7);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) {
-    uint8_t expected[255];
-    int i;
-    for (i=0;i<254;i++) {
-        expected[i] = i + 1;
-    }
-    expected[254] = 0;
-    expect(validator_recv_frame,
-        when(size, is_equal_to(255)),
-        when(data, is_equal_to_contents_of(expected, 255))
-    );
-    byte_stuffer_recv_byte(0, 0xFF);
-    for (i=0;i<254;i++) {
-        byte_stuffer_recv_byte(0, i+1);
-    }
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_two_long_frames_and_some_more) {
-    uint8_t expected[515];
-    int i;
-    int j;
-    for (j=0;j<2;j++) {
-        for (i=0;i<254;i++) {
-            expected[i+254*j] = i + 1;
-        }
-    }
-    for (i=0;i<7;i++) {
-        expected[254*2+i] = i + 1;
-    }
-    expect(validator_recv_frame,
-        when(size, is_equal_to(515)),
-        when(data, is_equal_to_contents_of(expected, 510))
-    );
-    byte_stuffer_recv_byte(0, 0xFF);
-    for (i=0;i<254;i++) {
-        byte_stuffer_recv_byte(0, i+1);
-    }
-    byte_stuffer_recv_byte(0, 0xFF);
-    for (i=0;i<254;i++) {
-        byte_stuffer_recv_byte(0, i+1);
-    }
-    byte_stuffer_recv_byte(0, 8);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 3);
-    byte_stuffer_recv_byte(0, 4);
-    byte_stuffer_recv_byte(0, 5);
-    byte_stuffer_recv_byte(0, 6);
-    byte_stuffer_recv_byte(0, 7);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) {
-    uint8_t expected[MAX_FRAME_SIZE] = {};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(MAX_FRAME_SIZE)),
-        when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE))
-    );
-    int i;
-    byte_stuffer_recv_byte(0, 1);
-    for(i=0;i<MAX_FRAME_SIZE;i++) {
-       byte_stuffer_recv_byte(0, 1);
-    }
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, doesnt_recv_a_frame_thats_too_long_all_zeroes) {
-    uint8_t expected[1] = {0};
-    never_expect(validator_recv_frame);
-    int i;
-    byte_stuffer_recv_byte(0, 1);
-    for(i=0;i<MAX_FRAME_SIZE;i++) {
-       byte_stuffer_recv_byte(0, 1);
-    }
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, received_frame_is_aborted_when_its_too_long) {
-    uint8_t expected[1] = {1};
-    expect(validator_recv_frame,
-        when(size, is_equal_to(1)),
-        when(data, is_equal_to_contents_of(expected, 1))
-    );
-    int i;
-    byte_stuffer_recv_byte(0, 1);
-    for(i=0;i<MAX_FRAME_SIZE;i++) {
-       byte_stuffer_recv_byte(0, 1);
-    }
-    byte_stuffer_recv_byte(0, 2);
-    byte_stuffer_recv_byte(0, 1);
-    byte_stuffer_recv_byte(0, 0);
-}
-
-Ensure(ByteStuffer, does_nothing_when_sending_zero_size_frame) {
-    assert_that(sent_data_size, is_equal_to(0));
-    byte_stuffer_send_frame(0, NULL, 0);
-}
-
-Ensure(ByteStuffer, send_one_byte_frame) {
-    uint8_t data[] = {5};
-    byte_stuffer_send_frame(1, data, 1);
-    uint8_t expected[] = {2, 5, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_two_byte_frame) {
-    uint8_t data[] = {5, 0x77};
-    byte_stuffer_send_frame(0, data, 2);
-    uint8_t expected[] = {3, 5, 0x77, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_one_byte_frame_with_zero) {
-    uint8_t data[] = {0};
-    byte_stuffer_send_frame(0, data, 1);
-    uint8_t expected[] = {1, 1, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_two_byte_frame_starting_with_zero) {
-    uint8_t data[] = {0, 9};
-    byte_stuffer_send_frame(1, data, 2);
-    uint8_t expected[] = {1, 2, 9, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_two_byte_frame_starting_with_non_zero) {
-    uint8_t data[] = {9, 0};
-    byte_stuffer_send_frame(1, data, 2);
-    uint8_t expected[] = {2, 9, 1, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_three_byte_frame_zero_in_the_middle) {
-    uint8_t data[] = {9, 0, 0x68};
-    byte_stuffer_send_frame(0, data, 3);
-    uint8_t expected[] = {2, 9, 2, 0x68, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_three_byte_frame_data_in_the_middle) {
-    uint8_t data[] = {0, 0x55, 0};
-    byte_stuffer_send_frame(0, data, 3);
-    uint8_t expected[] = {1, 2, 0x55, 1, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_three_byte_frame_with_all_zeroes) {
-    uint8_t data[] = {0, 0, 0};
-    byte_stuffer_send_frame(0, data, 3);
-    uint8_t expected[] = {1, 1, 1, 1, 0};
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_frame_with_254_non_zeroes) {
-    uint8_t data[254];
-    int i;
-    for(i=0;i<254;i++) {
-        data[i] = i + 1;
-    }
-    byte_stuffer_send_frame(0, data, 254);
-    uint8_t expected[256];
-    expected[0] = 0xFF;
-    for(i=1;i<255;i++) {
-        expected[i] = i;
-    }
-    expected[255] = 0;
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_frame_with_255_non_zeroes) {
-    uint8_t data[255];
-    int i;
-    for(i=0;i<255;i++) {
-        data[i] = i + 1;
-    }
-    byte_stuffer_send_frame(0, data, 255);
-    uint8_t expected[258];
-    expected[0] = 0xFF;
-    for(i=1;i<255;i++) {
-        expected[i] = i;
-    }
-    expected[255] = 2;
-    expected[256] = 255;
-    expected[257] = 0;
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_frame_with_254_non_zeroes_followed_by_zero) {
-    uint8_t data[255];
-    int i;
-    for(i=0;i<254;i++) {
-        data[i] = i + 1;
-    }
-    data[255] = 0;
-    byte_stuffer_send_frame(0, data, 255);
-    uint8_t expected[258];
-    expected[0] = 0xFF;
-    for(i=1;i<255;i++) {
-        expected[i] = i;
-    }
-    expected[255] = 1;
-    expected[256] = 1;
-    expected[257] = 0;
-    assert_that(sent_data_size, is_equal_to(sizeof(expected)));
-    assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected)));
-}
-
-Ensure(ByteStuffer, sends_and_receives_full_roundtrip_small_packet) {
-    uint8_t original_data[] = { 1, 2, 3};
-    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
-    expect(validator_recv_frame,
-        when(size, is_equal_to(sizeof(original_data))),
-        when(data, is_equal_to_contents_of(original_data, sizeof(original_data)))
-    );
-    int i;
-    for(i=0;i<sent_data_size;i++) {
-       byte_stuffer_recv_byte(1, sent_data[i]);
-    }
-}
-
-Ensure(ByteStuffer, sends_and_receives_full_roundtrip_small_packet_with_zeros) {
-    uint8_t original_data[] = { 1, 0, 3, 0, 0, 9};
-    byte_stuffer_send_frame(1, original_data, sizeof(original_data));
-    expect(validator_recv_frame,
-        when(size, is_equal_to(sizeof(original_data))),
-        when(data, is_equal_to_contents_of(original_data, sizeof(original_data)))
-    );
-    int i;
-    for(i=0;i<sent_data_size;i++) {
-       byte_stuffer_recv_byte(0, sent_data[i]);
-    }
-}
-
-Ensure(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes) {
-    uint8_t original_data[254];
-    int i;
-    for(i=0;i<254;i++) {
-        original_data[i] = i + 1;
-    }
-    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
-    expect(validator_recv_frame,
-        when(size, is_equal_to(sizeof(original_data))),
-        when(data, is_equal_to_contents_of(original_data, sizeof(original_data)))
-    );
-    for(i=0;i<sent_data_size;i++) {
-       byte_stuffer_recv_byte(1, sent_data[i]);
-    }
-}
-
-Ensure(ByteStuffer, sends_and_receives_full_roundtrip_256_bytes) {
-    uint8_t original_data[256];
-    int i;
-    for(i=0;i<254;i++) {
-        original_data[i] = i + 1;
-    }
-    original_data[254] = 22;
-    original_data[255] = 23;
-    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
-    expect(validator_recv_frame,
-        when(size, is_equal_to(sizeof(original_data))),
-        when(data, is_equal_to_contents_of(original_data, sizeof(original_data)))
-    );
-    for(i=0;i<sent_data_size;i++) {
-       byte_stuffer_recv_byte(1, sent_data[i]);
-    }
-}
-
-Ensure(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes_and_then_zero) {
-    uint8_t original_data[255];
-    int i;
-    for(i=0;i<254;i++) {
-        original_data[i] = i + 1;
-    }
-    original_data[254] = 0;
-    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
-    expect(validator_recv_frame,
-        when(size, is_equal_to(sizeof(original_data))),
-        when(data, is_equal_to_contents_of(original_data, sizeof(original_data)))
-    );
-    for(i=0;i<sent_data_size;i++) {
-       byte_stuffer_recv_byte(1, sent_data[i]);
-    }
-}
diff --git a/quantum/serial_link/tests/byte_stuffer_tests.cpp b/quantum/serial_link/tests/byte_stuffer_tests.cpp
new file mode 100644 (file)
index 0000000..ff49d72
--- /dev/null
@@ -0,0 +1,483 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2016 Fred Sundvik
+
+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.
+*/
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include <vector>
+#include <algorithm>
+extern "C" {
+#include "serial_link/protocol/byte_stuffer.h"
+#include "serial_link/protocol/frame_validator.h"
+#include "serial_link/protocol/physical.h"
+}
+
+using testing::_;
+using testing::ElementsAreArray;
+using testing::Args;
+
+class ByteStuffer : public ::testing::Test{
+public:
+    ByteStuffer() {
+        Instance = this;
+        init_byte_stuffer();
+    }
+
+    ~ByteStuffer() {
+        Instance = nullptr;
+    }
+
+    MOCK_METHOD3(validator_recv_frame, void (uint8_t link, uint8_t* data, uint16_t size));
+
+    void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
+        std::copy(data, data + size, std::back_inserter(sent_data));
+    }
+    std::vector<uint8_t> sent_data;
+
+    static ByteStuffer* Instance;
+};
+
+ByteStuffer* ByteStuffer::Instance = nullptr;
+
+extern "C" {
+    void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) {
+        ByteStuffer::Instance->validator_recv_frame(link, data, size);
+    }
+
+    void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
+        ByteStuffer::Instance->send_data(link, data, size);
+    }
+}
+
+TEST_F(ByteStuffer, receives_no_frame_for_a_single_zero_byte) {
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .Times(0);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_no_frame_for_a_single_FF_byte) {
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .Times(0);
+    byte_stuffer_recv_byte(0, 0xFF);
+}
+
+TEST_F(ByteStuffer, receives_no_frame_for_a_single_random_byte) {
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .Times(0);
+    byte_stuffer_recv_byte(0, 0x4A);
+}
+
+TEST_F(ByteStuffer, receives_no_frame_for_a_zero_length_frame) {
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .Times(0);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_single_byte_valid_frame) {
+    uint8_t expected[] = {0x37};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 0x37);
+    byte_stuffer_recv_byte(0, 0);
+}
+TEST_F(ByteStuffer, receives_three_bytes_valid_frame) {
+    uint8_t expected[] = {0x37, 0x99, 0xFF};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 4);
+    byte_stuffer_recv_byte(0, 0x37);
+    byte_stuffer_recv_byte(0, 0x99);
+    byte_stuffer_recv_byte(0, 0xFF);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_single_zero_valid_frame) {
+    uint8_t expected[] = {0};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_valid_frame_with_zeroes) {
+    uint8_t expected[] = {5, 0, 3, 0};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 5);
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 3);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+
+TEST_F(ByteStuffer, receives_two_valid_frames) {
+    uint8_t expected1[] = {5, 0};
+    uint8_t expected2[] = {3};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected1)));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected2)));
+    byte_stuffer_recv_byte(1, 2);
+    byte_stuffer_recv_byte(1, 5);
+    byte_stuffer_recv_byte(1, 1);
+    byte_stuffer_recv_byte(1, 0);
+    byte_stuffer_recv_byte(1, 2);
+    byte_stuffer_recv_byte(1, 3);
+    byte_stuffer_recv_byte(1, 0);
+}
+
+TEST_F(ByteStuffer, receives_valid_frame_after_unexpected_zero) {
+    uint8_t expected[] = {5, 7};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(1, 3);
+    byte_stuffer_recv_byte(1, 1);
+    byte_stuffer_recv_byte(1, 0);
+    byte_stuffer_recv_byte(1, 3);
+    byte_stuffer_recv_byte(1, 5);
+    byte_stuffer_recv_byte(1, 7);
+    byte_stuffer_recv_byte(1, 0);
+}
+
+TEST_F(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) {
+    uint8_t expected[] = {5, 7};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 9);
+    byte_stuffer_recv_byte(0, 4); // This should have been zero
+    byte_stuffer_recv_byte(0, 0);
+    byte_stuffer_recv_byte(0, 3);
+    byte_stuffer_recv_byte(0, 5);
+    byte_stuffer_recv_byte(0, 7);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) {
+    uint8_t expected[254];
+    int i;
+    for (i=0;i<254;i++) {
+        expected[i] = i + 1;
+    }
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 0xFF);
+    for (i=0;i<254;i++) {
+        byte_stuffer_recv_byte(0, i+1);
+    }
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) {
+    uint8_t expected[255];
+    int i;
+    for (i=0;i<254;i++) {
+        expected[i] = i + 1;
+    }
+    expected[254] = 7;
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 0xFF);
+    for (i=0;i<254;i++) {
+        byte_stuffer_recv_byte(0, i+1);
+    }
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 7);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) {
+    uint8_t expected[255];
+    int i;
+    for (i=0;i<254;i++) {
+        expected[i] = i + 1;
+    }
+    expected[254] = 0;
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 0xFF);
+    for (i=0;i<254;i++) {
+        byte_stuffer_recv_byte(0, i+1);
+    }
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_two_long_frames_and_some_more) {
+    uint8_t expected[515];
+    int i;
+    int j;
+    for (j=0;j<2;j++) {
+        for (i=0;i<254;i++) {
+            expected[i+254*j] = i + 1;
+        }
+    }
+    for (i=0;i<7;i++) {
+        expected[254*2+i] = i + 1;
+    }
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    byte_stuffer_recv_byte(0, 0xFF);
+    for (i=0;i<254;i++) {
+        byte_stuffer_recv_byte(0, i+1);
+    }
+    byte_stuffer_recv_byte(0, 0xFF);
+    for (i=0;i<254;i++) {
+        byte_stuffer_recv_byte(0, i+1);
+    }
+    byte_stuffer_recv_byte(0, 8);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 3);
+    byte_stuffer_recv_byte(0, 4);
+    byte_stuffer_recv_byte(0, 5);
+    byte_stuffer_recv_byte(0, 6);
+    byte_stuffer_recv_byte(0, 7);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) {
+    uint8_t expected[MAX_FRAME_SIZE] = {};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    int i;
+    byte_stuffer_recv_byte(0, 1);
+    for(i=0;i<MAX_FRAME_SIZE;i++) {
+       byte_stuffer_recv_byte(0, 1);
+    }
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, doesnt_recv_a_frame_thats_too_long_all_zeroes) {
+    uint8_t expected[1] = {0};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .Times(0);
+    int i;
+    byte_stuffer_recv_byte(0, 1);
+    for(i=0;i<MAX_FRAME_SIZE;i++) {
+       byte_stuffer_recv_byte(0, 1);
+    }
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, received_frame_is_aborted_when_its_too_long) {
+    uint8_t expected[1] = {1};
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    int i;
+    byte_stuffer_recv_byte(0, 1);
+    for(i=0;i<MAX_FRAME_SIZE;i++) {
+       byte_stuffer_recv_byte(0, 1);
+    }
+    byte_stuffer_recv_byte(0, 2);
+    byte_stuffer_recv_byte(0, 1);
+    byte_stuffer_recv_byte(0, 0);
+}
+
+TEST_F(ByteStuffer, does_nothing_when_sending_zero_size_frame) {
+    EXPECT_EQ(sent_data.size(), 0);
+    byte_stuffer_send_frame(0, NULL, 0);
+}
+
+TEST_F(ByteStuffer, send_one_byte_frame) {
+    uint8_t data[] = {5};
+    byte_stuffer_send_frame(1, data, 1);
+    uint8_t expected[] = {2, 5, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_two_byte_frame) {
+    uint8_t data[] = {5, 0x77};
+    byte_stuffer_send_frame(0, data, 2);
+    uint8_t expected[] = {3, 5, 0x77, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_one_byte_frame_with_zero) {
+    uint8_t data[] = {0};
+    byte_stuffer_send_frame(0, data, 1);
+    uint8_t expected[] = {1, 1, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_two_byte_frame_starting_with_zero) {
+    uint8_t data[] = {0, 9};
+    byte_stuffer_send_frame(1, data, 2);
+    uint8_t expected[] = {1, 2, 9, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_two_byte_frame_starting_with_non_zero) {
+    uint8_t data[] = {9, 0};
+    byte_stuffer_send_frame(1, data, 2);
+    uint8_t expected[] = {2, 9, 1, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_three_byte_frame_zero_in_the_middle) {
+    uint8_t data[] = {9, 0, 0x68};
+    byte_stuffer_send_frame(0, data, 3);
+    uint8_t expected[] = {2, 9, 2, 0x68, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_three_byte_frame_data_in_the_middle) {
+    uint8_t data[] = {0, 0x55, 0};
+    byte_stuffer_send_frame(0, data, 3);
+    uint8_t expected[] = {1, 2, 0x55, 1, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_three_byte_frame_with_all_zeroes) {
+    uint8_t data[] = {0, 0, 0};
+    byte_stuffer_send_frame(0, data, 3);
+    uint8_t expected[] = {1, 1, 1, 1, 0};
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_frame_with_254_non_zeroes) {
+    uint8_t data[254];
+    int i;
+    for(i=0;i<254;i++) {
+        data[i] = i + 1;
+    }
+    byte_stuffer_send_frame(0, data, 254);
+    uint8_t expected[256];
+    expected[0] = 0xFF;
+    for(i=1;i<255;i++) {
+        expected[i] = i;
+    }
+    expected[255] = 0;
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_frame_with_255_non_zeroes) {
+    uint8_t data[255];
+    int i;
+    for(i=0;i<255;i++) {
+        data[i] = i + 1;
+    }
+    byte_stuffer_send_frame(0, data, 255);
+    uint8_t expected[258];
+    expected[0] = 0xFF;
+    for(i=1;i<255;i++) {
+        expected[i] = i;
+    }
+    expected[255] = 2;
+    expected[256] = 255;
+    expected[257] = 0;
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_frame_with_254_non_zeroes_followed_by_zero) {
+    uint8_t data[255];
+    int i;
+    for(i=0;i<254;i++) {
+        data[i] = i + 1;
+    }
+    data[254] = 0;
+    byte_stuffer_send_frame(0, data, 255);
+    uint8_t expected[258];
+    expected[0] = 0xFF;
+    for(i=1;i<255;i++) {
+        expected[i] = i;
+    }
+    expected[255] = 1;
+    expected[256] = 1;
+    expected[257] = 0;
+    EXPECT_THAT(sent_data, ElementsAreArray(expected));
+}
+
+TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_small_packet) {
+    uint8_t original_data[] = { 1, 2, 3};
+    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(original_data)));
+    int i;
+    for(auto& d : sent_data) {
+       byte_stuffer_recv_byte(1, d);
+    }
+}
+
+TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_small_packet_with_zeros) {
+    uint8_t original_data[] = { 1, 0, 3, 0, 0, 9};
+    byte_stuffer_send_frame(1, original_data, sizeof(original_data));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(original_data)));
+    int i;
+    for(auto& d : sent_data) {
+       byte_stuffer_recv_byte(1, d);
+    }
+}
+
+TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes) {
+    uint8_t original_data[254];
+    int i;
+    for(i=0;i<254;i++) {
+        original_data[i] = i + 1;
+    }
+    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(original_data)));
+    for(auto& d : sent_data) {
+       byte_stuffer_recv_byte(1, d);
+    }
+}
+
+TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_256_bytes) {
+    uint8_t original_data[256];
+    int i;
+    for(i=0;i<254;i++) {
+        original_data[i] = i + 1;
+    }
+    original_data[254] = 22;
+    original_data[255] = 23;
+    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(original_data)));
+    for(auto& d : sent_data) {
+       byte_stuffer_recv_byte(1, d);
+    }
+}
+
+TEST_F(ByteStuffer, sends_and_receives_full_roundtrip_254_bytes_and_then_zero) {
+    uint8_t original_data[255];
+    int i;
+    for(i=0;i<254;i++) {
+        original_data[i] = i + 1;
+    }
+    original_data[254] = 0;
+    byte_stuffer_send_frame(0, original_data, sizeof(original_data));
+    EXPECT_CALL(*this, validator_recv_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(original_data)));
+    for(auto& d : sent_data) {
+       byte_stuffer_recv_byte(1, d);
+    }
+}
diff --git a/quantum/serial_link/tests/frame_router_tests.c b/quantum/serial_link/tests/frame_router_tests.c
deleted file mode 100644 (file)
index 6c806fa..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 Fred Sundvik
-
-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.
-*/
-
-#include <cgreen/cgreen.h>
-#include <cgreen/mocks.h>
-#include "serial_link/protocol/byte_stuffer.c"
-#include "serial_link/protocol/frame_validator.c"
-#include "serial_link/protocol/frame_router.c"
-#include "serial_link/protocol/transport.h"
-
-static uint8_t received_data[256];
-static uint16_t received_data_size;
-
-typedef struct {
-    uint8_t sent_data[256];
-    uint16_t sent_data_size;
-} receive_buffer_t;
-
-typedef struct {
-    receive_buffer_t send_buffers[2];
-} router_buffer_t;
-
-router_buffer_t router_buffers[8];
-
-router_buffer_t* current_router_buffer;
-
-
-Describe(FrameRouter);
-BeforeEach(FrameRouter) {
-    init_byte_stuffer();
-    memset(router_buffers, 0, sizeof(router_buffers));
-    current_router_buffer = 0;
-}
-AfterEach(FrameRouter) {}
-
-typedef struct {
-    uint32_t data;
-    uint8_t extra[16];
-} frame_buffer_t;
-
-
-void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
-    receive_buffer_t* buffer = &current_router_buffer->send_buffers[link];
-    memcpy(buffer->sent_data + buffer->sent_data_size, data, size);
-    buffer->sent_data_size += size;
-}
-
-static void receive_data(uint8_t link, uint8_t* data, uint16_t size) {
-    int i;
-    for(i=0;i<size;i++) {
-        byte_stuffer_recv_byte(link, data[i]);
-    }
-}
-
-static void activate_router(uint8_t num) {
-    current_router_buffer = router_buffers + num;
-    router_set_master(num==0);
-}
-
-static void simulate_transport(uint8_t from, uint8_t to) {
-   activate_router(to);
-   if (from > to) {
-       receive_data(DOWN_LINK,
-               router_buffers[from].send_buffers[UP_LINK].sent_data,
-               router_buffers[from].send_buffers[UP_LINK].sent_data_size);
-   }
-   else if(to > from) {
-       receive_data(UP_LINK,
-               router_buffers[from].send_buffers[DOWN_LINK].sent_data,
-               router_buffers[from].send_buffers[DOWN_LINK].sent_data_size);
-   }
-}
-
-void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) {
-    mock(from, data, size);
-}
-
-
-Ensure(FrameRouter, master_broadcast_is_received_by_everyone) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(0);
-    router_send_frame(0xFF, (uint8_t*)&data, 4);
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(0)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(0, 1);
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(0)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(1, 2);
-    assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, master_send_is_received_by_targets) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(0);
-    router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4);
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-
-    simulate_transport(0, 1);
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(0)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(1, 2);
-    assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(0)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(2, 3);
-    assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, first_link_sends_to_master) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(1);
-    router_send_frame(0, (uint8_t*)&data, 4);
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(1)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(1, 0);
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, second_link_sends_to_master) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(2);
-    router_send_frame(0, (uint8_t*)&data, 4);
-    assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-
-    simulate_transport(2, 1);
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-
-    expect(transport_recv_frame,
-        when(from, is_equal_to(2)),
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(&data.data, 4))
-    );
-    simulate_transport(1, 0);
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, master_sends_to_master_does_nothing) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(0);
-    router_send_frame(0, (uint8_t*)&data, 4);
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, link_sends_to_other_link_does_nothing) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(1);
-    router_send_frame(2, (uint8_t*)&data, 4);
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-}
-
-Ensure(FrameRouter, master_receives_on_uplink_does_nothing) {
-    frame_buffer_t data;
-    data.data = 0xAB7055BB;
-    activate_router(1);
-    router_send_frame(0, (uint8_t*)&data, 4);
-    assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0));
-    assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-
-    never_expect(transport_recv_frame);
-    activate_router(0);
-    receive_data(UP_LINK,
-        router_buffers[1].send_buffers[UP_LINK].sent_data,
-        router_buffers[1].send_buffers[UP_LINK].sent_data_size);
-    assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0));
-    assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0));
-}
diff --git a/quantum/serial_link/tests/frame_router_tests.cpp b/quantum/serial_link/tests/frame_router_tests.cpp
new file mode 100644 (file)
index 0000000..2bd5bf8
--- /dev/null
@@ -0,0 +1,229 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2016 Fred Sundvik
+
+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.
+*/
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include <array>
+extern "C" {
+    #include "serial_link/protocol/transport.h"
+    #include "serial_link/protocol/byte_stuffer.h"
+    #include "serial_link/protocol/frame_router.h"
+}
+
+using testing::_;
+using testing::ElementsAreArray;
+using testing::Args;
+
+class FrameRouter : public testing::Test {
+public:
+    FrameRouter() :
+        current_router_buffer(nullptr)
+    {
+        Instance = this;
+        init_byte_stuffer();
+    }
+
+    ~FrameRouter() {
+        Instance = nullptr;
+    }
+
+    void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
+        auto& buffer = current_router_buffer->send_buffers[link];
+        std::copy(data, data + size, std::back_inserter(buffer));
+    }
+
+    void receive_data(uint8_t link, uint8_t* data, uint16_t size) {
+        int i;
+        for(i=0;i<size;i++) {
+            byte_stuffer_recv_byte(link, data[i]);
+        }
+    }
+
+    void activate_router(uint8_t num) {
+        current_router_buffer = router_buffers + num;
+        router_set_master(num==0);
+    }
+
+    void simulate_transport(uint8_t from, uint8_t to) {
+       activate_router(to);
+       if (from > to) {
+           receive_data(DOWN_LINK,
+                   router_buffers[from].send_buffers[UP_LINK].data(),
+                   router_buffers[from].send_buffers[UP_LINK].size());
+       }
+       else if(to > from) {
+           receive_data(UP_LINK,
+                   router_buffers[from].send_buffers[DOWN_LINK].data(),
+                   router_buffers[from].send_buffers[DOWN_LINK].size());
+       }
+    }
+
+    MOCK_METHOD3(transport_recv_frame, void (uint8_t from, uint8_t* data, uint16_t size));
+
+    std::vector<uint8_t> received_data;
+
+    struct router_buffer {
+        std::vector<uint8_t> send_buffers[2];
+    };
+
+    router_buffer router_buffers[8];
+    router_buffer* current_router_buffer;
+
+    static FrameRouter* Instance;
+};
+
+FrameRouter* FrameRouter::Instance = nullptr;
+
+
+typedef struct {
+    std::array<uint8_t, 4> data;
+    uint8_t extra[16];
+} frame_buffer_t;
+
+
+extern "C" {
+    void send_data(uint8_t link, const uint8_t* data, uint16_t size) {
+        FrameRouter::Instance->send_data(link, data, size);
+    }
+
+
+    void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) {
+        FrameRouter::Instance->transport_recv_frame(from, data, size);
+    }
+}
+
+TEST_F(FrameRouter, master_broadcast_is_received_by_everyone) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(0);
+    router_send_frame(0xFF, (uint8_t*)&data, 4);
+    EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+    EXPECT_CALL(*this, transport_recv_frame(0, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(0, 1);
+    EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(0, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(1, 2);
+    EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, master_send_is_received_by_targets) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(0);
+    router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4);
+    EXPECT_GT(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+
+    simulate_transport(0, 1);
+    EXPECT_GT(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(0, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(1, 2);
+    EXPECT_GT(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[2].send_buffers[UP_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(0, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(2, 3);
+    EXPECT_GT(router_buffers[3].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[3].send_buffers[UP_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, first_link_sends_to_master) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(1);
+    router_send_frame(0, (uint8_t*)&data, 4);
+    EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(1, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(1, 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, second_link_sends_to_master) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(2);
+    router_send_frame(0, (uint8_t*)&data, 4);
+    EXPECT_GT(router_buffers[2].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[2].send_buffers[DOWN_LINK].size(), 0);
+
+    simulate_transport(2, 1);
+    EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(2, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data.data)));
+    simulate_transport(1, 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, master_sends_to_master_does_nothing) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(0);
+    router_send_frame(0, (uint8_t*)&data, 4);
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, link_sends_to_other_link_does_nothing) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(1);
+    router_send_frame(2, (uint8_t*)&data, 4);
+    EXPECT_EQ(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+}
+
+TEST_F(FrameRouter, master_receives_on_uplink_does_nothing) {
+    frame_buffer_t data;
+    data.data = {0xAB, 0x70, 0x55, 0xBB};
+    activate_router(1);
+    router_send_frame(0, (uint8_t*)&data, 4);
+    EXPECT_GT(router_buffers[1].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[1].send_buffers[DOWN_LINK].size(), 0);
+
+    EXPECT_CALL(*this, transport_recv_frame(_, _, _))
+        .Times(0);
+    activate_router(0);
+    receive_data(UP_LINK,
+        router_buffers[1].send_buffers[UP_LINK].data(),
+        router_buffers[1].send_buffers[UP_LINK].size());
+    EXPECT_EQ(router_buffers[0].send_buffers[UP_LINK].size(), 0);
+    EXPECT_EQ(router_buffers[0].send_buffers[DOWN_LINK].size(), 0);
+}
diff --git a/quantum/serial_link/tests/frame_validator_tests.c b/quantum/serial_link/tests/frame_validator_tests.c
deleted file mode 100644 (file)
index d20947e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 Fred Sundvik
-
-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.
-*/
-
-#include <cgreen/cgreen.h>
-#include <cgreen/mocks.h>
-#include "serial_link/protocol/frame_validator.c"
-
-void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) {
-    mock(data, size);
-}
-
-void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) {
-    mock(data, size);
-}
-
-Describe(FrameValidator);
-BeforeEach(FrameValidator) {}
-AfterEach(FrameValidator) {}
-
-Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) {
-    never_expect(route_incoming_frame);
-    uint8_t data[] = {1, 2};
-    validator_recv_frame(0, 0, 1);
-    validator_recv_frame(0, data, 2);
-    validator_recv_frame(0, data, 3);
-    validator_recv_frame(0, data, 4);
-}
-
-Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) {
-    uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3};
-    expect(route_incoming_frame,
-        when(size, is_equal_to(1)),
-        when(data, is_equal_to_contents_of(data, 1))
-    );
-    validator_recv_frame(0, data, 5);
-}
-
-Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) {
-    uint8_t data[] = {0x44, 0, 0, 0, 0};
-    never_expect(route_incoming_frame);
-    validator_recv_frame(1, data, 5);
-}
-
-Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) {
-    uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA};
-    expect(route_incoming_frame,
-        when(size, is_equal_to(4)),
-        when(data, is_equal_to_contents_of(data, 4))
-    );
-    validator_recv_frame(1, data, 8);
-}
-
-Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) {
-    uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47};
-    expect(route_incoming_frame,
-        when(size, is_equal_to(5)),
-        when(data, is_equal_to_contents_of(data, 5))
-    );
-    validator_recv_frame(0, data, 9);
-}
-
-Ensure(FrameValidator, sends_one_byte_with_correct_crc) {
-    uint8_t original[] = {0x44, 0, 0, 0, 0};
-    uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3};
-    expect(byte_stuffer_send_frame,
-        when(size, is_equal_to(sizeof(expected))),
-        when(data, is_equal_to_contents_of(expected, sizeof(expected)))
-    );
-    validator_send_frame(0, original, 1);
-}
-
-Ensure(FrameValidator, sends_five_bytes_with_correct_crc) {
-    uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0};
-    uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47};
-    expect(byte_stuffer_send_frame,
-        when(size, is_equal_to(sizeof(expected))),
-        when(data, is_equal_to_contents_of(expected, sizeof(expected)))
-    );
-    validator_send_frame(0, original, 5);
-}
diff --git a/quantum/serial_link/tests/frame_validator_tests.cpp b/quantum/serial_link/tests/frame_validator_tests.cpp
new file mode 100644 (file)
index 0000000..9223af8
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2016 Fred Sundvik
+
+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.
+*/
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+extern "C" {
+#include "serial_link/protocol/frame_validator.h"
+}
+
+using testing::_;
+using testing::ElementsAreArray;
+using testing::Args;
+
+class FrameValidator : public testing::Test {
+public:
+    FrameValidator() {
+        Instance = this;
+    }
+
+    ~FrameValidator() {
+        Instance = nullptr;
+    }
+
+    MOCK_METHOD3(route_incoming_frame, void (uint8_t link, uint8_t* data, uint16_t size));
+    MOCK_METHOD3(byte_stuffer_send_frame, void (uint8_t link, uint8_t* data, uint16_t size));
+
+    static FrameValidator* Instance;
+};
+
+FrameValidator* FrameValidator::Instance = nullptr;
+
+extern "C" {
+void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) {
+    FrameValidator::Instance->route_incoming_frame(link, data, size);
+}
+
+void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) {
+    FrameValidator::Instance->byte_stuffer_send_frame(link, data, size);
+}
+}
+
+TEST_F(FrameValidator, doesnt_validate_frames_under_5_bytes) {
+    EXPECT_CALL(*this, route_incoming_frame(_, _, _))
+        .Times(0);
+    uint8_t data[] = {1, 2};
+    validator_recv_frame(0, 0, 1);
+    validator_recv_frame(0, data, 2);
+    validator_recv_frame(0, data, 3);
+    validator_recv_frame(0, data, 4);
+}
+
+TEST_F(FrameValidator, validates_one_byte_frame_with_correct_crc) {
+    uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3};
+    EXPECT_CALL(*this, route_incoming_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data, 1)));
+    validator_recv_frame(0, data, 5);
+}
+
+TEST_F(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) {
+    uint8_t data[] = {0x44, 0, 0, 0, 0};
+    EXPECT_CALL(*this, route_incoming_frame(_, _, _))
+        .Times(0);
+    validator_recv_frame(1, data, 5);
+}
+
+TEST_F(FrameValidator, validates_four_byte_frame_with_correct_crc) {
+    uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA};
+    EXPECT_CALL(*this, route_incoming_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data, 4)));
+    validator_recv_frame(1, data, 8);
+}
+
+TEST_F(FrameValidator, validates_five_byte_frame_with_correct_crc) {
+    uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47};
+    EXPECT_CALL(*this, route_incoming_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(data, 5)));
+    validator_recv_frame(0, data, 9);
+}
+
+TEST_F(FrameValidator, sends_one_byte_with_correct_crc) {
+    uint8_t original[] = {0x44, 0, 0, 0, 0};
+    uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3};
+    EXPECT_CALL(*this, byte_stuffer_send_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    validator_send_frame(0, original, 1);
+}
+
+TEST_F(FrameValidator, sends_five_bytes_with_correct_crc) {
+    uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0};
+    uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47};
+    EXPECT_CALL(*this, byte_stuffer_send_frame(_, _, _))
+        .With(Args<1, 2>(ElementsAreArray(expected)));
+    validator_send_frame(0, original, 5);
+}
diff --git a/quantum/serial_link/tests/rules.mk b/quantum/serial_link/tests/rules.mk
new file mode 100644 (file)
index 0000000..b81515b
--- /dev/null
@@ -0,0 +1,22 @@
+serial_link_byte_stuffer_SRC :=\
+       $(SERIAL_PATH)/tests/byte_stuffer_tests.cpp \
+       $(SERIAL_PATH)/protocol/byte_stuffer.c
+
+serial_link_frame_validator_SRC := \
+       $(SERIAL_PATH)/tests/frame_validator_tests.cpp \
+       $(SERIAL_PATH)/protocol/frame_validator.c 
+
+serial_link_frame_router_SRC := \
+       $(SERIAL_PATH)/tests/frame_router_tests.cpp \
+       $(SERIAL_PATH)/protocol/byte_stuffer.c \
+       $(SERIAL_PATH)/protocol/frame_validator.c \
+       $(SERIAL_PATH)/protocol/frame_router.c
+
+serial_link_triple_buffered_object_SRC := \
+       $(SERIAL_PATH)/tests/triple_buffered_object_tests.cpp \
+       $(SERIAL_PATH)/protocol/triple_buffered_object.c 
+
+serial_link_transport_SRC := \
+       $(SERIAL_PATH)/tests/transport_tests.cpp \
+       $(SERIAL_PATH)/protocol/transport.c \
+       $(SERIAL_PATH)/protocol/triple_buffered_object.c 
diff --git a/quantum/serial_link/tests/testlist.mk b/quantum/serial_link/tests/testlist.mk
new file mode 100644 (file)
index 0000000..a80e888
--- /dev/null
@@ -0,0 +1,6 @@
+TEST_LIST +=\
+       serial_link_byte_stuffer\
+       serial_link_frame_validator\
+       serial_link_frame_router\
+       serial_link_triple_buffered_object\
+       serial_link_transport
\ No newline at end of file
diff --git a/quantum/serial_link/tests/transport_tests.c b/quantum/serial_link/tests/transport_tests.c
deleted file mode 100644 (file)
index 358e1b9..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 Fred Sundvik
-
-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.
-*/
-
-#include <cgreen/cgreen.h>
-#include <cgreen/mocks.h>
-#include "serial_link/protocol/transport.c"
-#include "serial_link/protocol/triple_buffered_object.c"
-
-void signal_data_written(void) {
-    mock();
-}
-
-static uint8_t sent_data[2048];
-static uint16_t sent_data_size;
-
-void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
-    mock(destination);
-    memcpy(sent_data + sent_data_size, data, size);
-    sent_data_size += size;
-}
-
-typedef struct {
-    uint32_t test;
-} test_object1_t;
-
-typedef struct {
-    uint32_t test1;
-    uint32_t test2;
-} test_object2_t;
-
-MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t);
-MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t);
-SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t);
-
-static remote_object_t* test_remote_objects[] = {
-    REMOTE_OBJECT(master_to_slave),
-    REMOTE_OBJECT(master_to_single_slave),
-    REMOTE_OBJECT(slave_to_master),
-};
-
-Describe(Transport);
-BeforeEach(Transport) {
-    add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*));
-    sent_data_size = 0;
-}
-AfterEach(Transport) {}
-
-Ensure(Transport, write_to_local_signals_an_event) {
-    begin_write_master_to_slave();
-    expect(signal_data_written);
-    end_write_master_to_slave();
-    begin_write_slave_to_master();
-    expect(signal_data_written);
-    end_write_slave_to_master();
-    begin_write_master_to_single_slave(1);
-    expect(signal_data_written);
-    end_write_master_to_single_slave(1);
-}
-
-Ensure(Transport, writes_from_master_to_all_slaves) {
-    update_transport();
-    test_object1_t* obj = begin_write_master_to_slave();
-    obj->test = 5;
-    expect(signal_data_written);
-    end_write_master_to_slave();
-    expect(router_send_frame,
-            when(destination, is_equal_to(0xFF)));
-    update_transport();
-    transport_recv_frame(0, sent_data, sent_data_size);
-    test_object1_t* obj2 = read_master_to_slave();
-    assert_that(obj2, is_not_equal_to(NULL));
-    assert_that(obj2->test, is_equal_to(5));
-}
-
-Ensure(Transport, writes_from_slave_to_master) {
-    update_transport();
-    test_object1_t* obj = begin_write_slave_to_master();
-    obj->test = 7;
-    expect(signal_data_written);
-    end_write_slave_to_master();
-    expect(router_send_frame,
-            when(destination, is_equal_to(0)));
-    update_transport();
-    transport_recv_frame(3, sent_data, sent_data_size);
-    test_object1_t* obj2 = read_slave_to_master(2);
-    assert_that(read_slave_to_master(0), is_equal_to(NULL));
-    assert_that(obj2, is_not_equal_to(NULL));
-    assert_that(obj2->test, is_equal_to(7));
-}
-
-Ensure(Transport, writes_from_master_to_single_slave) {
-    update_transport();
-    test_object1_t* obj = begin_write_master_to_single_slave(3);
-    obj->test = 7;
-    expect(signal_data_written);
-    end_write_master_to_single_slave(3);
-    expect(router_send_frame,
-            when(destination, is_equal_to(4)));
-    update_transport();
-    transport_recv_frame(0, sent_data, sent_data_size);
-    test_object1_t* obj2 = read_master_to_single_slave();
-    assert_that(obj2, is_not_equal_to(NULL));
-    assert_that(obj2->test, is_equal_to(7));
-}
-
-Ensure(Transport, ignores_object_with_invalid_id) {
-    update_transport();
-    test_object1_t* obj = begin_write_master_to_single_slave(3);
-    obj->test = 7;
-    expect(signal_data_written);
-    end_write_master_to_single_slave(3);
-    expect(router_send_frame,
-            when(destination, is_equal_to(4)));
-    update_transport();
-    sent_data[sent_data_size - 1] = 44;
-    transport_recv_frame(0, sent_data, sent_data_size);
-    test_object1_t* obj2 = read_master_to_single_slave();
-    assert_that(obj2, is_equal_to(NULL));
-}
-
-Ensure(Transport, ignores_object_with_size_too_small) {
-    update_transport();
-    test_object1_t* obj = begin_write_master_to_slave();
-    obj->test = 7;
-    expect(signal_data_written);
-    end_write_master_to_slave();
-    expect(router_send_frame);
-    update_transport();
-    sent_data[sent_data_size - 2] = 0;
-    transport_recv_frame(0, sent_data, sent_data_size - 1);
-    test_object1_t* obj2 = read_master_to_slave();
-    assert_that(obj2, is_equal_to(NULL));
-}
-
-Ensure(Transport, ignores_object_with_size_too_big) {
-    update_transport();
-    test_object1_t* obj = begin_write_master_to_slave();
-    obj->test = 7;
-    expect(signal_data_written);
-    end_write_master_to_slave();
-    expect(router_send_frame);
-    update_transport();
-    sent_data[sent_data_size + 21] = 0;
-    transport_recv_frame(0, sent_data, sent_data_size + 22);
-    test_object1_t* obj2 = read_master_to_slave();
-    assert_that(obj2, is_equal_to(NULL));
-}
diff --git a/quantum/serial_link/tests/transport_tests.cpp b/quantum/serial_link/tests/transport_tests.cpp
new file mode 100644 (file)
index 0000000..21b7b16
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2016 Fred Sundvik
+
+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.
+*/
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+using testing::_;
+using testing::ElementsAreArray;
+using testing::Args;
+
+extern "C" {
+#include "serial_link/protocol/transport.h"
+}
+
+struct test_object1 {
+    uint32_t test;
+};
+
+struct test_object2 {
+    uint32_t test1;
+    uint32_t test2;
+};
+
+MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1);
+MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1);
+SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1);
+
+static remote_object_t* test_remote_objects[] = {
+    REMOTE_OBJECT(master_to_slave),
+    REMOTE_OBJECT(master_to_single_slave),
+    REMOTE_OBJECT(slave_to_master),
+};
+
+class Transport : public testing::Test {
+public:
+    Transport() {
+        Instance = this;
+        add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*));
+    }
+
+    ~Transport() {
+        Instance = nullptr;
+        reinitialize_serial_link_transport();
+    }
+
+    MOCK_METHOD0(signal_data_written, void ());
+    MOCK_METHOD1(router_send_frame, void (uint8_t destination));
+
+    void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
+        router_send_frame(destination);
+        std::copy(data, data + size, std::back_inserter(sent_data));
+    }
+
+    static Transport* Instance;
+
+    std::vector<uint8_t> sent_data;
+};
+
+Transport* Transport::Instance = nullptr;
+
+extern "C" {
+void signal_data_written(void) {
+    Transport::Instance->signal_data_written();
+}
+
+void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) {
+    Transport::Instance->router_send_frame(destination, data, size);
+}
+}
+
+TEST_F(Transport, write_to_local_signals_an_event) {
+    begin_write_master_to_slave();
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_slave();
+    begin_write_slave_to_master();
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_slave_to_master();
+    begin_write_master_to_single_slave(1);
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_single_slave(1);
+}
+
+TEST_F(Transport, writes_from_master_to_all_slaves) {
+    update_transport();
+    test_object1* obj = begin_write_master_to_slave();
+    obj->test = 5;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_slave();
+    EXPECT_CALL(*this, router_send_frame(0xFF));
+    update_transport();
+    transport_recv_frame(0, sent_data.data(), sent_data.size());
+    test_object1* obj2 = read_master_to_slave();
+    EXPECT_NE(obj2, nullptr);
+    EXPECT_EQ(obj2->test, 5);
+}
+
+TEST_F(Transport, writes_from_slave_to_master) {
+    update_transport();
+    test_object1* obj = begin_write_slave_to_master();
+    obj->test = 7;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_slave_to_master();
+    EXPECT_CALL(*this, router_send_frame(0));
+    update_transport();
+    transport_recv_frame(3, sent_data.data(), sent_data.size());
+    test_object1* obj2 = read_slave_to_master(2);
+    EXPECT_EQ(read_slave_to_master(0), nullptr);
+    EXPECT_NE(obj2, nullptr);
+    EXPECT_EQ(obj2->test, 7);
+}
+
+TEST_F(Transport, writes_from_master_to_single_slave) {
+    update_transport();
+    test_object1* obj = begin_write_master_to_single_slave(3);
+    obj->test = 7;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_single_slave(3);
+    EXPECT_CALL(*this, router_send_frame(4));
+    update_transport();
+    transport_recv_frame(0, sent_data.data(), sent_data.size());
+    test_object1* obj2 = read_master_to_single_slave();
+    EXPECT_NE(obj2, nullptr);
+    EXPECT_EQ(obj2->test, 7);
+}
+
+TEST_F(Transport, ignores_object_with_invalid_id) {
+    update_transport();
+    test_object1* obj = begin_write_master_to_single_slave(3);
+    obj->test = 7;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_single_slave(3);
+    EXPECT_CALL(*this, router_send_frame(4));
+    update_transport();
+    sent_data[sent_data.size() - 1] = 44;
+    transport_recv_frame(0, sent_data.data(), sent_data.size());
+    test_object1* obj2 = read_master_to_single_slave();
+    EXPECT_EQ(obj2, nullptr);
+}
+
+TEST_F(Transport, ignores_object_with_size_too_small) {
+    update_transport();
+    test_object1* obj = begin_write_master_to_slave();
+    obj->test = 7;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_slave();
+    EXPECT_CALL(*this, router_send_frame(_));
+    update_transport();
+    sent_data[sent_data.size() - 2] = 0;
+    transport_recv_frame(0, sent_data.data(), sent_data.size() - 1);
+    test_object1* obj2 = read_master_to_slave();
+    EXPECT_EQ(obj2, nullptr);
+}
+
+TEST_F(Transport, ignores_object_with_size_too_big) {
+    update_transport();
+    test_object1* obj = begin_write_master_to_slave();
+    obj->test = 7;
+    EXPECT_CALL(*this, signal_data_written());
+    end_write_master_to_slave();
+    EXPECT_CALL(*this, router_send_frame(_));
+    update_transport();
+    sent_data.resize(sent_data.size() + 22);
+    sent_data[sent_data.size() - 1] = 0;
+    transport_recv_frame(0, sent_data.data(), sent_data.size());
+    test_object1* obj2 = read_master_to_slave();
+    EXPECT_EQ(obj2, nullptr);
+}
diff --git a/quantum/serial_link/tests/triple_buffered_object_tests.c b/quantum/serial_link/tests/triple_buffered_object_tests.c
deleted file mode 100644 (file)
index 6f7c82b..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 Fred Sundvik
-
-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.
-*/
-
-#include <cgreen/cgreen.h>
-#include "serial_link/protocol/triple_buffered_object.c"
-
-typedef struct {
-    uint8_t state;
-    uint32_t buffer[3];
-}test_object_t;
-
-test_object_t test_object;
-
-Describe(TripleBufferedObject);
-BeforeEach(TripleBufferedObject) {
-    triple_buffer_init((triple_buffer_object_t*)&test_object);
-}
-AfterEach(TripleBufferedObject) {}
-
-
-Ensure(TripleBufferedObject, writes_and_reads_object) {
-    *triple_buffer_begin_write(&test_object) = 0x3456ABCC;
-    triple_buffer_end_write(&test_object);
-    assert_that(*triple_buffer_read(&test_object), is_equal_to(0x3456ABCC));
-}
-
-Ensure(TripleBufferedObject, does_not_read_empty) {
-    assert_that(triple_buffer_read(&test_object), is_equal_to(NULL));
-}
-
-Ensure(TripleBufferedObject, writes_twice_and_reads_object) {
-    *triple_buffer_begin_write(&test_object) = 0x3456ABCC;
-    triple_buffer_end_write(&test_object);
-    *triple_buffer_begin_write(&test_object) = 0x44778899;
-    triple_buffer_end_write(&test_object);
-    assert_that(*triple_buffer_read(&test_object), is_equal_to(0x44778899));
-}
-
-Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) {
-    *triple_buffer_begin_write(&test_object) = 1;
-    triple_buffer_end_write(&test_object);
-    uint32_t* read = triple_buffer_read(&test_object);
-    *triple_buffer_begin_write(&test_object) = 2;
-    triple_buffer_end_write(&test_object);
-    assert_that(*read, is_equal_to(1));
-    assert_that(*triple_buffer_read(&test_object), is_equal_to(2));
-    assert_that(triple_buffer_read(&test_object), is_equal_to(NULL));
-}
-
-Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) {
-    *triple_buffer_begin_write(&test_object) = 1;
-    triple_buffer_end_write(&test_object);
-    uint32_t* read = triple_buffer_read(&test_object);
-    *triple_buffer_begin_write(&test_object) = 2;
-    triple_buffer_end_write(&test_object);
-    *triple_buffer_begin_write(&test_object) = 3;
-    triple_buffer_end_write(&test_object);
-    assert_that(*read, is_equal_to(1));
-    assert_that(*triple_buffer_read(&test_object), is_equal_to(3));
-    assert_that(triple_buffer_read(&test_object), is_equal_to(NULL));
-}
diff --git a/quantum/serial_link/tests/triple_buffered_object_tests.cpp b/quantum/serial_link/tests/triple_buffered_object_tests.cpp
new file mode 100644 (file)
index 0000000..7724bbe
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2016 Fred Sundvik
+
+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.
+*/
+
+#include "gtest/gtest.h"
+extern "C" {
+#include "serial_link/protocol/triple_buffered_object.h"
+}
+
+struct test_object{
+    uint8_t state;
+    uint32_t buffer[3];
+};
+
+test_object test_object;
+
+class TripleBufferedObject : public testing::Test {
+public:
+    TripleBufferedObject() {
+        triple_buffer_init((triple_buffer_object_t*)&test_object);
+    }
+};
+
+TEST_F(TripleBufferedObject, writes_and_reads_object) {
+    *triple_buffer_begin_write(&test_object) = 0x3456ABCC;
+    triple_buffer_end_write(&test_object);
+    EXPECT_EQ(*triple_buffer_read(&test_object), 0x3456ABCC);
+}
+
+TEST_F(TripleBufferedObject, does_not_read_empty) {
+    EXPECT_EQ(triple_buffer_read(&test_object), nullptr);
+}
+
+TEST_F(TripleBufferedObject, writes_twice_and_reads_object) {
+    *triple_buffer_begin_write(&test_object) = 0x3456ABCC;
+    triple_buffer_end_write(&test_object);
+    *triple_buffer_begin_write(&test_object) = 0x44778899;
+    triple_buffer_end_write(&test_object);
+    EXPECT_EQ(*triple_buffer_read(&test_object), 0x44778899);
+}
+
+TEST_F(TripleBufferedObject, performs_another_write_in_the_middle_of_read) {
+    *triple_buffer_begin_write(&test_object) = 1;
+    triple_buffer_end_write(&test_object);
+    uint32_t* read = triple_buffer_read(&test_object);
+    *triple_buffer_begin_write(&test_object) = 2;
+    triple_buffer_end_write(&test_object);
+    EXPECT_EQ(*read, 1);
+    EXPECT_EQ(*triple_buffer_read(&test_object), 2);
+    EXPECT_EQ(triple_buffer_read(&test_object), nullptr);
+}
+
+TEST_F(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) {
+    *triple_buffer_begin_write(&test_object) = 1;
+    triple_buffer_end_write(&test_object);
+    uint32_t* read = triple_buffer_read(&test_object);
+    *triple_buffer_begin_write(&test_object) = 2;
+    triple_buffer_end_write(&test_object);
+    *triple_buffer_begin_write(&test_object) = 3;
+    triple_buffer_end_write(&test_object);
+    EXPECT_EQ(*read, 1);
+    EXPECT_EQ(*triple_buffer_read(&test_object), 3);
+    EXPECT_EQ(triple_buffer_read(&test_object), nullptr);
+}
index 3f6d133c9b39a73c68f72aa9783d43a7e17a8388..4e2a6f00fd8ea2e3d2f25fa611a2cba9d6d98783 100644 (file)
@@ -1,75 +1,3 @@
-
-
-# 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=512
-
-
-# Build Options
-#   change yes to no to disable
-#
-BOOTMAGIC_ENABLE ?= no      # 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
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE ?= no            # USB Nkey Rollover
-BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE ?= no            # MIDI controls
-UNICODE_ENABLE ?= no         # Unicode
-BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE ?= no           # Audio output on port C6
-
-ifndef QUANTUM_DIR
+ifndef MAKEFILE_INCLUDED
        include ../../Makefile
-endif
-
-
+endif
\ No newline at end of file
index b2fb4dd98d2891932f2b15cdda88fc0b99bb78aa..b16f4cd76836b0da7be976173eebee329bb4fe35 100644 (file)
@@ -3,7 +3,7 @@
 
 ## Quantum MK Firmware
 
-For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
+For the full Quantum feature list, see [the parent readme](/).
 
 ## Building
 
@@ -13,16 +13,16 @@ Depending on which keymap you would like to use, you will have to compile slight
 
 ### Default
 
-To build with the default keymap, simply run `make`.
+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 a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
 
-To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
+To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
 
 ```
-$ make keymap=[default|jack|<name>]
+$ make [default|jack|<name>]
 ```
 
-Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
\ No newline at end of file
+Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
diff --git a/quantum/template/rules.mk b/quantum/template/rules.mk
new file mode 100644 (file)
index 0000000..5589814
--- /dev/null
@@ -0,0 +1,67 @@
+# 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=512
+
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= no      # 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
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= no            # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= no       # Enable keyboard backlight functionality on B7 by default
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
index db0bf878378c75ba76065cb7c288d16d1176a4a8..70725bf81ab949d2cc0270018f0d6dbee9f8e499 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -69,11 +69,12 @@ Here are the steps
 ### Windows (Vista and later)
 1. If you have ever installed WinAVR, uninstall it.
 2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**.
-3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
-4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
-5. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
-6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
-7. Future build commands should be run from the MHV AVR Shell, which sets up an environment compatible with colorful build output. The standard Command Prompt will also work, but add `COLOR=false` to the end of all make commands when using it.
+3. If you are going to flash Infinity based keyboards you will need to install dfu-util, refer to the instructions by [Input Club](https://github.com/kiibohd/controller/wiki/Loading-DFU-Firmware).
+4. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location.
+5. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer.
+6. Double-click on the 1-setup-path-win batch script to run it. You'll need to accept a User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.
+7. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete!
+8. Future build commands should be run from the MHV AVR Shell, which sets up an environment compatible with colorful build output. The standard Command Prompt will also work, but add `COLOR=false` to the end of all make commands when using it.
 
 ### Mac
 If you're using [homebrew,](http://brew.sh/) you can use the following commands:
@@ -90,6 +91,10 @@ You can also try these instructions:
 2. Install the Command Line Tools from `Xcode->Preferences->Downloads`.
 3. Install [DFU-Programmer][dfu-prog].
 
+If you are going to flash Infinity based keyboards you will also need dfu-util
+    
+    brew install dfu-util
+
 ### Linux
 
 To ensure you are always up to date, you can just run `sudo utils/install_dependencies.sh`. That should always install all the dependencies needed. 
@@ -157,43 +162,103 @@ In every keymap folder, the following files are recommended:
 
 ## The `make` command
 
-The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards/<keyboard>/`), or your keymap folder (`/keyboards/<keyboard>/keymaps/<keymap>/`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)).
+The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys).
+
+**NOTE:** To abort a make command press `Ctrl-c`
+
+The following instruction refers to these folders.
+
+* The `root` (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc.
+* The `keyboard` folder is any keyboard project's folder, like `/keyboards/planck`.
+* The `keymap` folder is any keymap's folder, like `/keyboards/planck/keymaps/default`.
+* The `subproject` folder is the subproject folder of a keyboard, like `/keyboards/ergodox/ez`
+
+### Simple instructions for building and uploading a keyboard
+
+**Most keyboards have more specific instructions in the keyboard specific readme.md file, so please check that first**
+
+If the `keymap` folder contains a file name `Makefile`
+
+1. Change the directory to the `keymap` folder 
+2. Run `make <subproject>-<programmer>`
+
+Otherwise, if there's no `Makefile` in the `keymap` folder
+
+1. Enter the `keyboard` folder
+2. Run `make <subproject>-<keymap>-<programmer>`
 
-By default, this will generate a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests.
+In the above commands, replace:
 
-Below are some definitions that will be useful:
+* `<keymap>` with the name of your keymap
+* `<subproject>` with the name of the subproject (revision or sub-model of your keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`.
+  * If the keyboard doesn't have a subproject, or if you are happy with the default (defined in `rules.mk` file of the `keyboard` folder), you can leave it out. But remember to also remove the dash (`-`) from the command.
+* `<programmer>` The programmer to use. Most keyboards use `dfu`, but some use `teensy`. Infinity keyboards use `dfu-util`. Check the readme file in the keyboard folder to find out which programmer to use.
+  * If you  don't add `-<programmer` to the command line, the firmware will be still be compiled into a hex file, but the upload will be skipped.
 
-* The "root" (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc.
-* The "keyboard" folder is any keyboard project's folder, like `/keyboards/planck`.
-* The "keymap" folder is any keymap's folder, like `/keyboards/planck/keymaps/default`.
+**NOTE:** Some operating systems will refuse to program unless you run the make command as root for example `sudo make dfu`
 
-Below is a list of the useful `make` commands in QMK:
+### More detailed make instruction
 
-* `make` - builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder
-  * `make keyboard=<keyboard>` - specifies the keyboard (only to be used in root)
-  * `make keymap=<keymap>` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder)
-* `make clean` - cleans the `.build` folder, ensuring that everything is re-built
-* `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press `KC_RESET`). This does not work for Teensy-based keyboards like the ErgoDox EZ.
-  * `keyboard=` and `keymap=` are compatible with this
-* `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root)
-* `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root)
-* `make all-keymaps [keyboard=<keyboard>]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `<keyboard>`
-* `make all-keyboards-*`, `make all-keyboards-default-*` and `make all-keymaps-* [keyboard=<keyboard>]` - like the normal "make-all-*" commands, but the last string aftter the `-` (for example clean) is passed to the keyboard make command.
-Other, less useful functionality:
+The full syntax of the `make` command is the following, but parts of the command can be left out if you run it from other directories than the `root` (as you might already have noticed by reading the simple instructions).
+
+`<keyboard>-<subproject>-<keymap>-<target>`, where:
+
+* `<keyboard>` is the name of the keyboard, for example `planck`
+  * Use `allkb` to compile all keyboards
+* `<subproject>` is the name of the subproject (revision or sub-model of the keyboard). For example, for Ergodox it can be `ez` or `infinity`, and for Planck `rev3` or `rev4`.
+  * If the keyboard doesn't have any subprojects, it can be left out
+  * To compile the default subproject, you can leave it out, or specify `defaultsp`
+  * Use `allsp` to compile all subprojects
+* `<keymap>` is the name of the keymap, for example `algernon`
+  * Use `allkm` to compile all keymaps
+* `<target>` will be explained in more detail below.
+
+**Note:** When you leave some parts of the command out, you should also remove the dash (`-`).
+
+As mentioned above, there are some shortcuts, when you are in a:
+
+* `keyboard` folder, the command will automatically fill the `<keyboard>` part. So you only need to type `<subproject>-<keymap>-<target>`
+* `subproject` folder, it will fill in both `<keyboard>` and `<subproject>`
+* `keymap` folder, then `<keyboard>` and `<keymap>` will be filled in. If you need to specify the `<subproject>` use the following syntax `<subproject>-<target>`
+  * Note in order to support this shortcut, the keymap needs its own Makefile (see the example [here](/doc/keymap_makefile_example.mk))
+* `keymap` folder of a `subproject`, then everything except the `<target>` will be filled in
+
+The `<target>` means the following
+* If no target is given, then it's the same as `all` below
+* `all` compiles the keyboard and generates a `<keyboard>_<keymap>.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests.
+* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for Infinity keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme. **Note** that some operating systems needs root access for these commands to work, so in that case you need to run for example `sudo make dfu`.
+* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
+
+Some other targets are supported but, but not important enough to be documented here. Check the source code of the make files for more information.
+
+You can also add extra options at the end of the make command line, after the target
 
 * `make COLOR=false` - turns off color output
 * `make SILENT=true` - turns off output besides errors/warnings
-* `make VERBOSE=true` - outputs all of the avr-gcc stuff (not interesting)
+* `make VERBOSE=true` - outputs all of the gcc stuff (not interesting, unless you need to debug)
+
+The make command itself also has some additional options, type `make --help` for more information. The most useful is probably `-jx`, which specifies that you want to compile using more than one CPU, the `x` represents the number of CPUs that you want to use. Setting that can greatly reduce the compile times, especially if you are compiling many keyboards/keymaps. I usually set it to one less than the number of CPUs that I have, so that I have some left for doing other things while it's compiling. Note that not all operating systems and make versions supports that option.
+
+Here are some examples commands
+
+* `make allkb-allsp-allkm` builds everything (all keyboards, all subprojects, all keymaps). Running just `make` from the `root` will also run this.
+* `make` from within a `keyboard` directory, is the same as `make keyboard-allsp-allkm`, which compiles all subprojects and keymaps of the keyboard. **NOTE** that this behaviour has changed. Previously it compiled just the default keymap.
+* `make ergodox-infinity-algernon-clean` will clean the build output of the Ergodox Infinity keyboard. This example uses the full syntax and can be run from any folder with a `Makefile`
+* `make dfu COLOR=false` from within a keymap folder, builds and uploads the keymap, but without color output.
 
 ## The `Makefile`
 
-There are 3 different `make` and `Makefile` locations:
+There are 5 different `make` and `Makefile` locations:
 
 * root (`/`)
 * keyboard (`/keyboards/<keyboard>/`)
 * keymap (`/keyboards/<keyboard>/keymaps/<keymap>/`)
+* subproject (`/keyboards/<keyboard>/<subproject>`)
+* subproject keymap (`/keyboards/<keyboard>/<subproject>/keymaps/<keymap>`)
 
-The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **It is required if you want to run `make` in the keymap folder.**
+The root contains the code used to automatically figure out which keymap or keymaps to compile based on your current directory and commandline arguments. It's considered stable, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. **The file is required if you want to run `make` in the keymap folder.**
+
+For keyboards and subprojects, the make files are split in two parts `Makefile` and `rules.mk`. All settings can be found in the `rules.mk` file, while the `Makefile` is just there for support and including the root `Makefile`. Keymaps contain just one `Makefile` for simplicity.
 
 ### Makefile options
 
@@ -1077,3 +1142,54 @@ Here is where you can (optionally) define your `KEYMAP` function to remap your m
 ```
 
 Each of the `kxx` variables needs to be unique, and usually follows the format `k<row><col>`. You can place `KC_NO` where your dead keys are in your matrix.
+
+# Unit Testing
+
+If you are new to unit testing, then you can find many good resources on internet. However most of it is scattered around in small pieces here and there, and there's also many different opinions, so I won't give any recommendations. 
+
+Instead I recommend these two books, explaining two different styles of Unit Testing in detail.
+
+* "Test Driven Development: By Example: Kent Beck"
+* "Growing Object-Oriented Software, Guided By Tests: Steve Freeman, Nat Pryce"
+
+If you prefer videos there are Uncle Bob's [Clean Coders Videos](https://cleancoders.com/), which unfortunately cost quite a bit, especially if you want to watch many of them. But James Shore has a free [Let's Play](http://www.jamesshore.com/Blog/Lets-Play) video series. 
+
+## Google Test and Google Mock
+It's possible to Unit Test your code using [Google Test](https://github.com/google/googletest). The Google Test framework also includes another component for writing testing mocks and stubs, called "Google Mock". For information how to write the actual tests, please refer to the documentation on that site.
+
+## Use of C++
+
+Note that Google Test and therefore any test has to be written in C++, even if the rest of the QMK codebases is written in C. This should hopefully not be a problem even if you don't know any C++, since there's quite clear documentation and examples of the required C++ features, and you can write the rest of the test code almost as you would write normal C. Note that some compiler errors which you might get can look quite scary, but just read carefully what it says, and you should be ok.
+
+One thing to remember, is that you have to append `extern "C"` around all of your C file includes. 
+
+## Adding tests for new or existing features
+
+If you want to unit test some feature, then take a look at the existing serial_link tests, in the `quantum/serial_link/tests folder`, and follow the steps below to create a similar structure.
+
+1. If it doesn't already exist, add a test subfolder to the folder containing the feature.
+2. Create a `testlist.mk` and a `rules.mk` file in that folder.
+3. Include those files from the root folder `testlist.mk`and `build_test.mk` respectively.
+4. Add a new name for your testgroup to the `testlist.mk` file. Each group defined there will be a separate executable. And that's how you can support mocking out different parts. Note that it's worth adding some common prefix, just like it's done for the serial_link tests. The reason for that is that the make command allows substring filtering, so this way you can easily run a subset of the tests.
+5. Define the source files and required options in the `rules.mk` file.
+   * `_SRC` for source files
+   * `_DEFS` for additional defines
+   * `_INC` for additional include folders
+6. Write the tests in a new cpp file inside the test folder you created. That file has to be one of the files included from the `rules.mk` file.
+
+Note how there's several different tests, each mocking out a separate part. Also note that each of them only compiles the very minimum that's needed for the tests. It's recommend that you try to do the same. For a relevant video check out [Matt Hargett "Advanced Unit Testing in C & C++](https://www.youtube.com/watch?v=Wmy6g-aVgZI)
+
+## Running the tests
+
+To run all the tests in the codebase, type `make test`. You can also run test matching a substring by typing `make test-matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
+
+## Debugging the tests
+
+If there are problems with the tests, you can find the executable in the `./build/test` folder. You should be able to run those with GDB or a similar debugger.
+
+## Full Integration tests
+
+It's not yet possible to do a full integration test, where you would compile the whole firmware and define a keymap that you are going to test. However there are plans for doing that, because writing tests that way would probably be easier, at least for people that are not used to unit testing. 
+
+In that model you would emulate the input, and expect a certain output from the emulated keyboard.
+
diff --git a/testlist.mk b/testlist.mk
new file mode 100644 (file)
index 0000000..1884d6d
--- /dev/null
@@ -0,0 +1,13 @@
+include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk
+
+define VALIDATE_TEST_LIST
+    ifneq ($1,)
+        ifeq ($$(findstring -,$1),-)
+            $$(error Test names can't contain '-', but '$1' does)
+        else
+            $$(eval $$(call VALIDATE_TEST_LIST,$$(firstword $2),$$(wordlist 2,9999,$2)))
+        endif
+    endif
+endef
+
+$(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST))))
\ No newline at end of file
index cb67ac6f25ba311815b8c005c9388c6903d583d8..062a712bd106d5c5b3d4e601a59c938a3aee6e79 100644 (file)
@@ -89,9 +89,9 @@ CHIBISRC = $(STARTUPSRC) \
           $(STARTUPASM) \
           $(PORTASM) \
           $(OSALASM)         
-          
-SRC += $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC))
 
+CHIBISRC := $(patsubst $(TOP_DIR)/%,%,$(CHIBISRC))
+          
 EXTRAINCDIRS += $(CHIBIOS)/os/license \
          $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
          $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
@@ -143,14 +143,6 @@ MCUFLAGS = -mcpu=$(MCU)
 
 DEBUG = gdb
 
-# Define ASM defines here
-# bootloader definitions may be used in the startup .s file
-ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
-    OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
-else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
-    OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
-endif
-
 # List any extra directories to look for libraries here.
 EXTRALIBDIRS = $(RULESPATH)/ld
 
index 429c57143535b29d36c354bd2ce8c50466610e66..f826a7b540b87da494a7d18fa74629523b813ecb 100644 (file)
@@ -5,7 +5,7 @@ else ifeq ($(PLATFORM),CHIBIOS)
        PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios
 endif
 
-SRC += $(COMMON_DIR)/host.c \
+TMK_COMMON_SRC +=      $(COMMON_DIR)/host.c \
        $(COMMON_DIR)/keyboard.c \
        $(COMMON_DIR)/action.c \
        $(COMMON_DIR)/action_tapping.c \
@@ -21,101 +21,89 @@ SRC +=     $(COMMON_DIR)/host.c \
        $(PLATFORM_COMMON_DIR)/bootloader.c \
 
 ifeq ($(PLATFORM),AVR)
-       SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
+       TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
 endif 
 
 ifeq ($(PLATFORM),CHIBIOS)
-       SRC += $(PLATFORM_COMMON_DIR)/printf.c
-       SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
+       TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
+       TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
 endif
 
 
 
 # Option modules
 ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
-    OPT_DEFS += -DBOOTMAGIC_ENABLE
-    SRC += $(COMMON_DIR)/bootmagic.c
+    TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE
+    TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c
 else
-    OPT_DEFS += -DMAGIC_ENABLE
-    SRC += $(COMMON_DIR)/magic.c
+    TMK_COMMON_DEFS += -DMAGIC_ENABLE
+    TMK_COMMON_SRC += $(COMMON_DIR)/magic.c
 endif
 
 ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
-    SRC += $(COMMON_DIR)/mousekey.c
-    OPT_DEFS += -DMOUSEKEY_ENABLE
-    OPT_DEFS += -DMOUSE_ENABLE
+    TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c
+    TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE
+    TMK_COMMON_DEFS += -DMOUSE_ENABLE
 endif
 
 ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
-    OPT_DEFS += -DEXTRAKEY_ENABLE
+    TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
 endif
 
 ifeq ($(strip $(CONSOLE_ENABLE)), yes)
-    OPT_DEFS += -DCONSOLE_ENABLE
+    TMK_COMMON_DEFS += -DCONSOLE_ENABLE
 else
-    OPT_DEFS += -DNO_PRINT
-    OPT_DEFS += -DNO_DEBUG
+    TMK_COMMON_DEFS += -DNO_PRINT
+    TMK_COMMON_DEFS += -DNO_DEBUG
 endif
 
 ifeq ($(strip $(COMMAND_ENABLE)), yes)
-    SRC += $(COMMON_DIR)/command.c
-    OPT_DEFS += -DCOMMAND_ENABLE
+    TMK_COMMON_SRC += $(COMMON_DIR)/command.c
+    TMK_COMMON_DEFS += -DCOMMAND_ENABLE
 endif
 
 ifeq ($(strip $(NKRO_ENABLE)), yes)
-    OPT_DEFS += -DNKRO_ENABLE
+    TMK_COMMON_DEFS += -DNKRO_ENABLE
 endif
 
 ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
-    OPT_DEFS += -DUSB_6KRO_ENABLE
+    TMK_COMMON_DEFS += -DUSB_6KRO_ENABLE
 endif
 
 ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
-    SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
-    OPT_DEFS += -DSLEEP_LED_ENABLE
-    OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
+    TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
+    TMK_COMMON_DEFS += -DSLEEP_LED_ENABLE
+    TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
 endif
 
 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
-    SRC += $(COMMON_DIR)/backlight.c
-    OPT_DEFS += -DBACKLIGHT_ENABLE
+    TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c
+    TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
 endif
 
 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
-    OPT_DEFS += -DBLUETOOTH_ENABLE
+    TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
 endif
 
 ifeq ($(strip $(ONEHAND_ENABLE)), yes)
-    OPT_DEFS += -DONEHAND_ENABLE
+    TMK_COMMON_DEFS += -DONEHAND_ENABLE
 endif
 
 ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
-    OPT_DEFS += -DKEYMAP_SECTION_ENABLE
+    TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE
 
     ifeq ($(strip $(MCU)),atmega32u2)
-       EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
+       TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
     else ifeq ($(strip $(MCU)),atmega32u4)
-       EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
+       TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
     else
-       EXTRALDFLAGS = $(error no ldscript for keymap section)
+       TMK_COMMON_LDFLAGS = $(error no ldscript for keymap section)
     endif
 endif
 
-ifeq ($(MASTER),right) 
-       OPT_DEFS += -DMASTER_IS_ON_RIGHT
-else 
-       ifneq ($(MASTER),left)
-$(error MASTER does not have a valid value(left/right))
-       endif
-endif
-
-
-# Version string
-OPT_DEFS += -DVERSION=$(GIT_VERSION)
-
 # Bootloader address
 ifdef STM32_BOOTLOADER_ADDRESS
-    OPT_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
+    TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
 endif
 
 # Search Path
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 084c9fe1555fac3b5d44d8a12c7f72da1d37865c..476fc6fe3c59cce819c0bfbeebbb0ace19bcdb6e 100644 (file)
@@ -34,6 +34,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "command.h"
 #include "backlight.h"
 #include "quantum.h"
+#include "version.h"
 
 #ifdef MOUSEKEY_ENABLE
 #include "mousekey.h"
@@ -180,7 +181,7 @@ static void print_version(void)
     print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") "
           "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") "
           "VER: " STR(DEVICE_VER) "\n");
-    print("BUILD: " STR(VERSION) " (" __TIME__ " " __DATE__ ")\n");
+    print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n");
 
     /* build options */
     print("OPTIONS:"
diff --git a/tmk_core/native.mk b/tmk_core/native.mk
new file mode 100644 (file)
index 0000000..50232ee
--- /dev/null
@@ -0,0 +1,24 @@
+CC = gcc
+OBJCOPY = 
+OBJDUMP = 
+SIZE = 
+AR = 
+NM = 
+HEX = 
+EEP = 
+BIN =
+
+
+COMPILEFLAGS += -funsigned-char
+COMPILEFLAGS += -funsigned-bitfields
+COMPILEFLAGS += -ffunction-sections
+COMPILEFLAGS += -fdata-sections
+COMPILEFLAGS += -fshort-enums
+
+CFLAGS += $(COMPILEFLAGS)
+CFLAGS += -fno-inline-small-functions
+CFLAGS += -fno-strict-aliasing
+
+CPPFLAGS += $(COMPILEFLAGS)
+CPPFLAGS += -fno-exceptions
+CPPFLAGS += -std=gnu++11
\ No newline at end of file
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.
+ */
index d2350f27c12c8f2619ba9ff3fd44bf3e9cd421bc..79fc7119a68584ccf694893295e9fad71ae8ce5b 100644 (file)
@@ -21,10 +21,23 @@ VPATH_SRC := $(VPATH)
 vpath %.c $(VPATH_SRC)
 vpath %.h $(VPATH_SRC)
 vpath %.cpp $(VPATH_SRC)
+vpath %.cc $(VPATH_SRC)
 vpath %.hpp $(VPATH_SRC)
 vpath %.S $(VPATH_SRC)
 VPATH :=
 
+# Convert all SRC to OBJ
+define OBJ_FROM_SRC
+$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$($1_SRC)))))
+endef
+$(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT))))
+
+# Define a list of all objects
+OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ))
+
+MASTER_OUTPUT := $(firstword $(OUTPUTS))
+
+
 
 # Output format. (can be srec, ihex, binary)
 FORMAT = ihex
@@ -34,50 +47,8 @@ FORMAT = ihex
 #     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
 OPT = s
 
-COLOR ?= true
-
-ifeq ($(COLOR),true)
-       NO_COLOR=\033[0m
-       OK_COLOR=\033[32;01m
-       ERROR_COLOR=\033[31;01m
-       WARN_COLOR=\033[33;01m
-       BLUE=\033[0;34m
-       BOLD=\033[1m
-endif
-
 AUTOGEN ?= false
 
-ifneq ($(shell awk --version 2>/dev/null),)
-       AWK=awk
-else
-       AWK=cat && test
-endif
-
-OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
-ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
-WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
-
-ifndef $(SILENT)
-       SILENT = false
-endif
-
-TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }'
-TAB_LOG_PLAIN = printf "$$LOG\n"
-AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
-AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
-PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1
-PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
-PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1
-PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
-PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
-BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
-
-# List any extra directories to look for include files here.
-#     Each directory must be seperated by a space.
-#     Use forward slashes for directory separators.
-#     For a directory that has spaces, enclose it in quotes.
-EXTRAINCDIRS += $(subst :, ,$(VPATH_SRC))
-
 
 # Compiler flag to set the C Standard level.
 #     c89   = "ANSI" C
@@ -88,17 +59,18 @@ CSTANDARD = -std=gnu99
 
 
 # Place -D or -U options here for C sources
-CDEFS += $(OPT_DEFS)
+#CDEFS +=
 
 
 # Place -D or -U options here for ASM sources
-ADEFS += $(OPT_DEFS)
+#ADEFS +=
 
 
 # Place -D or -U options here for C++ sources
 #CPPDEFS += -D__STDC_LIMIT_MACROS
 #CPPDEFS += -D__STDC_CONSTANT_MACROS
-CPPDEFS += $(OPT_DEFS)
+#CPPDEFS +=
+
 
 
 
@@ -126,11 +98,7 @@ CFLAGS += -Wstrict-prototypes
 #CFLAGS += -Wunreachable-code
 #CFLAGS += -Wsign-compare
 CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
-CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 CFLAGS += $(CSTANDARD)
-ifdef CONFIG_H
-    CFLAGS += -include $(CONFIG_H)
-endif
 
 
 #---------------- Compiler Options C++ ----------------
@@ -153,12 +121,7 @@ CPPFLAGS += -Wundef
 #CPPFLAGS += -Wunreachable-code
 #CPPFLAGS += -Wsign-compare
 CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
-CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 #CPPFLAGS += $(CSTANDARD)
-ifdef CONFIG_H
-    CPPFLAGS += -include $(CONFIG_H)
-endif
-
 
 #---------------- Assembler Options ----------------
 #  -Wa,...:   tell GCC to pass this to the assembler.
@@ -169,11 +132,8 @@ endif
 #             files -- see avr-libc docs [FIXME: not yet described there]
 #  -listing-cont-lines: Sets the maximum number of continuation lines of hex
 #       dump that will be displayed for a given single line of source input.
-ASFLAGS += $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
-ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
-ifdef CONFIG_H
-    ASFLAGS += -include $(CONFIG_H)
-endif
+ASFLAGS += $(ADEFS) 
+ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
 
 #---------------- Library Options ----------------
 # Minimalistic printf version
@@ -201,6 +161,7 @@ SCANF_LIB =
 
 
 MATH_LIB = -lm
+CREATE_MAP ?= yes
 
 
 #---------------- Linker Options ----------------
@@ -211,7 +172,10 @@ MATH_LIB = -lm
 # Comennt out "--relax" option to avoid a error such:
 #      (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12'
 #
-LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
+
+ifeq ($(CREATE_MAP),yes)
+       LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
+endif
 #LDFLAGS += -Wl,--relax
 LDFLAGS += $(EXTMEMOPTS)
 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
@@ -228,48 +192,6 @@ COPY = cp
 WINSHELL = cmd
 SECHO = $(SILENT) || echo
 
-# Define Messages
-# English
-MSG_ERRORS_NONE = Errors: none
-MSG_BEGIN = -------- begin --------
-MSG_END = --------  end  --------
-MSG_SIZE_BEFORE = Size before:
-MSG_SIZE_AFTER = Size after:
-MSG_COFF = Converting to AVR COFF:
-MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
-MSG_FLASH = Creating load file for Flash:
-MSG_EEPROM = Creating load file for EEPROM:
-MSG_BIN = Creating binary load file for Flash:
-MSG_EXTENDED_LISTING = Creating Extended Listing:
-MSG_SYMBOL_TABLE = Creating Symbol Table:
-MSG_LINKING = Linking:
-MSG_COMPILING = Compiling:
-MSG_COMPILING_CPP = Compiling:
-MSG_ASSEMBLING = Assembling:
-MSG_CLEANING = Cleaning project:
-MSG_CREATING_LIBRARY = Creating library:
-MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
-       Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\
-       git submodule sync --recursive\n\
-       git submodule update --init --recursive$(NO_COLOR)\n\n\
-       You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
-       or if you have modified the ChibiOS libraries yourself. \n\n
-
-
-# Define all object files.
-OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC))))
-# The files in the lib folder are shared between all keymaps, so generate that folder name by removing
-# the keymap from the name
-KBOBJDIR=$(subst _$(KEYMAP),,$(OBJDIR))
-# And fixup the object files to match
-LIBOBJ = $(foreach v,$(OBJ),$(if $(findstring /lib/,$v),$v))
-NONLIBOBJ := $(filter-out $(LIBOBJ),$(OBJ))
-LIBOBJ := $(subst _$(KEYMAP)/,/,$(LIBOBJ))
-OBJ := $(LIBOBJ) $(NONLIBOBJ)
-
-# Define all listing files.
-LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC))))
-
 
 # Compiler flags to generate dependency files.
 #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
@@ -285,14 +207,6 @@ ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS)
 
 MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
 
-# Default target.
-all: build sizeafter
-
-# Change the build target to build a HEX file or a library.
-build: elf hex
-#build: elf hex eep lss sym
-#build: lib
-
 
 elf: $(BUILD_DIR)/$(TARGET).elf
 hex: $(BUILD_DIR)/$(TARGET).hex
@@ -302,15 +216,6 @@ sym: $(BUILD_DIR)/$(TARGET).sym
 LIBNAME=lib$(TARGET).a
 lib: $(LIBNAME)
 
-check_submodule:
-       git submodule status --recursive | \
-       while IFS= read -r x; do \
-               case "$$x" in \
-                       \ *) ;; \
-                       *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
-               esac \
-       done
-
 # Display size of file.
 HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
 #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
@@ -364,91 +269,85 @@ gccversion :
        $(eval CMD=$(BIN) $< $@ || exit 0)
        @$(BUILD_CMD)
 
-# Create library from object files.
-.SECONDARY : $(BUILD_DIR)/$(TARGET).a
-.PRECIOUS : $(OBJ)
-%.a: $(OBJ)
-       @$(SILENT) || printf "$(MSG_CREATING_LIBRARY) $@" | $(AWK_CMD)
-       $(eval CMD=$(AR) $@ $(OBJ) )
-       @$(BUILD_CMD)
-
-BEGIN = gccversion check_submodule sizebefore
+BEGIN = gccversion sizebefore
 
 # Link: create ELF output file from object files.
 .SECONDARY : $(BUILD_DIR)/$(TARGET).elf
 .PRECIOUS : $(OBJ)
 # Note the obj.txt depeendency is there to force linking if a source file is deleted
-%.elf: $(OBJ) $(OBJDIR)/cflags.txt $(OBJDIR)/ldflags.txt $(OBJDIR)/obj.txt | $(BEGIN)
+%.elf: $(OBJ) $(MASTER_OUTPUT)/cflags.txt $(MASTER_OUTPUT)/ldflags.txt $(MASTER_OUTPUT)/obj.txt | $(BEGIN)
        @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD)
        $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS))
        @$(BUILD_CMD)
+       
 
 define GEN_OBJRULE
+$1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC))
+ifdef $1_CONFIG
+$1_CONFIG_FLAGS += -include $$($1_CONFIG)
+endif
+$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)
+$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)
+$1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS)
+
 # Compile: create object files from C source files.
 $1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
        @mkdir -p $$(@D)
        @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD)
-       $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
+       $$(eval CMD := $$(CC) -c $$($1_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
        @$$(BUILD_CMD)
 
 # Compile: create object files from C++ source files.
 $1/%.o : %.cpp $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN)
        @mkdir -p $$(@D)
        @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD)
-       $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
-       @$(BUILD_CMD)
+       $$(eval CMD=$$(CC) -c $$($1_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
+       @$$(BUILD_CMD)
+
+$1/%.o : %.cc $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN)
+       @mkdir -p $$(@D)
+       @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD)
+       $$(eval CMD=$$(CC) -c $$($1_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP))
+       @$$(BUILD_CMD)
 
 # Assemble: create object files from assembler source files.
 $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN)
        @mkdir -p $$(@D)
        @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD)
-       $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@)
+       $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@)
        @$$(BUILD_CMD)
 
 $1/force:
 
 $1/cflags.txt: $1/force
-       echo '$$(ALL_CFLAGS)' | cmp -s - $$@ || echo '$$(ALL_CFLAGS)' > $$@
+       echo '$$($1_CFLAGS)' | cmp -s - $$@ || echo '$$($1_CFLAGS)' > $$@
 
 $1/cppflags.txt: $1/force
-       echo '$$(ALL_CPPFLAGS)' | cmp -s - $$@ || echo '$$(ALL_CPPFLAGS)' > $$@
+       echo '$$($1_CPPFLAGS)' | cmp -s - $$@ || echo '$$($1_CPPFLAGS)' > $$@
 
 $1/asflags.txt: $1/force
-       echo '$$(ALL_ASFLAGS)' | cmp -s - $$@ || echo '$$(ALL_ASFLAGS)' > $$@
-
-$1/ldflags.txt: $1/force
-       echo '$$(LDFLAGS)' | cmp -s - $$@ || echo '$$(LDFLAGS)' > $$@
-
-$1/obj.txt: $1/force
-       echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@
+       echo '$$($1_ASFLAGS)' | cmp -s - $$@ || echo '$$($1_ASFLAGS)' > $$@
 
 $1/compiler.txt: $1/force
        $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@
 endef
 
+$(MASTER_OUTPUT)/obj.txt: $(MASTER_OUTPUT)/force
+       echo '$(OBJ)' | cmp -s - $$@ || echo '$(OBJ)' > $$@
+
+$(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force
+       echo '$(LDFLAGS)' | cmp -s - $$@ || echo '$(LDFLAGS)' > $$@
+
+
 # We have to use static rules for the .d files for some reason
 DEPS = $(patsubst %.o,%.d,$(OBJ))
 # Keep the .d files
 .PRECIOUS: $(DEPS)
 # Empty rule to force recompilation if the .d file is missing
 $(DEPS):
+       
 
-# Since the object files could be in two different folders, generate
-# separate rules for them, rather than having too generic rules
-$(eval $(call GEN_OBJRULE,$(OBJDIR)))
-$(eval $(call GEN_OBJRULE,$(KBOBJDIR)))
-
-# Compile: create assembler files from C source files.
-%.s : %.c | $(BEGIN)
-       @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD)
-       $(eval CMD=$(CC) -S $(ALL_CFLAGS) $< -o $@)
-       @$(BUILD_CMD)
-
-# Compile: create assembler files from C++ source files.
-%.s : %.cpp | $(BEGIN)
-       @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD)
-       $(eval CMD=$(CC) -S $(ALL_CPPFLAGS) $< -o $@)
-       @$(BUILD_CMD)
+$(foreach OUTPUT,$(OUTPUTS),$(eval $(call GEN_OBJRULE,$(OUTPUT))))
 
 # Create preprocessed source for use in sending a bug report.
 %.i : %.c | $(BEGIN)
@@ -456,71 +355,19 @@ $(eval $(call GEN_OBJRULE,$(KBOBJDIR)))
 
 # Target: clean project.
 clean:
-       $(REMOVE) -r $(OBJDIR) 2>/dev/null
-       $(REMOVE) -r $(KBOBJDIR) 2>/dev/null
+       $(foreach OUTPUT,$(OUTPUTS), $(REMOVE) -r $(OUTPUT) 2>/dev/null)
        $(REMOVE) $(BUILD_DIR)/$(TARGET).*
 
 show_path:
        @echo VPATH=$(VPATH)
        @echo SRC=$(SRC)
-
-SUBDIRS := $(filter-out %/util/ %/doc/ %/keymaps/ %/old_keymap_files/,$(dir $(wildcard $(TOP_DIR)/keyboards/**/*/Makefile)))
-SUBDIRS := $(SUBDIRS) $(dir $(wildcard $(TOP_DIR)/keyboards/*/.))
-SUBDIRS := $(sort $(SUBDIRS))
-# $(error $(SUBDIRS))
-all-keyboards-defaults-%:
-       @for x in $(SUBDIRS) ; do \
-               printf "Compiling with default: $$x" | $(AWK_CMD); \
-               LOG=$$($(MAKE) -C $$x $(subst all-keyboards-defaults-,,$@) VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
-       done
-
-all-keyboards-defaults: all-keyboards-defaults-all
-
-KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboards/%/=/keyboards/%)
-all-keyboards-all: $(addsuffix -all,$(KEYBOARDS))
-all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS))
-all-keyboards: all-keyboards-all
-
-define make_keyboard
-$(eval KEYBOARD=$(patsubst /keyboards/%,%,$1))
-$(eval SUBPROJECT=$(lastword $(subst /, ,$(KEYBOARD))))
-$(eval KEYBOARD=$(firstword $(subst /, ,$(KEYBOARD))))
-$(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/keymaps/*/.))))
-$(eval KEYMAPS+=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/*/.))))
-@for x in $(KEYMAPS) ; do \
-       printf "Compiling $(BOLD)$(KEYBOARD)/$(SUBPROJECT)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-118s", $$0; }'; \
-       LOG=$$($(MAKE) -C $(TOP_DIR)$1 $2 keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
-done
-endef
-
-define make_keyboard_helper
-# Just remove the -all and so on from the first argument and pass it forward
-$(call make_keyboard,$(subst -$2,,$1),$2)
-endef
-
-/keyboards/%-all:
-       $(call make_keyboard_helper,$@,all)
-/keyboards/%-clean:
-       $(call make_keyboard_helper,$@,clean)
-/keyboards/%:
-       $(call make_keyboard_helper,$@,all)
-
-all-keymaps-%:
-       $(eval MAKECONFIG=$(call get_target,all-keymaps,$@))
-       $(eval KEYMAPS=$(notdir $(patsubst %/.,%,$(wildcard $(TOP_DIR)/keyboards/$(KEYBOARD)/keymaps/*/.))))
-       @for x in $(KEYMAPS) ; do \
-               printf "Compiling $(BOLD)$(KEYBOARD)$(NO_COLOR) with $(BOLD)$$x$(NO_COLOR)" | $(AWK) '{ printf "%-118s", $$0; }'; \
-               LOG=$$($(MAKE) $(subst all-keymaps-,,$@) keyboard=$(KEYBOARD) keymap=$$x VERBOSE=$(VERBOSE) COLOR=$(COLOR) SILENT=true 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR_PLAIN); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING_PLAIN); else $(PRINT_OK); fi; \
-       done
-
-all-keymaps: all-keymaps-all
+       @echo OBJ=$(OBJ)
 
 # Create build directory
-$(shell mkdir $(BUILD_DIR) 2>/dev/null)
+$(shell mkdir -p $(BUILD_DIR) 2>/dev/null)
 
 # Create object files directory
-$(shell mkdir $(OBJDIR) 2>/dev/null)
-$(shell mkdir $(KBOBJDIR) 2>/dev/null)
+$(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null)))
 
 # Include the dependency files.
 -include $(patsubst %.o,%.d,$(OBJ))
@@ -528,8 +375,6 @@ $(shell mkdir $(KBOBJDIR) 2>/dev/null)
 
 # Listing of phony targets.
 .PHONY : all finish sizebefore sizeafter gccversion \
-build elf hex eep lss sym coff extcoff check_submodule \
+build elf hex eep lss sym coff extcoff \
 clean clean_list debug gdb-config show_path \
-program teensy dfu flip dfu-ee flip-ee dfu-start \
-all-keyboards-defaults all-keyboards all-keymaps \
-all-keyboards-defaults-% all-keyboards-% all-keymaps-%
+program teensy dfu flip dfu-ee flip-ee dfu-start 
\ No newline at end of file
index 24564a2ac541ac4bc97afc40d4210a308312c846..49ac86e07235d0d1b5ca18baabea28616c489eee 100644 (file)
@@ -20,7 +20,8 @@ if [[ -n "$(type -P pacman )" ]]; then
     arm-none-eabi-gcc \
     arm-none-eabi-binutils \
     arm-none-eabi-newlib \
-    git
+    git \
+    diffutils
 
 elif [[ -n "$(type -P apt-get)" ]]; then
   # Debian and derivatives
@@ -47,7 +48,8 @@ elif [[ -n "$(type -P apt-get)" ]]; then
     gcc-arm-none-eabi \
     binutils-arm-none-eabi \
     libnewlib-arm-none-eabi \
-    git
+    git \
+    diffutils
 
 elif [[ -n "$(type -P yum)" ]]; then
   # Fedora, CentOS or RHEL and derivatives
@@ -69,7 +71,8 @@ elif [[ -n "$(type -P yum)" ]]; then
     gcc-arm-none-eabi \
     binutils-arm-none-eabi \
     libnewlib-arm-none-eabi \
-    git
+    git \
+    diffutils
   # The listed eabi pacackes do unfortunately not exist for CentOS,
   # But at least in Fedora they do, so try to install them anyway
   # TODO: Build them from sources, if the installation fails
@@ -85,7 +88,8 @@ elif [[ -n "$(type -P zypper)" ]]; then
     patch \
     wget \
     dfu-programmer \
-    git
+    git \
+    diffutils
   # TODO: The avr and eabi tools are not available as default packages, so we need 
   # another way to install them
 
index c2a994ef022c14baf4be08b4e9a72f9c0f6a8b17..f432976d038cccf26d5679ed1abb903dbfccc27f 100644 (file)
@@ -7,7 +7,7 @@ rev=$(git rev-parse --short HEAD)
 git config --global user.name "Travis CI"
 git config --global user.email "jack.humb+travis.ci@gmail.com"
 
-make all-keymaps keyboard=ergodox/ez AUTOGEN=true
+make ergodox-ez AUTOGEN=true
 
 find . -name ".build" | xargs rm -rf
 cd ..
@@ -24,4 +24,4 @@ cp ../qmk_firmware/readme.md qmk_readme.md
 
 git add -A
 git commit -m "generated from qmk_firmware/$TRAVIS_BRANCH@${rev}" 
-git push
\ No newline at end of file
+git push