diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-04-14 20:42:14 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-04-14 20:42:14 -0400 |
| commit | 63462bf8c12cea1c13ca1bd1f105fe53f556806e (patch) | |
| tree | b1636f2fa845a6f27277c0524b360e1bdea9ff06 /keyboard/planck | |
| parent | ddbe4307789b6087c3e6f146a5e02f1084f3cecc (diff) | |
| download | qmk_firmware-63462bf8c12cea1c13ca1bd1f105fe53f556806e.tar.gz qmk_firmware-63462bf8c12cea1c13ca1bd1f105fe53f556806e.zip | |
changing up the makefile a bit
Diffstat (limited to 'keyboard/planck')
| -rw-r--r-- | keyboard/planck/Makefile | 56 | ||||
| -rw-r--r-- | keyboard/planck/keymaps/default/keymap.c | 49 | ||||
| -rw-r--r-- | keyboard/planck/keymaps/default/makefile.mk | 1 |
3 files changed, 65 insertions, 41 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index ee1c60fed..dc6e46df2 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile | |||
| @@ -38,6 +38,27 @@ | |||
| 38 | # To rebuild project do "make clean" then "make all". | 38 | # To rebuild project do "make clean" then "make all". |
| 39 | #---------------------------------------------------------------------------- | 39 | #---------------------------------------------------------------------------- |
| 40 | 40 | ||
| 41 | # Build Options | ||
| 42 | # change to "no" to disable the options, or define them in the makefile.mk in | ||
| 43 | # the appropriate keymap folder that will get included automatically | ||
| 44 | # | ||
| 45 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | ||
| 46 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 47 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 48 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 49 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 50 | NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: | ||
| 51 | # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 52 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 53 | MIDI_ENABLE = no # MIDI controls | ||
| 54 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 55 | UNICODE_ENABLE = no # Unicode | ||
| 56 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 57 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
| 58 | |||
| 59 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 60 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 61 | |||
| 41 | # Target file name (without extension). | 62 | # Target file name (without extension). |
| 42 | TARGET = planck | 63 | TARGET = planck |
| 43 | 64 | ||
| @@ -62,17 +83,28 @@ ifneq ("$(wildcard keymaps/$(KEYMAP).c)","") | |||
| 62 | else | 83 | else |
| 63 | ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","") | 84 | ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","") |
| 64 | KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c | 85 | KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c |
| 86 | ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") | ||
| 87 | include keymaps/$(KEYMAP)/makefile.mk | ||
| 88 | endif | ||
| 65 | else | 89 | else |
| 66 | $(error Keymap file does not exist) | 90 | $(error Keymap file does not exist) |
| 91 | endif | ||
| 67 | endif | 92 | endif |
| 68 | endif | 93 | |
| 69 | else | 94 | else |
| 95 | |||
| 70 | ifneq ("$(wildcard keymaps/default.c)","") | 96 | ifneq ("$(wildcard keymaps/default.c)","") |
| 71 | KEYMAP_FILE = keymaps/default.c | 97 | KEYMAP_FILE = keymaps/default.c |
| 72 | else | 98 | else |
| 73 | KEYMAP_FILE = keymaps/default/keymap.c | 99 | KEYMAP_FILE = keymaps/default/keymap.c |
| 74 | endif | 100 | endif |
| 101 | |||
| 102 | ifneq ("$(wildcard keymaps/default/makefile.mk)","") | ||
| 103 | include keymaps/default/makefile.mk | ||
| 75 | endif | 104 | endif |
| 105 | |||
| 106 | endif | ||
| 107 | |||
| 76 | SRC := $(KEYMAP_FILE) $(SRC) | 108 | SRC := $(KEYMAP_FILE) $(SRC) |
| 77 | 109 | ||
| 78 | CONFIG_H = config.h | 110 | CONFIG_H = config.h |
| @@ -127,27 +159,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | |||
| 127 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | 159 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 |
| 128 | 160 | ||
| 129 | 161 | ||
| 130 | # Build Options | 162 | ifeq ($(BACKLIGHT_ENABLE), yes) |
| 131 | # comment out to disable the options. | ||
| 132 | # | ||
| 133 | BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) | ||
| 134 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 135 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 136 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 137 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 138 | # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 139 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 140 | # MIDI_ENABLE = yes # MIDI controls | ||
| 141 | AUDIO_ENABLE = yes # Audio output on port C6 | ||
| 142 | # UNICODE_ENABLE = yes # Unicode | ||
| 143 | # BLUETOOTH_ENABLE = ye # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 144 | # RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
| 145 | |||
| 146 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 147 | #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||
| 148 | |||
| 149 | |||
| 150 | ifdef BACKLIGHT_ENABLE | ||
| 151 | SRC += backlight.c | 163 | SRC += backlight.c |
| 152 | endif | 164 | endif |
| 153 | 165 | ||
diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c index e06567339..97ba5d285 100644 --- a/keyboard/planck/keymaps/default/keymap.c +++ b/keyboard/planck/keymaps/default/keymap.c | |||
| @@ -89,38 +89,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 89 | {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, M(M_LW), KC_SPC, KC_SPC, M(M_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | 89 | {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, M(M_LW), KC_SPC, KC_SPC, M(M_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} |
| 90 | }, | 90 | }, |
| 91 | 91 | ||
| 92 | /* Raise | 92 | /* Lower |
| 93 | * ,-----------------------------------------------------------------------------------. | 93 | * ,-----------------------------------------------------------------------------------. |
| 94 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | 94 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | |
| 95 | * |------+------+------+------+------+-------------+------+------+------+------+------| | 95 | * |------+------+------+------+------+-------------+------+------+------+------+------| |
| 96 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | 96 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | |
| 97 | * |------+------+------+------+------+------|------+------+------+------+------+------| | 97 | * |------+------+------+------+------+------|------+------+------+------+------+------| |
| 98 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | | 98 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | |
| 99 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 99 | * |------+------+------+------+------+------+------+------+------+------+------+------| |
| 100 | * | | | | | | | | Next | Vol- | Vol+ | Play | | 100 | * | | | | | | | | Next | Vol- | Vol+ | Play | |
| 101 | * `-----------------------------------------------------------------------------------' | 101 | * `-----------------------------------------------------------------------------------' |
| 102 | */ | 102 | */ |
| 103 | [_RS] = { | 103 | [_LW] = { |
| 104 | {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, | 104 | {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, |
| 105 | {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, | 105 | {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, |
| 106 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, | 106 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, |
| 107 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | 107 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} |
| 108 | }, | 108 | }, |
| 109 | 109 | ||
| 110 | /* Lower | 110 | /* Raise |
| 111 | * ,-----------------------------------------------------------------------------------. | 111 | * ,-----------------------------------------------------------------------------------. |
| 112 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | 112 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | |
| 113 | * |------+------+------+------+------+-------------+------+------+------+------+------| | 113 | * |------+------+------+------+------+-------------+------+------+------+------+------| |
| 114 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | 114 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | |
| 115 | * |------+------+------+------+------+------|------+------+------+------+------+------| | 115 | * |------+------+------+------+------+------|------+------+------+------+------+------| |
| 116 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | | 116 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | |
| 117 | * |------+------+------+------+------+------+------+------+------+------+------+------| | 117 | * |------+------+------+------+------+------+------+------+------+------+------+------| |
| 118 | * | | | | | | | | Next | Vol- | Vol+ | Play | | 118 | * | | | | | | | | Next | Vol- | Vol+ | Play | |
| 119 | * `-----------------------------------------------------------------------------------' | 119 | * `-----------------------------------------------------------------------------------' |
| 120 | */ | 120 | */ |
| 121 | [_LW] = { | 121 | [_RS] = { |
| 122 | {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, | 122 | {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, |
| 123 | {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, | 123 | {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, |
| 124 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, | 124 | {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, |
| 125 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} | 125 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} |
| 126 | }, | 126 | }, |
| @@ -148,17 +148,18 @@ const uint16_t PROGMEM fn_actions[] = { | |||
| 148 | 148 | ||
| 149 | }; | 149 | }; |
| 150 | 150 | ||
| 151 | #ifdef AUDIO_ENABLE | ||
| 151 | float tone_qw[][2] = { | 152 | float tone_qw[][2] = { |
| 152 | {440.0*pow(2.0,(67)/12.0), 400}, | 153 | {440.0*pow(2.0,(67)/12.0), 400}, |
| 153 | {440.0*pow(2.0,(60)/12.0), 400}, | 154 | {440.0*pow(2.0,(60)/12.0), 400}, |
| 154 | {0, 400}, | 155 | {0, 800}, |
| 155 | {440.0*pow(2.0,(67)/12.0), 1600} | 156 | {440.0*pow(2.0,(67)/12.0), 1600} |
| 156 | }; | 157 | }; |
| 157 | 158 | ||
| 158 | float tone_cm[][2] = { | 159 | float tone_cm[][2] = { |
| 159 | {440.0*pow(2.0,(67)/12.0), 400}, | 160 | {440.0*pow(2.0,(67)/12.0), 400}, |
| 160 | {440.0*pow(2.0,(60)/12.0), 400}, | 161 | {440.0*pow(2.0,(60)/12.0), 400}, |
| 161 | {0, 400}, | 162 | {0, 800}, |
| 162 | {440.0*pow(2.0,(67)/12.0), 1000}, | 163 | {440.0*pow(2.0,(67)/12.0), 1000}, |
| 163 | {0, 200}, | 164 | {0, 200}, |
| 164 | {440.0*pow(2.0,(67)/12.0), 1000} | 165 | {440.0*pow(2.0,(67)/12.0), 1000} |
| @@ -167,14 +168,14 @@ float tone_cm[][2] = { | |||
| 167 | float tone_dv[][2] = { | 168 | float tone_dv[][2] = { |
| 168 | {440.0*pow(2.0,(67)/12.0), 400}, | 169 | {440.0*pow(2.0,(67)/12.0), 400}, |
| 169 | {440.0*pow(2.0,(60)/12.0), 400}, | 170 | {440.0*pow(2.0,(60)/12.0), 400}, |
| 170 | {0, 400}, | 171 | {0, 800}, |
| 171 | {440.0*pow(2.0,(67)/12.0), 800}, | 172 | {440.0*pow(2.0,(67)/12.0), 800}, |
| 172 | {0, 200}, | 173 | {0, 200}, |
| 173 | {440.0*pow(2.0,(67)/12.0), 800}, | 174 | {440.0*pow(2.0,(67)/12.0), 800}, |
| 174 | {0, 200}, | 175 | {0, 200}, |
| 175 | {440.0*pow(2.0,(67)/12.0), 800} | 176 | {440.0*pow(2.0,(67)/12.0), 800} |
| 176 | }; | 177 | }; |
| 177 | 178 | #endif | |
| 178 | 179 | ||
| 179 | #define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) | 180 | #define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) |
| 180 | #define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) | 181 | #define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) |
| @@ -192,19 +193,25 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 192 | switch(id) { | 193 | switch(id) { |
| 193 | case M_QW: | 194 | case M_QW: |
| 194 | if (record->event.pressed) { | 195 | if (record->event.pressed) { |
| 195 | play_notes(&tone_qw, 4, false); | 196 | #ifdef AUDIO_ENABLE |
| 197 | play_notes(&tone_qw, 4, false); | ||
| 198 | #endif | ||
| 196 | default_layer_set(1UL<<_QW); | 199 | default_layer_set(1UL<<_QW); |
| 197 | } | 200 | } |
| 198 | break; | 201 | break; |
| 199 | case M_CM: | 202 | case M_CM: |
| 200 | if (record->event.pressed) { | 203 | if (record->event.pressed) { |
| 201 | play_notes(&tone_cm, 6, false); | 204 | #ifdef AUDIO_ENABLE |
| 205 | play_notes(&tone_cm, 6, false); | ||
| 206 | #endif | ||
| 202 | default_layer_set(1UL<<_CM); | 207 | default_layer_set(1UL<<_CM); |
| 203 | } | 208 | } |
| 204 | break; | 209 | break; |
| 205 | case M_DV: | 210 | case M_DV: |
| 206 | if (record->event.pressed) { | 211 | if (record->event.pressed) { |
| 207 | play_notes(&tone_dv, 8, false); | 212 | #ifdef AUDIO_ENABLE |
| 213 | play_notes(&tone_dv, 8, false); | ||
| 214 | #endif | ||
| 208 | default_layer_set(1UL<<_DV); | 215 | default_layer_set(1UL<<_DV); |
| 209 | } | 216 | } |
| 210 | break; | 217 | break; |
| @@ -240,6 +247,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 240 | return MACRO_NONE; | 247 | return MACRO_NONE; |
| 241 | }; | 248 | }; |
| 242 | 249 | ||
| 250 | #ifdef AUDIO_ENABLE | ||
| 243 | float start_up[][2] = { | 251 | float start_up[][2] = { |
| 244 | {440.0*pow(2.0,(67)/12.0), 650}, | 252 | {440.0*pow(2.0,(67)/12.0), 650}, |
| 245 | {440.0*pow(2.0,(64)/12.0), 450}, | 253 | {440.0*pow(2.0,(64)/12.0), 450}, |
| @@ -247,8 +255,11 @@ float start_up[][2] = { | |||
| 247 | {440.0*pow(2.0,(60)/12.0), 450}, | 255 | {440.0*pow(2.0,(60)/12.0), 450}, |
| 248 | {440.0*pow(2.0,(64)/12.0), 1000} | 256 | {440.0*pow(2.0,(64)/12.0), 1000} |
| 249 | }; | 257 | }; |
| 258 | #endif | ||
| 250 | 259 | ||
| 251 | void matrix_init_user(void) { | 260 | void matrix_init_user(void) { |
| 261 | #ifdef AUDIO_ENABLE | ||
| 252 | init_notes(); | 262 | init_notes(); |
| 253 | play_notes(&start_up, 5, false); | 263 | play_notes(&start_up, 5, false); |
| 264 | #endif | ||
| 254 | } | 265 | } |
diff --git a/keyboard/planck/keymaps/default/makefile.mk b/keyboard/planck/keymaps/default/makefile.mk new file mode 100644 index 000000000..628167ff6 --- /dev/null +++ b/keyboard/planck/keymaps/default/makefile.mk | |||
| @@ -0,0 +1 @@ | |||
| AUDIO_ENABLE = yes \ No newline at end of file | |||
