aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboard/atomic/Makefile67
-rw-r--r--keyboard/atomic/keymaps/pvc/config.h157
-rw-r--r--keyboard/atomic/keymaps/pvc/keymap.c (renamed from keyboard/atomic/keymaps/pvc/pvc_atomic.c)207
-rw-r--r--keyboard/atomic/keymaps/pvc/makefile.mk6
-rw-r--r--keyboard/planck/Makefile31
-rw-r--r--quantum/audio.h4
6 files changed, 297 insertions, 175 deletions
diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile
index 364efa3fa..1203cf6a3 100644
--- a/keyboard/atomic/Makefile
+++ b/keyboard/atomic/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 = atomic 42TARGET = atomic
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
@@ -73,6 +51,8 @@ TARGET_DIR = .
73# # project specific files 51# # project specific files
74SRC = atomic.c 52SRC = atomic.c
75 53
54CONFIG_H = config.h
55
76ifdef keymap 56ifdef keymap
77 KEYMAP = $(keymap) 57 KEYMAP = $(keymap)
78endif 58endif
@@ -88,7 +68,7 @@ ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
88endif 68endif
89else 69else
90$(error Keymap file does not exist) 70$(error Keymap file does not exist)
91endif 71endif
92endif 72endif
93 73
94else 74else
@@ -107,8 +87,6 @@ endif
107 87
108SRC := $(KEYMAP_FILE) $(SRC) 88SRC := $(KEYMAP_FILE) $(SRC)
109 89
110CONFIG_H = config.h
111
112# MCU name 90# MCU name
113#MCU = at90usb1287 91#MCU = at90usb1287
114MCU = atmega32u4 92MCU = atmega32u4
@@ -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,11 +135,45 @@ 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
157
158ifdef KEYMAP
159
160ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
161ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
162 include keymaps/$(KEYMAP)/makefile.mk
163endif
164endif
165
166else
167
168ifneq ("$(wildcard keymaps/default/makefile.mk)","")
169 include keymaps/default/makefile.mk
170endif
161 171
162ifeq ($(BACKLIGHT_ENABLE), yes)
163 SRC += backlight.c
164endif 172endif
165 173
174ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
175 SRC := backlight.c $(SRC)
176endif
166 177
167# Optimize size but this may cause error "relocation truncated to fit" 178# Optimize size but this may cause error "relocation truncated to fit"
168#EXTRALDFLAGS = -Wl,--relax 179#EXTRALDFLAGS = -Wl,--relax
diff --git a/keyboard/atomic/keymaps/pvc/config.h b/keyboard/atomic/keymaps/pvc/config.h
new file mode 100644
index 000000000..8449fa06d
--- /dev/null
+++ b/keyboard/atomic/keymaps/pvc/config.h
@@ -0,0 +1,157 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Ortholinear Keyboards
28#define PRODUCT The Atomic Keyboard
29#define DESCRIPTION A compact ortholinear keyboard
30
31/* key matrix size */
32#define MATRIX_ROWS 5
33#define MATRIX_COLS 15
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 }
46#define ROWS (int []){ D0, D5, B5, B6, B3 }
47
48/* COL2ROW or ROW2COL */
49#define DIODE_DIRECTION COL2ROW
50
51/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
52#define DEBOUNCE 5
53
54/* define if matrix has ghost (lacks anti-ghosting diodes) */
55//#define MATRIX_HAS_GHOST
56
57/* number of backlight levels */
58#define BACKLIGHT_LEVELS 3
59
60/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
61#define LOCKING_SUPPORT_ENABLE
62/* Locking resynchronize hack */
63#define LOCKING_RESYNC_ENABLE
64
65/*
66 * Force NKRO
67 *
68 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
69 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
70 * makefile for this to work.)
71 *
72 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
73 * until the next keyboard reset.
74 *
75 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
76 * fully operational during normal computer usage.
77 *
78 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
79 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
80 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
81 * power-up.
82 *
83 */
84//#define FORCE_NKRO
85
86/*
87 * Magic Key Options
88 *
89 * Magic keys are hotkey commands that allow control over firmware functions of
90 * the keyboard. They are best used in combination with the HID Listen program,
91 * found here: https://www.pjrc.com/teensy/hid_listen.html
92 *
93 * The options below allow the magic key functionality to be changed. This is
94 * useful if your keyboard/keypad is missing keys and you want magic key support.
95 *
96 */
97
98/* key combination for magic key command */
99#define IS_COMMAND() ( \
100 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
101)
102
103/* control how magic key switches layers */
104//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
105//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
106//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
107
108/* override magic key keymap */
109//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
112//#define MAGIC_KEY_HELP1 H
113//#define MAGIC_KEY_HELP2 SLASH
114//#define MAGIC_KEY_DEBUG D
115//#define MAGIC_KEY_DEBUG_MATRIX X
116//#define MAGIC_KEY_DEBUG_KBD K
117//#define MAGIC_KEY_DEBUG_MOUSE M
118//#define MAGIC_KEY_VERSION V
119//#define MAGIC_KEY_STATUS S
120//#define MAGIC_KEY_CONSOLE C
121//#define MAGIC_KEY_LAYER0_ALT1 ESC
122//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
123//#define MAGIC_KEY_LAYER0 0
124//#define MAGIC_KEY_LAYER1 1
125//#define MAGIC_KEY_LAYER2 2
126//#define MAGIC_KEY_LAYER3 3
127//#define MAGIC_KEY_LAYER4 4
128//#define MAGIC_KEY_LAYER5 5
129//#define MAGIC_KEY_LAYER6 6
130//#define MAGIC_KEY_LAYER7 7
131//#define MAGIC_KEY_LAYER8 8
132//#define MAGIC_KEY_LAYER9 9
133#define MAGIC_KEY_BOOTLOADER B
134//#define MAGIC_KEY_LOCK CAPS
135//#define MAGIC_KEY_EEPROM E
136//#define MAGIC_KEY_NKRO N
137//#define MAGIC_KEY_SLEEP_LED Z
138
139/*
140 * Feature disable options
141 * These options are also useful to firmware size reduction.
142 */
143
144/* disable debug print */
145//#define NO_DEBUG
146
147/* disable print */
148//#define NO_PRINT
149
150/* disable action features */
151//#define NO_ACTION_LAYER
152//#define NO_ACTION_TAPPING
153//#define NO_ACTION_ONESHOT
154//#define NO_ACTION_MACRO
155//#define NO_ACTION_FUNCTION
156
157#endif
diff --git a/keyboard/atomic/keymaps/pvc/pvc_atomic.c b/keyboard/atomic/keymaps/pvc/keymap.c
index 3ddd3e329..627f57ff7 100644
--- a/keyboard/atomic/keymaps/pvc/pvc_atomic.c
+++ b/keyboard/atomic/keymaps/pvc/keymap.c
@@ -1,12 +1,19 @@
1#include "atomic.h" 1#include "atomic.h"
2#include "action_layer.h" 2#include "action_layer.h"
3#ifdef AUDIO_ENABLE
4 #include "audio.h"
5#endif
3 6
4#define _QW 0 7#define _QW 0
5#define _LW 1 8#define _LW 1
6#define _RS 2 9#define _RS 2
7#define _FN 3 10#define _FN 3
8#define _F1 4 11
9#define _F2 5 12#define M_QW 0
13#define M_LW 1
14#define M_RS 2
15#define M_FN 3
16
10 17
11#define _______ KC_TRNS 18#define _______ KC_TRNS
12#define ___T___ KC_TRNS 19#define ___T___ KC_TRNS
@@ -32,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
32 { 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_BSLS, KC_DEL }, 39 { 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_BSLS, KC_DEL },
33 { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, XXXXXXX, KC_PGUP }, 40 { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, XXXXXXX, KC_PGUP },
34 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_UP, KC_PGDN }, 41 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_UP, KC_PGDN },
35 { KC_LCTL, KC_LGUI, M(_FN), KC_LALT, M(_RS), KC_SPC, XXXXXXX, M(_LW), KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, 42 { KC_LCTL, KC_LGUI, M(M_FN), KC_LALT, M(M_RS), KC_SPC, XXXXXXX, M(M_LW), KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
36 }, 43 },
37 [_LW] = { /* LOWERED */ 44 [_LW] = { /* LOWERED */
38 { 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, ___T___, ___T___ }, 45 { 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, ___T___, ___T___ },
@@ -55,29 +62,50 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
55 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, 62 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
56 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, 63 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
57 }, 64 },
58 [_F1] = { /* FUNCTION */
59 { KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
60 { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
61 { KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
62 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
63 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
64 },
65 [_F2] = { /* FUNCTION */
66 { KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
67 { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
68 { KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
69 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
70 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
71 },
72}; 65};
73 66
74#define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) 67#define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer)))
75#define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) 68#define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer)))
76 69
70
71#ifdef AUDIO_ENABLE
72float tone_lw[][2] = {
73 {440.0*pow(2.0,(59)/12.0), 8},
74 {440.0*pow(2.0,(60)/12.0), 8},
75 {0, 4},
76 {440.0*pow(2.0,(67)/12.0), 16}
77};
78
79float tone_rs[][2] = {
80 {440.0*pow(2.0,(59)/12.0), 8},
81 {440.0*pow(2.0,(60)/12.0), 8},
82 {0, 4},
83 {440.0*pow(2.0,(67)/12.0), 16},
84 {0, 4},
85 {440.0*pow(2.0,(71)/12.0), 16}
86};
87
88float tone_fn[][2] = {
89 {440.0*pow(2.0,(59)/12.0), 8},
90 {440.0*pow(2.0,(60)/12.0), 8},
91 {0, 4},
92 {440.0*pow(2.0,(67)/12.0), 16},
93 {0, 4},
94 {440.0*pow(2.0,(69)/12.0), 16},
95 {0, 4},
96 {440.0*pow(2.0,(67)/12.0), 16}
97};
98#endif
99
100
77void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) 101void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3)
78{ 102{
79 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) 103 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
80 { 104 {
105 #ifdef AUDIO_ENABLE
106 println("PlayNotes FN");
107 play_notes(&tone_fn, 8, false);
108 #endif
81 layer_on(layer3); 109 layer_on(layer3);
82 } 110 }
83 else 111 else
@@ -114,37 +142,6 @@ void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t l
114 } 142 }
115} 143}
116 144
117/* ignore me
118void change_quad_layer(uint8_t focus_layer, bool desired_focus_layer_state, uint8_t pair_layer, uint8_t layer3, uint8_t layer4)
119{
120
121 // If desired focus layer state == 1 and current focus layer state == 1
122 if ((desired_focus_layer_state) && IS_LAYER_ON(layer1))
123 {
124 // Do Nothing
125 }
126 // If desired focus layer state == 0 and current focus layer state == 1
127 else if ((desired_focus_layer_state) && IS_LAYER_ON(layer1))
128 {
129 // If
130 layer_off(layer3);
131 layer_off(layer4);
132 }
133 }
134 else
135 {
136 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
137 {
138 layer_on(layer4);
139 }
140 else
141 {
142 layer_off(layer3);
143 layer_off(layer4);
144 }
145 }
146}
147*/
148 145
149const uint16_t PROGMEM fn_actions[] = { 146const uint16_t PROGMEM fn_actions[] = {
150}; 147};
@@ -152,70 +149,54 @@ const uint16_t PROGMEM fn_actions[] = {
152 149
153const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 150const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
154{ 151{
155 152 // MACRODOWN only works in this function
156 // MACRODOWN only works in this function 153 switch(id) {
157 switch(id) 154 case M_LW:
158 { 155 if (record->event.pressed) {
159 case _FN: 156 #ifdef AUDIO_ENABLE
160 if (record->event.pressed) { 157 println("PlayNotes LW");
161 print("FN_DN\n"); 158 play_notes(&tone_lw, 4, false);
162 print_val_bin32(layer_state); 159 #endif
163 layer_on(_FN); 160 layer_on(_LW);
164 print_val_bin32(layer_state); 161 update_tri_layer(_LW, _RS, _FN);
165 } else { 162 } else {
166 print("FN_UP\n"); 163 layer_off(_LW);
167 print_val_bin32(layer_state); 164 update_tri_layer(_LW, _RS, _FN);
168 layer_off(_FN); 165 }
169 print_val_bin32(layer_state); 166 break;
170 } 167 case M_RS:
171 break; 168 if (record->event.pressed) {
172 169 #ifdef AUDIO_ENABLE
173 case _RS: 170 println("PlayNotes RS");
174 if (record->event.pressed) { 171 play_notes(&tone_rs, 6, false);
175 print("RS_DN\n"); 172 #endif
176 print_val_bin32(layer_state); 173 layer_on(_RS);
177 layer_on(_RS); 174 update_tri_layer(_LW, _RS, _FN);
178 //tri_layer++; 175 } else {
179 print_val_bin32(layer_state); 176 layer_off(_RS);
180 //update_tri_layer(_RS, _LW, _FN); 177 update_tri_layer(_LW, _RS, _FN);
181 update_quad_layer(_RS, _LW, _F1, _F2, 0); 178 }
182 print_val_bin32(layer_state); 179 break;
183 } else {
184 print("RS_UP\n");
185 print_val_bin32(layer_state);
186 layer_off(_RS);
187 //tri_layer--;
188 print_val_bin32(layer_state);
189 //update_tri_layer(_RS, _LW, _FN);
190 update_quad_layer(_RS, _LW, _F1, _F2, 0);
191 print_val_bin32(layer_state);
192 }
193 break;
194
195 case _LW:
196 if (record->event.pressed) {
197 print("LW_DN\n");
198 print_val_bin32(layer_state);
199 layer_on(_LW);
200 //tri_layer++;
201 print_val_bin32(layer_state);
202 //update_tri_layer(_RS, _LW, _FN);
203 update_quad_layer(_RS, _LW, _F1, _F2, 1);
204 print_val_bin32(layer_state);
205 } else {
206 print("LW_UP\n");
207 print_val_bin32(layer_state);
208 layer_off(_LW);
209 //tri_layer--;
210 print_val_bin32(layer_state);
211 //update_tri_layer(_RS, _LW, _FN);
212 update_quad_layer(_RS, _LW, _F1, _F2, 1);
213 print_val_bin32(layer_state);
214 }
215 break;
216
217 default: 180 default:
218 break; 181 break;
219 } 182 }
220 return MACRO_NONE; 183 return MACRO_NONE;
184};
185
186#ifdef AUDIO_ENABLE
187float start_up[][2] = {
188 {440.0*pow(2.0,(67)/12.0), 12},
189 {440.0*pow(2.0,(64)/12.0), 8},
190 {440.0*pow(2.0,(55)/12.0), 8},
191 {440.0*pow(2.0,(60)/12.0), 8},
192 {440.0*pow(2.0,(64)/12.0), 20}
221}; 193};
194#endif
195
196void matrix_init_user(void) {
197 #ifdef AUDIO_ENABLE
198 init_notes();
199 play_notes(&start_up, 5, false);
200 println("Matrix Init");
201 #endif
202}
diff --git a/keyboard/atomic/keymaps/pvc/makefile.mk b/keyboard/atomic/keymaps/pvc/makefile.mk
index ff0a9c338..c41102f5d 100644
--- a/keyboard/atomic/keymaps/pvc/makefile.mk
+++ b/keyboard/atomic/keymaps/pvc/makefile.mk
@@ -1,16 +1,18 @@
1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 2MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400) 4CONSOLE_ENABLE = yes # Console for debug(+400)
5COMMAND_ENABLE = yes # Commands for debug and configuration 5COMMAND_ENABLE = yes # Commands for debug and configuration
6NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: 6NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here:
7 # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 7 # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
8BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 8BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
9MIDI_ENABLE = no # MIDI controls 9MIDI_ENABLE = no # MIDI controls
10AUDIO_ENABLE = no # Audio output on port C6 10AUDIO_ENABLE = yes # Audio output on port C6
11UNICODE_ENABLE = no # Unicode 11UNICODE_ENABLE = no # Unicode
12BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 12BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
13RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. 13RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
14 14
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17
18CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index c8517e756..83b8303b0 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -157,39 +157,10 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
157 157
158ifdef KEYMAP 158ifdef KEYMAP
159 159
160<<<<<<< HEAD
161<<<<<<< HEAD
162# Build Options
163# comment out to disable the options.
164#
165BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
166MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
167EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
168CONSOLE_ENABLE = yes # Console for debug(+400)
169COMMAND_ENABLE = yes # Commands for debug and configuration
170NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
171# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
172# MIDI_ENABLE = yes # MIDI controls
173# AUDIO_ENABLE = yes # Audio output on port C6
174# UNICODE_ENABLE = yes # Unicode
175# BLUETOOTH_ENABLE = ye # Enable Bluetooth with the Adafruit EZ-Key HID
176# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
177
178# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
179#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
180
181
182ifdef BACKLIGHT_ENABLE
183=======
184ifeq ($(BACKLIGHT_ENABLE), yes)
185>>>>>>> master
186 SRC += backlight.c
187=======
188ifeq ("$(wildcard keymaps/$(KEYMAP).c)","") 160ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
189ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") 161ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
190 include keymaps/$(KEYMAP)/makefile.mk 162 include keymaps/$(KEYMAP)/makefile.mk
191endif 163endif
192>>>>>>> remotes/jackhumbert/new_defaults
193endif 164endif
194 165
195else 166else
@@ -212,4 +183,4 @@ VPATH += $(TARGET_DIR)
212VPATH += $(TOP_DIR) 183VPATH += $(TOP_DIR)
213VPATH += $(TMK_DIR) 184VPATH += $(TMK_DIR)
214 185
215include $(TOP_DIR)/quantum/quantum.mk 186include $(TOP_DIR)/quantum/quantum.mk \ No newline at end of file
diff --git a/quantum/audio.h b/quantum/audio.h
index 99203cea7..31f9a3579 100644
--- a/quantum/audio.h
+++ b/quantum/audio.h
@@ -6,6 +6,6 @@
6void play_sample(uint8_t * s, uint16_t l, bool r); 6void play_sample(uint8_t * s, uint16_t l, bool r);
7void play_note(double freq, int vol); 7void play_note(double freq, int vol);
8void stop_note(double freq); 8void stop_note(double freq);
9void stop_all_notes(); 9void stop_all_notes(void);
10void init_notes(); 10void init_notes(void);
11void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat); \ No newline at end of file 11void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat); \ No newline at end of file