aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIBNobody <protospherex@gmail.com>2016-04-15 13:09:42 -0500
committerIBNobody <protospherex@gmail.com>2016-04-15 13:09:42 -0500
commit39e520c010072aa17c0bcb2c5bfbbee08e010170 (patch)
tree4f9b28ad7bc26f2b62ee2bd966b04cbd0f1f5e79
parent66c1024bd328b687fba0645f70469094e75d624c (diff)
parentee2ee7f4f049dda385a9db7dddd8e7e91681315b (diff)
downloadqmk_firmware-39e520c010072aa17c0bcb2c5bfbbee08e010170.tar.gz
qmk_firmware-39e520c010072aa17c0bcb2c5bfbbee08e010170.zip
Prepping for merge with new_defaults
-rw-r--r--keyboard/planck/Makefile62
-rw-r--r--keyboard/planck/keymaps/default/keymap.c49
-rw-r--r--keyboard/planck/keymaps/default/makefile.mk2
-rw-r--r--quantum/audio.c7
-rw-r--r--quantum/keymap_common.c10
-rw-r--r--quantum/quantum.mk8
-rw-r--r--tmk_core/common.mk27
-rw-r--r--tmk_core/protocol/lufa.mk4
8 files changed, 93 insertions, 76 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index 992679f47..c8517e756 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -38,31 +38,9 @@
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#
45BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
46MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
47EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
48CONSOLE_ENABLE = yes # Console for debug(+400)
49COMMAND_ENABLE = yes # Commands for debug and configuration
50NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here:
51 # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
52BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
53MIDI_ENABLE = no # MIDI controls
54AUDIO_ENABLE = no # Audio output on port C6
55UNICODE_ENABLE = no # Unicode
56BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
57RGBLIGHT_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
60SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
61
62# Target file name (without extension). 41# Target file name (without extension).
63TARGET = planck 42TARGET = planck
64 43
65
66# Directory common source filess exist 44# Directory common source filess exist
67TOP_DIR = ../.. 45TOP_DIR = ../..
68TMK_DIR = ../../tmk_core 46TMK_DIR = ../../tmk_core
@@ -126,7 +104,6 @@ MCU = atmega32u4
126# software delays. 104# software delays.
127F_CPU = 16000000 105F_CPU = 16000000
128 106
129
130# 107#
131# LUFA specific 108# LUFA specific
132# 109#
@@ -158,7 +135,29 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
158# USBaspLoader 2048 135# USBaspLoader 2048
159OPT_DEFS += -DBOOTLOADER_SIZE=4096 136OPT_DEFS += -DBOOTLOADER_SIZE=4096
160 137
138# Build Options
139# change to "no" to disable the options, or define them in the makefile.mk in
140# the appropriate keymap folder that will get included automatically
141#
142BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
143MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
144EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
145CONSOLE_ENABLE = yes # Console for debug(+400)
146COMMAND_ENABLE = yes # Commands for debug and configuration
147NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
148BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
149MIDI_ENABLE = no # MIDI controls
150AUDIO_ENABLE = no # Audio output on port C6
151UNICODE_ENABLE = no # Unicode
152BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
153RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
154
155# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
156SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
161 157
158ifdef KEYMAP
159
160<<<<<<< HEAD
162<<<<<<< HEAD 161<<<<<<< HEAD
163# Build Options 162# Build Options
164# comment out to disable the options. 163# comment out to disable the options.
@@ -185,8 +184,25 @@ ifdef BACKLIGHT_ENABLE
185ifeq ($(BACKLIGHT_ENABLE), yes) 184ifeq ($(BACKLIGHT_ENABLE), yes)
186>>>>>>> master 185>>>>>>> master
187 SRC += backlight.c 186 SRC += backlight.c
187=======
188ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
189ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
190 include keymaps/$(KEYMAP)/makefile.mk
191endif
192>>>>>>> remotes/jackhumbert/new_defaults
188endif 193endif
189 194
195else
196
197ifneq ("$(wildcard keymaps/default/makefile.mk)","")
198 include keymaps/default/makefile.mk
199endif
200
201endif
202
203ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
204 SRC := backlight.c $(SRC)
205endif
190 206
191# Optimize size but this may cause error "relocation truncated to fit" 207# Optimize size but this may cause error "relocation truncated to fit"
192#EXTRALDFLAGS = -Wl,--relax 208#EXTRALDFLAGS = -Wl,--relax
diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c
index 97ba5d285..dee2840f2 100644
--- a/keyboard/planck/keymaps/default/keymap.c
+++ b/keyboard/planck/keymaps/default/keymap.c
@@ -2,9 +2,6 @@
2// this is the style you want to emulate. 2// this is the style you want to emulate.
3 3
4#include "planck.h" 4#include "planck.h"
5#ifdef BACKLIGHT_ENABLE
6 #include "backlight.h"
7#endif
8#include "action_layer.h" 5#include "action_layer.h"
9#ifdef AUDIO_ENABLE 6#ifdef AUDIO_ENABLE
10 #include "audio.h" 7 #include "audio.h"
@@ -150,30 +147,30 @@ const uint16_t PROGMEM fn_actions[] = {
150 147
151#ifdef AUDIO_ENABLE 148#ifdef AUDIO_ENABLE
152float tone_qw[][2] = { 149float tone_qw[][2] = {
153 {440.0*pow(2.0,(67)/12.0), 400}, 150 {440.0*pow(2.0,(59)/12.0), 8},
154 {440.0*pow(2.0,(60)/12.0), 400}, 151 {440.0*pow(2.0,(60)/12.0), 8},
155 {0, 800}, 152 {0, 4},
156 {440.0*pow(2.0,(67)/12.0), 1600} 153 {440.0*pow(2.0,(67)/12.0), 16}
157}; 154};
158 155
159float tone_cm[][2] = { 156float tone_cm[][2] = {
160 {440.0*pow(2.0,(67)/12.0), 400}, 157 {440.0*pow(2.0,(59)/12.0), 8},
161 {440.0*pow(2.0,(60)/12.0), 400}, 158 {440.0*pow(2.0,(60)/12.0), 8},
162 {0, 800}, 159 {0, 4},
163 {440.0*pow(2.0,(67)/12.0), 1000}, 160 {440.0*pow(2.0,(67)/12.0), 16},
164 {0, 200}, 161 {0, 4},
165 {440.0*pow(2.0,(67)/12.0), 1000} 162 {440.0*pow(2.0,(71)/12.0), 16}
166}; 163};
167 164
168float tone_dv[][2] = { 165float tone_dv[][2] = {
169 {440.0*pow(2.0,(67)/12.0), 400}, 166 {440.0*pow(2.0,(59)/12.0), 8},
170 {440.0*pow(2.0,(60)/12.0), 400}, 167 {440.0*pow(2.0,(60)/12.0), 8},
171 {0, 800}, 168 {0, 4},
172 {440.0*pow(2.0,(67)/12.0), 800}, 169 {440.0*pow(2.0,(67)/12.0), 16},
173 {0, 200}, 170 {0, 4},
174 {440.0*pow(2.0,(67)/12.0), 800}, 171 {440.0*pow(2.0,(69)/12.0), 16},
175 {0, 200}, 172 {0, 4},
176 {440.0*pow(2.0,(67)/12.0), 800} 173 {440.0*pow(2.0,(67)/12.0), 16}
177}; 174};
178#endif 175#endif
179 176
@@ -249,11 +246,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
249 246
250#ifdef AUDIO_ENABLE 247#ifdef AUDIO_ENABLE
251float start_up[][2] = { 248float start_up[][2] = {
252 {440.0*pow(2.0,(67)/12.0), 650}, 249 {440.0*pow(2.0,(67)/12.0), 12},
253 {440.0*pow(2.0,(64)/12.0), 450}, 250 {440.0*pow(2.0,(64)/12.0), 8},
254 {440.0*pow(2.0,(55)/12.0), 450}, 251 {440.0*pow(2.0,(55)/12.0), 8},
255 {440.0*pow(2.0,(60)/12.0), 450}, 252 {440.0*pow(2.0,(60)/12.0), 8},
256 {440.0*pow(2.0,(64)/12.0), 1000} 253 {440.0*pow(2.0,(64)/12.0), 20}
257}; 254};
258#endif 255#endif
259 256
diff --git a/keyboard/planck/keymaps/default/makefile.mk b/keyboard/planck/keymaps/default/makefile.mk
index 628167ff6..8cbec4a1f 100644
--- a/keyboard/planck/keymaps/default/makefile.mk
+++ b/keyboard/planck/keymaps/default/makefile.mk
@@ -1 +1 @@
AUDIO_ENABLE = yes \ No newline at end of file AUDIO_ENABLE = yes \ No newline at end of file
diff --git a/quantum/audio.c b/quantum/audio.c
index f29d941d7..50e5505fe 100644
--- a/quantum/audio.c
+++ b/quantum/audio.c
@@ -255,7 +255,12 @@ ISR(TIMER3_COMPA_vect) {
255 255
256 256
257 note_position++; 257 note_position++;
258 if (note_position >= note_length) { 258 bool end_of_note = false;
259 if (ICR3 > 0)
260 end_of_note = (note_position >= (note_length / ICR3 * 0xFFFF));
261 else
262 end_of_note = (note_position >= (note_length * 0x7FF));
263 if (end_of_note) {
259 current_note++; 264 current_note++;
260 if (current_note >= notes_length) { 265 if (current_note >= notes_length) {
261 if (notes_repeat) { 266 if (notes_repeat) {
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index ae6cddb34..e3030a886 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -33,11 +33,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33 #include "audio.h" 33 #include "audio.h"
34 34
35 float goodbye[][2] = { 35 float goodbye[][2] = {
36 {440.0*pow(2.0,(67)/12.0), 400}, 36 {440.0*pow(2.0,(67)/12.0), 8},
37 {0, 50}, 37 {440.0*pow(2.0,(60)/12.0), 8},
38 {440.0*pow(2.0,(60)/12.0), 400}, 38 {440.0*pow(2.0,(55)/12.0), 12},
39 {0, 50},
40 {440.0*pow(2.0,(55)/12.0), 600},
41 }; 39 };
42#endif 40#endif
43 41
@@ -90,7 +88,7 @@ action_t action_for_key(uint8_t layer, keypos_t key)
90 action_t action; 88 action_t action;
91 clear_keyboard(); 89 clear_keyboard();
92 #ifdef AUDIO_ENABLE 90 #ifdef AUDIO_ENABLE
93 play_notes(&goodbye, 5, false); 91 play_notes(&goodbye, 3, false);
94 #endif 92 #endif
95 _delay_ms(250); 93 _delay_ms(250);
96 #ifdef ATREUS_ASTAR 94 #ifdef ATREUS_ASTAR
diff --git a/quantum/quantum.mk b/quantum/quantum.mk
index 3069f582c..17bb50171 100644
--- a/quantum/quantum.mk
+++ b/quantum/quantum.mk
@@ -23,19 +23,19 @@ ifndef CUSTOM_MATRIX
23 SRC += $(QUANTUM_DIR)/matrix.c 23 SRC += $(QUANTUM_DIR)/matrix.c
24endif 24endif
25 25
26ifeq ($(MIDI_ENABLE), yes) 26ifeq ($(strip $(MIDI_ENABLE)), yes)
27 SRC += $(QUANTUM_DIR)/keymap_midi.c 27 SRC += $(QUANTUM_DIR)/keymap_midi.c
28endif 28endif
29 29
30ifeq ($(AUDIO_ENABLE), yes) 30ifeq ($(strip $(AUDIO_ENABLE)), yes)
31 SRC += $(QUANTUM_DIR)/audio.c 31 SRC += $(QUANTUM_DIR)/audio.c
32endif 32endif
33 33
34ifeq ($(UNICODE_ENABLE), yes) 34ifeq ($(strip $(UNICODE_ENABLE)), yes)
35 SRC += $(QUANTUM_DIR)/keymap_unicode.c 35 SRC += $(QUANTUM_DIR)/keymap_unicode.c
36endif 36endif
37 37
38ifeq ($(RGBLIGHT_ENABLE), yes) 38ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
39 SRC += $(QUANTUM_DIR)/light_ws2812.c 39 SRC += $(QUANTUM_DIR)/light_ws2812.c
40 SRC += $(QUANTUM_DIR)/rgblight.c 40 SRC += $(QUANTUM_DIR)/rgblight.c
41 OPT_DEFS += -DRGBLIGHT_ENABLE 41 OPT_DEFS += -DRGBLIGHT_ENABLE
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index 8d028d52a..f8006c670 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -17,66 +17,67 @@ SRC += $(COMMON_DIR)/host.c \
17 17
18 18
19# Option modules 19# Option modules
20ifeq ($(BOOTMAGIC_ENABLE), yes) 20ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
21 SRC += $(COMMON_DIR)/bootmagic.c 21 SRC += $(COMMON_DIR)/bootmagic.c
22 SRC += $(COMMON_DIR)/avr/eeconfig.c 22 SRC += $(COMMON_DIR)/avr/eeconfig.c
23 OPT_DEFS += -DBOOTMAGIC_ENABLE 23 OPT_DEFS += -DBOOTMAGIC_ENABLE
24endif 24endif
25 25
26ifeq ($(MOUSEKEY_ENABLE), yes) 26ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
27 SRC += $(COMMON_DIR)/mousekey.c 27 SRC += $(COMMON_DIR)/mousekey.c
28 OPT_DEFS += -DMOUSEKEY_ENABLE 28 OPT_DEFS += -DMOUSEKEY_ENABLE
29 OPT_DEFS += -DMOUSE_ENABLE 29 OPT_DEFS += -DMOUSE_ENABLE
30endif 30endif
31 31
32ifeq ($(EXTRAKEY_ENABLE), yes) 32ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
33 OPT_DEFS += -DEXTRAKEY_ENABLE 33 OPT_DEFS += -DEXTRAKEY_ENABLE
34endif 34endif
35 35
36ifeq ($(CONSOLE_ENABLE), yes) 36ifeq ($(strip $(CONSOLE_ENABLE)), yes)
37 OPT_DEFS += -DCONSOLE_ENABLE 37 OPT_DEFS += -DCONSOLE_ENABLE
38else 38else
39 OPT_DEFS += -DNO_PRINT 39 OPT_DEFS += -DNO_PRINT
40 OPT_DEFS += -DNO_DEBUG 40 OPT_DEFS += -DNO_DEBUG
41endif 41endif
42 42
43ifeq ($(COMMAND_ENABLE), yes) 43ifeq ($(strip $(COMMAND_ENABLE)), yes)
44 SRC += $(COMMON_DIR)/command.c 44 SRC += $(COMMON_DIR)/command.c
45 OPT_DEFS += -DCOMMAND_ENABLE 45 OPT_DEFS += -DCOMMAND_ENABLE
46endif 46endif
47 47
48ifeq ($(NKRO_ENABLE), yes) 48ifeq ($(strip $(NKRO_ENABLE)), yes)
49 OPT_DEFS += -DNKRO_ENABLE 49 OPT_DEFS += -DNKRO_ENABLE
50endif 50endif
51 51
52ifeq ($(MIDI_ENABLE), yes) 52ifeq ($(strip $(MIDI_ENABLE)), yes)
53 OPT_DEFS += -DMIDI_ENABLE 53 OPT_DEFS += -DMIDI_ENABLE
54endif 54endif
55 55
56ifeq ($(AUDIO_ENABLE), yes) 56ifeq ($(strip $(AUDIO_ENABLE)), yes)
57 OPT_DEFS += -DAUDIO_ENABLE 57 OPT_DEFS += -DAUDIO_ENABLE
58endif 58endif
59 59
60ifeq ($(USB_6KRO_ENABLE), yes) 60ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
61 OPT_DEFS += -DUSB_6KRO_ENABLE 61 OPT_DEFS += -DUSB_6KRO_ENABLE
62endif 62endif
63 63
64ifeq ($(SLEEP_LED_ENABLE), yes) 64ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
65 SRC += $(COMMON_DIR)/sleep_led.c 65 SRC += $(COMMON_DIR)/sleep_led.c
66 OPT_DEFS += -DSLEEP_LED_ENABLE 66 OPT_DEFS += -DSLEEP_LED_ENABLE
67 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN 67 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
68endif 68endif
69 69
70ifeq ($(BACKLIGHT_ENABLE), yes) 70ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
71 SRC += $(COMMON_DIR)/backlight.c 71 SRC += $(COMMON_DIR)/backlight.c
72 SRC += $(COMMON_DIR)/avr/eeconfig.c
72 OPT_DEFS += -DBACKLIGHT_ENABLE 73 OPT_DEFS += -DBACKLIGHT_ENABLE
73endif 74endif
74 75
75ifeq ($(BLUETOOTH_ENABLE), yes) 76ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
76 OPT_DEFS += -DBLUETOOTH_ENABLE 77 OPT_DEFS += -DBLUETOOTH_ENABLE
77endif 78endif
78 79
79ifeq ($(KEYMAP_SECTION_ENABLE), yes) 80ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
80 OPT_DEFS += -DKEYMAP_SECTION_ENABLE 81 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
81 82
82 ifeq ($(strip $(MCU)),atmega32u2) 83 ifeq ($(strip $(MCU)),atmega32u2)
diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk
index f3209c227..9ac6298f1 100644
--- a/tmk_core/protocol/lufa.mk
+++ b/tmk_core/protocol/lufa.mk
@@ -17,7 +17,7 @@ LUFA_SRC = $(LUFA_DIR)/lufa.c \
17 $(LUFA_DIR)/descriptor.c \ 17 $(LUFA_DIR)/descriptor.c \
18 $(LUFA_SRC_USB) 18 $(LUFA_SRC_USB)
19 19
20ifeq ($(MIDI_ENABLE), yes) 20ifeq ($(strip $(MIDI_ENABLE)), yes)
21 LUFA_SRC += $(LUFA_DIR)/midi/midi.c \ 21 LUFA_SRC += $(LUFA_DIR)/midi/midi.c \
22 $(LUFA_DIR)/midi/midi_device.c \ 22 $(LUFA_DIR)/midi/midi_device.c \
23 $(LUFA_DIR)/midi/bytequeue/bytequeue.c \ 23 $(LUFA_DIR)/midi/bytequeue/bytequeue.c \
@@ -25,7 +25,7 @@ ifeq ($(MIDI_ENABLE), yes)
25 $(LUFA_SRC_USBCLASS) 25 $(LUFA_SRC_USBCLASS)
26endif 26endif
27 27
28ifeq ($(BLUETOOTH_ENABLE), yes) 28ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
29 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 29 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
30 $(TMK_DIR)/protocol/serial_uart.c 30 $(TMK_DIR)/protocol/serial_uart.c
31endif 31endif