From d9e4dad0a828a8a904f44dda090a4d6d08fe2948 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 11 Jun 2016 13:31:31 -0400 Subject: Makefile redo & other features (#395) * .build containment implemented * no destructive variable setting - builds in either folder * make from 3 places * cleans before each build * make from root with keyboard=keyboard, keymap=keymap * make from keyboard/keyboard with keymap=keymap * make from keymaps/keymap * only implemented on planck * adds color diag to avr-gcc * makefiles for all plancks, clean-up * quick build-all makefile for plancks * reformatting of make output (colors) * color toggle, tmk path corrections * correct if statement for color * move config.h to main makefile, updates preonic, atomic * format update, all keyboards targets * makefile optional for build all target, alps and arrow_pad updated * alps updated * make planck default, trying out travis recipe for all-keyboards * all-keymaps target, different travis recipe * updates alps64 * updates keyboards to new format * updates clue* projects * all projects updated, specialise EZ .hex, let .hex through * updates travis * automatically find root, keyboard, keymap * silent echo, cleaned-up mass make output * updates all keyboards' .hex files except EZ * Rename Bantam44.c to bantam44.c * Rename Bantam44.h to bantam44.h * nananana * adds six key keyboard * does same to ez as rest * updates send_string example * brings ergodox_ez up to date * updates template/new project script * adds sixkeyboard * adds readme for sixkeyboard * adds sixkeyboard to travis * filenames, gitignore mess * define clock prescaler stuff manually * make quick, size test example * documentation and dfu-no-build --- keyboard/arrow_pad/Makefile | 80 +- keyboard/arrow_pad/keymaps/default.c | 163 --- keyboard/arrow_pad/keymaps/default/compiled.hex | 1490 +++++++++++++++++++++++ keyboard/arrow_pad/keymaps/default/keymap.c | 163 +++ keyboard/arrow_pad/keymaps/pad_21/Makefile | 17 + keyboard/arrow_pad/keymaps/pad_21/compiled.hex | 893 ++++++++++++++ keyboard/arrow_pad/keymaps/pad_21/makefile.mk | 17 - keyboard/arrow_pad/keymaps/pad_24/Makefile | 17 + keyboard/arrow_pad/keymaps/pad_24/compiled.hex | 935 ++++++++++++++ keyboard/arrow_pad/keymaps/pad_24/makefile.mk | 17 - 10 files changed, 3532 insertions(+), 260 deletions(-) delete mode 100644 keyboard/arrow_pad/keymaps/default.c create mode 100644 keyboard/arrow_pad/keymaps/default/compiled.hex create mode 100644 keyboard/arrow_pad/keymaps/default/keymap.c create mode 100644 keyboard/arrow_pad/keymaps/pad_21/Makefile create mode 100644 keyboard/arrow_pad/keymaps/pad_21/compiled.hex delete mode 100644 keyboard/arrow_pad/keymaps/pad_21/makefile.mk create mode 100644 keyboard/arrow_pad/keymaps/pad_24/Makefile create mode 100644 keyboard/arrow_pad/keymaps/pad_24/compiled.hex delete mode 100644 keyboard/arrow_pad/keymaps/pad_24/makefile.mk (limited to 'keyboard/arrow_pad') diff --git a/keyboard/arrow_pad/Makefile b/keyboard/arrow_pad/Makefile index 2c4ee0cae5..931eb3a16d 100644 --- a/keyboard/arrow_pad/Makefile +++ b/keyboard/arrow_pad/Makefile @@ -38,28 +38,6 @@ # To rebuild project do "make clean" then "make all". #---------------------------------------------------------------------------- -# Target file name (without extension). -TARGET = arrow_pad - - -# Directory common source filess exist -TOP_DIR = ../.. -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# # project specific files -SRC = arrow_pad.c - -ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) -else - SRC := keymaps/default.c $(SRC) -endif - -CONFIG_H = config.h - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -113,46 +91,22 @@ 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 +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 +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 - - -ifdef KEYMAP - -ifeq ("$(wildcard keymaps/$(KEYMAP).c)","") -ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") - include keymaps/$(KEYMAP)/makefile.mk -endif -endif - -else - -ifneq ("$(wildcard keymaps/default/makefile.mk)","") - include keymaps/default/makefile.mk -endif - -endif - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) -VPATH += $(TMK_DIR) - -include $(TOP_DIR)/quantum/quantum.mk - +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 + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboard/arrow_pad/keymaps/default.c b/keyboard/arrow_pad/keymaps/default.c deleted file mode 100644 index 5647f75afe..0000000000 --- a/keyboard/arrow_pad/keymaps/default.c +++ /dev/null @@ -1,163 +0,0 @@ -// This is the canonical layout file for the Quantum project. If you want to add another keyboard, -// this is the style you want to emulate. - -#include "arrow_pad.h" -#include "led.h" - -// This is the 21-key keypad to 2x11 element matrix mapping -#define KEYMAP( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, KM_EQU, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ - { KM___7, KM___8, KM___9, KM_EQU }, \ - { KM___4, KM___5, KM___6, KM_PLS }, \ - { KM___1, KM___2, KM___3, KC_NO }, \ - { KM___0, KC_NO, KM_DOT, KM_ENT } \ -} - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 - -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 - -#define SC_UNDO LCTL(KC_Z) -#define SC_REDO LCTL(KC_Y) -#define SC_CUT LCTL(KC_X) -#define SC_COPY LCTL(KC_C) -#define SC_PSTE LCTL(KC_V) -#define SC_SELA LCTL(KC_A) -#define SC_SAVE LCTL(KC_S) -#define SC_OPEN LCTL(KC_O) -#define SC_ACLS LALT(KC_F4) -#define SC_CCLS LCTL(KC_F4) - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[LAYER_BASE] = KEYMAP( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, KC_PEQL, \ - KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_P1, KC_P2, KC_P3, XXXXXXX, \ - KC_P0, KC_PCMM, KC_PDOT, KC_PENT ), - -[LAYER_EDIT] = KEYMAP( \ - KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ - KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ - KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ - KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), - -[LAYER_FUNCTION] = KEYMAP( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ - _______, _______, _______, _______, \ - _______, _______, _______, _______, \ - _______, _______, _______, XXXXXXX, \ - RESET, _______, _______, _______ ), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), - -}; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; - } - - return MACRO_NONE; -} - -void led_set_user(uint8_t usb_led) -{ - if (usb_led & (1<event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } + else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + + case MACRO_SHIFT_CONTROL: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } + else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; + + case MACRO_CONTROL_ALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } + else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); + } + break; + } + + return MACRO_NONE; +} + +void led_set_user(uint8_t usb_led) +{ + if (usb_led & (1<