aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboard/atomic/Makefile91
-rw-r--r--keyboard/atomic/config.h2
-rw-r--r--keyboard/atomic/keymaps/pvc/config.h157
-rw-r--r--keyboard/atomic/keymaps/pvc/keymap.c (renamed from keyboard/atomic/keymaps/pc_atomic.c)177
-rw-r--r--keyboard/atomic/keymaps/pvc/makefile.mk17
-rw-r--r--keyboard/planck/Makefile2
-rw-r--r--keyboard/planck/keymaps/pvc_planck.c (renamed from keyboard/planck/keymaps/pc.c)71
-rw-r--r--quantum/musical_notes.h182
-rw-r--r--tmk_core/common/action_layer.h1
9 files changed, 645 insertions, 55 deletions
diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile
index 20cf4fff1..3f066aebc 100644
--- a/keyboard/atomic/Makefile
+++ b/keyboard/atomic/Makefile
@@ -27,7 +27,7 @@
27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP 27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28# (must have Atmel FLIP installed). 28# (must have Atmel FLIP installed).
29# 29#
30# make debug = Start either simulavr or avarice as specified for debugging, 30# make debug = Start either simulavr or avarice as specified for debugging,
31# with avr-gdb or avr-insight as the front end for debugging. 31# with avr-gdb or avr-insight as the front end for debugging.
32# 32#
33# make filename.s = Just compile filename.c into the assembler code only. 33# make filename.s = Just compile filename.c into the assembler code only.
@@ -41,7 +41,6 @@
41# Target file name (without extension). 41# Target file name (without extension).
42TARGET = atomic 42TARGET = atomic
43 43
44
45# Directory common source filess exist 44# Directory common source filess exist
46TOP_DIR = ../.. 45TOP_DIR = ../..
47TMK_DIR = ../../tmk_core 46TMK_DIR = ../../tmk_core
@@ -50,15 +49,42 @@ TMK_DIR = ../../tmk_core
50TARGET_DIR = . 49TARGET_DIR = .
51 50
52# # project specific files 51# # project specific files
53SRC = atomic.c \ 52SRC = atomic.c
54 backlight.c 53
54ifdef keymap
55 KEYMAP = $(keymap)
56endif
55 57
56ifdef KEYMAP 58ifdef KEYMAP
57 SRC := keymaps/$(KEYMAP).c $(SRC) 59ifneq ("$(wildcard keymaps/$(KEYMAP).c)","")
60 KEYMAP_FILE = keymaps/$(KEYMAP).c
61else
62ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","")
63 KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c
64ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
65 include keymaps/$(KEYMAP)/makefile.mk
66endif
58else 67else
59 SRC := keymaps/default.c $(SRC) 68$(error Keymap file does not exist)
69endif
60endif 70endif
61 71
72else
73
74ifneq ("$(wildcard keymaps/default.c)","")
75 KEYMAP_FILE = keymaps/default.c
76else
77 KEYMAP_FILE = keymaps/default/keymap.c
78endif
79
80ifneq ("$(wildcard keymaps/default/makefile.mk)","")
81 include keymaps/default/makefile.mk
82endif
83
84endif
85
86SRC := $(KEYMAP_FILE) $(SRC)
87
62CONFIG_H = config.h 88CONFIG_H = config.h
63 89
64# MCU name 90# MCU name
@@ -78,7 +104,6 @@ MCU = atmega32u4
78# software delays. 104# software delays.
79F_CPU = 16000000 105F_CPU = 16000000
80 106
81
82# 107#
83# LUFA specific 108# LUFA specific
84# 109#
@@ -110,23 +135,45 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
110# USBaspLoader 2048 135# USBaspLoader 2048
111OPT_DEFS += -DBOOTLOADER_SIZE=4096 136OPT_DEFS += -DBOOTLOADER_SIZE=4096
112 137
113
114# Build Options 138# Build Options
115# comment out to disable the options. 139# change to "no" to disable the options, or define them in the makefile.mk in
116# 140# the appropriate keymap folder that will get included automatically
117BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) 141#
118MOUSEKEY_ENABLE = yes # Mouse keys(+4700) 142BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
119EXTRAKEY_ENABLE = yes # Audio control and System control(+450) 143MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
120CONSOLE_ENABLE = yes # Console for debug(+400) 144EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
121COMMAND_ENABLE = yes # Commands for debug and configuration 145CONSOLE_ENABLE = yes # Console for debug(+400)
122#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 146COMMAND_ENABLE = yes # Commands for debug and configuration
123BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality 147NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
124#MIDI_ENABLE = yes # MIDI controls 148BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
125#UNICODE_ENABLE = yes # Unicode 149MIDI_ENABLE = no # MIDI controls
126#BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID 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.
127 154
128# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 155# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
129#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 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
171
172endif
173
174ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
175 SRC := backlight.c $(SRC)
176endif
130 177
131# Optimize size but this may cause error "relocation truncated to fit" 178# Optimize size but this may cause error "relocation truncated to fit"
132#EXTRALDFLAGS = -Wl,--relax 179#EXTRALDFLAGS = -Wl,--relax
@@ -136,4 +183,4 @@ VPATH += $(TARGET_DIR)
136VPATH += $(TOP_DIR) 183VPATH += $(TOP_DIR)
137VPATH += $(TMK_DIR) 184VPATH += $(TMK_DIR)
138 185
139include $(TOP_DIR)/quantum/quantum.mk 186include $(TOP_DIR)/quantum/quantum.mk \ No newline at end of file
diff --git a/keyboard/atomic/config.h b/keyboard/atomic/config.h
index f30a9e6cc..1b34decf9 100644
--- a/keyboard/atomic/config.h
+++ b/keyboard/atomic/config.h
@@ -130,7 +130,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
130//#define MAGIC_KEY_LAYER7 7 130//#define MAGIC_KEY_LAYER7 7
131//#define MAGIC_KEY_LAYER8 8 131//#define MAGIC_KEY_LAYER8 8
132//#define MAGIC_KEY_LAYER9 9 132//#define MAGIC_KEY_LAYER9 9
133//#define MAGIC_KEY_BOOTLOADER PAUSE 133#define MAGIC_KEY_BOOTLOADER B
134//#define MAGIC_KEY_LOCK CAPS 134//#define MAGIC_KEY_LOCK CAPS
135//#define MAGIC_KEY_EEPROM E 135//#define MAGIC_KEY_EEPROM E
136//#define MAGIC_KEY_NKRO N 136//#define MAGIC_KEY_NKRO N
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/pc_atomic.c b/keyboard/atomic/keymaps/pvc/keymap.c
index bdf575046..189da16c4 100644
--- a/keyboard/atomic/keymaps/pc_atomic.c
+++ b/keyboard/atomic/keymaps/pvc/keymap.c
@@ -1,9 +1,23 @@
1#include "atomic.h" 1#include "atomic.h"
2#include "action_layer.h"
3
4#ifdef AUDIO_ENABLE
5#include "audio.h"
6#include "musical_notes.h"
7#endif
8
2 9
3#define _QW 0 10#define _QW 0
4#define _LW 1 11#define _LW 1
5#define _RS 2 12#define _RS 2
6#define _FN 3 13#define _AD 3
14#define _FN 4
15
16#define M_QW 0
17#define M_LW 1
18#define M_RS 2
19#define M_FN 3
20
7 21
8#define _______ KC_TRNS 22#define _______ KC_TRNS
9#define ___T___ KC_TRNS 23#define ___T___ KC_TRNS
@@ -29,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 { 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 }, 43 { 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 },
30 { 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 }, 44 { 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 },
31 { 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 }, 45 { 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 },
32 { KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, MO(_RS), KC_SPC, XXXXXXX, MO(_LW), KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, 46 { 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 },
33 }, 47 },
34 [_LW] = { /* LOWERED */ 48 [_LW] = { /* LOWERED */
35 { 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___ }, 49 { 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___ },
@@ -52,24 +66,161 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
52 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, 66 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
53 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, 67 { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
54 }, 68 },
69 [_AD] = { /* ADJUST */
70 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___ },
71 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
72 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
73 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
74 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
75 },
55}; 76};
56 77
57const uint16_t PROGMEM fn_actions[] = { 78#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer)))
58 [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE 79#define IS_LAYER_OFF(layer) (!IS_LAYER_ON(layer))
59 [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER 80
81#ifdef AUDIO_ENABLE
82
83
84
85
86float tone_lw[][2] = {
87Q_NOTE(_C4 ) ,
88Q_NOTE(_CS4 ) ,
89Q_NOTE(_D4 ) ,
90Q_NOTE(_DS4 ) ,
91Q_NOTE(_E4 ) ,
92Q_NOTE(_F4 ) ,
93Q_NOTE(_FS4 ) ,
94Q_NOTE(_G4 ) ,
95Q_NOTE(_GS4 ) ,
96Q_NOTE(_A4 ) ,
97Q_NOTE(_AS4 ) ,
98Q_NOTE(_B4 ) ,
99};
60 100
61 [3] = ACTION_DEFAULT_LAYER_SET(0), 101float tone_rs[][2] = {
62 [4] = ACTION_DEFAULT_LAYER_SET(1), 102 {440.0*pow(2.0,(59)/12.0), 8},
103 {440.0*pow(2.0,(60)/12.0), 8},
104 {0, 4},
105 {440.0*pow(2.0,(67)/12.0), 16},
106 {0, 4},
107 {440.0*pow(2.0,(71)/12.0), 16}
108};
63 109
110float tone_fn[][2] = {
111 {440.0*pow(2.0,(59)/12.0), 8},
112 {440.0*pow(2.0,(60)/12.0), 8},
113 {0, 4},
114 {440.0*pow(2.0,(67)/12.0), 16},
115 {0, 4},
116 {440.0*pow(2.0,(69)/12.0), 16},
117 {0, 4},
118 {440.0*pow(2.0,(67)/12.0), 16}
64}; 119};
120#endif
121
122
123void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3)
124{
125 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
126 {
127 #ifdef AUDIO_ENABLE
128 println("PlayNotes FN");
129 play_notes(&tone_fn, 8, false);
130 #endif
131 layer_on(layer3);
132 }
133 else
134 {
135 layer_off(layer3);
136 }
137}
65 138
66const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 139void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order)
140{
141 if (order)
142 {
143 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
144 {
145 layer_on(layer3);
146 }
147 else
148 {
149 layer_off(layer3);
150 layer_off(layer4);
151 }
152 }
153 else
154 {
155 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
156 {
157 layer_on(layer4);
158 }
159 else
160 {
161 layer_off(layer3);
162 layer_off(layer4);
163 }
164 }
165}
166
167
168const uint16_t PROGMEM fn_actions[] = {
169};
170
171#define ARRAY_SIZE(x) ((sizeof x) / (sizeof *x))
172
173const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
67{ 174{
68 // MACRODOWN only works in this function 175 // MACRODOWN only works in this function
69 switch(id) { 176 switch(id) {
70 case 0: 177 case M_LW:
71 return MACRODOWN(TYPE(KC_T), END); 178 if (record->event.pressed) {
72 break; 179 #ifdef AUDIO_ENABLE
73 } 180 println("PlayNotes LW");
181 print_val_hex32(ARRAY_SIZE(tone_lw));
182 play_notes(&tone_lw, 12, false);
183 #endif
184 layer_on(_LW);
185 update_tri_layer(_LW, _RS, _FN);
186 } else {
187 layer_off(_LW);
188 update_tri_layer(_LW, _RS, _FN);
189 }
190 break;
191 case M_RS:
192 if (record->event.pressed) {
193 #ifdef AUDIO_ENABLE
194 println("PlayNotes RS");
195 play_notes(&tone_rs, 6, false);
196 #endif
197 layer_on(_RS);
198 update_tri_layer(_LW, _RS, _FN);
199 } else {
200 layer_off(_RS);
201 update_tri_layer(_LW, _RS, _FN);
202 }
203 break;
204 default:
205 break;
206 }
74 return MACRO_NONE; 207 return MACRO_NONE;
75}; 208};
209
210#ifdef AUDIO_ENABLE
211float start_up[][2] = {
212 {440.0*pow(2.0,(67)/12.0), 12},
213 {440.0*pow(2.0,(64)/12.0), 8},
214 {440.0*pow(2.0,(55)/12.0), 8},
215 {440.0*pow(2.0,(60)/12.0), 8},
216 {440.0*pow(2.0,(64)/12.0), 20}
217};
218#endif
219
220void matrix_init_user(void) {
221 #ifdef AUDIO_ENABLE
222 init_notes();
223 play_notes(&start_up, 5, false);
224 println("Matrix Init");
225 #endif
226}
diff --git a/keyboard/atomic/keymaps/pvc/makefile.mk b/keyboard/atomic/keymaps/pvc/makefile.mk
new file mode 100644
index 000000000..d46996650
--- /dev/null
+++ b/keyboard/atomic/keymaps/pvc/makefile.mk
@@ -0,0 +1,17 @@
1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = yes # Console for debug(+400)
5COMMAND_ENABLE = yes # Commands for debug and configuration
6NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
7BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
8MIDI_ENABLE = no # MIDI controls
9AUDIO_ENABLE = yes # Audio output on port C6
10UNICODE_ENABLE = no # Unicode
11BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
12RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
13
14# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
15SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
16
17CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index 8d4e7787a..83b8303b0 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -183,4 +183,4 @@ VPATH += $(TARGET_DIR)
183VPATH += $(TOP_DIR) 183VPATH += $(TOP_DIR)
184VPATH += $(TMK_DIR) 184VPATH += $(TMK_DIR)
185 185
186include $(TOP_DIR)/quantum/quantum.mk 186include $(TOP_DIR)/quantum/quantum.mk \ No newline at end of file
diff --git a/keyboard/planck/keymaps/pc.c b/keyboard/planck/keymaps/pvc_planck.c
index ed062609f..20bb5d86d 100644
--- a/keyboard/planck/keymaps/pc.c
+++ b/keyboard/planck/keymaps/pvc_planck.c
@@ -2,6 +2,8 @@
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#include "print.h"
6#include "action_layer.h"
5#ifdef BACKLIGHT_ENABLE 7#ifdef BACKLIGHT_ENABLE
6 #include "backlight.h" 8 #include "backlight.h"
7#endif 9#endif
@@ -38,10 +40,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
38 * `-----------------------------------------------------------------------------------' 40 * `-----------------------------------------------------------------------------------'
39 */ 41 */
40[_QW] = { 42[_QW] = {
41 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, 43 {RESET, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
42 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, 44 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
43 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT }, 45 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT },
44 {KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} 46 {KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, M(_LW), KC_SPC, KC_SPC, M(_RS), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT}
45}, 47},
46 48
47/* Colemak 49/* Colemak
@@ -95,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
95 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, 97 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
96 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, 98 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
97 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, RESET, _______}, 99 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, RESET, _______},
98 {_______, _______, _______, _______, MO(_FN), _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 100 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
99}, 101},
100 102
101/* Lower 103/* Lower
@@ -113,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
113 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, 115 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
114 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, 116 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
115 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, MG_B, _______}, 117 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, MG_B, _______},
116 {_______, _______, _______, _______, _______, _______, _______, MO(_FN), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} 118 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
117}, 119},
118 120
119/* Function 121/* Function
@@ -139,20 +141,53 @@ const uint16_t PROGMEM fn_actions[] = {
139 141
140}; 142};
141 143
144
145int tri_layer = 0;
146void update_tri_layer(int layer) {
147 if (tri_layer > 1) {
148 layer_on(layer);
149 } else {
150 layer_off(layer);
151 }
152}
153
154
142const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 155const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
143{ 156{
144 // MACRODOWN only works in this function 157 // MACRODOWN only works in this function
145 switch(id) { 158 switch(id)
146 case 0: 159 {
147 if (record->event.pressed) { 160 case _RS:
148 register_code(KC_RSFT); 161 if (record->event.pressed) {
149 #ifdef BACKLIGHT_ENABLE 162 print("RS_DN");
150 backlight_step(); 163 layer_on(_RS);
151 #endif 164 tri_layer++;
152 } else { 165 update_tri_layer(_FN);
153 unregister_code(KC_RSFT); 166 } else {
154 } 167 print("RS_UP");
155 break; 168 layer_off(_RS);
156 } 169 tri_layer--;
157 return MACRO_NONE; 170 update_tri_layer(_FN);
171 phex(layer_state);
172 }
173 break;
174
175 case _LW:
176 if (record->event.pressed) {
177 print("LW_DN");
178 layer_on(_LW);
179 tri_layer++;
180 update_tri_layer(_FN);
181 } else {
182 print("LW_UP");
183 layer_off(_LW);
184 tri_layer--;
185 update_tri_layer(_FN);
186 }
187 break;
188
189 default:
190 break;
191 }
192 return MACRO_NONE;
158}; 193};
diff --git a/quantum/musical_notes.h b/quantum/musical_notes.h
new file mode 100644
index 000000000..79f04fd98
--- /dev/null
+++ b/quantum/musical_notes.h
@@ -0,0 +1,182 @@
1#ifndef MUSICAL_NOTES_H
2#define MUSICAL_NOTES_H
3
4// Tempo Placeholder
5#define TEMPO 120
6
7
8// Note Types
9#define WHOLE_NOTE(note) {(NOTE##note), 64}
10#define HALF_NOTE(note) {(NOTE##note), 32}
11#define QUARTER_NOTE(note) {(NOTE##note), 16}
12#define EIGTH_NOTE(note) {(NOTE##note), 8}
13#define SIXTEENTH_NOTE(note) {(NOTE##note), 4}
14
15// Note Types Short
16#define W_NOTE(n) WHOLE_NOTE(n)
17#define H_NOTE(n) HALF_NOTE(n)
18#define Q_NOTE(n) QUARTER_NOTE(n)
19#define E_NOTE(n) EIGTH_NOTE(n)
20#define S_NOTE(n) SIXTEENTH_NOTE(n)
21
22
23// Notes - # = Octave
24#define NOTE_REST 0.00
25#define NOTE_C0 16.35
26#define NOTE_CS0 17.32
27#define NOTE_D0 18.35
28#define NOTE_DS0 19.45
29#define NOTE_E0 20.60
30#define NOTE_F0 21.83
31#define NOTE_FS0 23.12
32#define NOTE_G0 24.50
33#define NOTE_GS0 25.96
34#define NOTE_A0 27.50
35#define NOTE_AS0 29.14
36#define NOTE_B0 30.87
37#define NOTE_C1 32.70
38#define NOTE_CS1 34.65
39#define NOTE_D1 36.71
40#define NOTE_DS1 38.89
41#define NOTE_E1 41.20
42#define NOTE_F1 43.65
43#define NOTE_FS1 46.25
44#define NOTE_G1 49.00
45#define NOTE_GS1 51.91
46#define NOTE_A1 55.00
47#define NOTE_AS1 58.27
48#define NOTE_B1 61.74
49#define NOTE_C2 65.41
50#define NOTE_CS2 69.30
51#define NOTE_D2 73.42
52#define NOTE_DS2 77.78
53#define NOTE_E2 82.41
54#define NOTE_F2 87.31
55#define NOTE_FS2 92.50
56#define NOTE_G2 98.00
57#define NOTE_GS2 103.83
58#define NOTE_A2 110.00
59#define NOTE_AS2 116.54
60#define NOTE_B2 123.47
61#define NOTE_C3 130.81
62#define NOTE_CS3 138.59
63#define NOTE_D3 146.83
64#define NOTE_DS3 155.56
65#define NOTE_E3 164.81
66#define NOTE_F3 174.61
67#define NOTE_FS3 185.00
68#define NOTE_G3 196.00
69#define NOTE_GS3 207.65
70#define NOTE_A3 220.00
71#define NOTE_AS3 233.08
72#define NOTE_B3 246.94
73#define NOTE_C4 261.63
74#define NOTE_CS4 277.18
75#define NOTE_D4 293.66
76#define NOTE_DS4 311.13
77#define NOTE_E4 329.63
78#define NOTE_F4 349.23
79#define NOTE_FS4 369.99
80#define NOTE_G4 392.00
81#define NOTE_GS4 415.30
82#define NOTE_A4 440.00
83#define NOTE_AS4 466.16
84#define NOTE_B4 493.88
85#define NOTE_C5 523.25
86#define NOTE_CS5 554.37
87#define NOTE_D5 587.33
88#define NOTE_DS5 622.25
89#define NOTE_E5 659.26
90#define NOTE_F5 698.46
91#define NOTE_FS5 739.99
92#define NOTE_G5 783.99
93#define NOTE_GS5 830.61
94#define NOTE_A5 880.00
95#define NOTE_AS5 932.33
96#define NOTE_B5 987.77
97#define NOTE_C6 1046.50
98#define NOTE_CS6 1108.73
99#define NOTE_D6 1174.66
100#define NOTE_DS6 1244.51
101#define NOTE_E6 1318.51
102#define NOTE_F6 1396.91
103#define NOTE_FS6 1479.98
104#define NOTE_G6 1567.98
105#define NOTE_GS6 1661.22
106#define NOTE_A6 1760.00
107#define NOTE_AS6 1864.66
108#define NOTE_B6 1975.53
109#define NOTE_C7 2093.00
110#define NOTE_CS7 2217.46
111#define NOTE_D7 2349.32
112#define NOTE_DS7 2489.02
113#define NOTE_E7 2637.02
114#define NOTE_F7 2793.83
115#define NOTE_FS7 2959.96
116#define NOTE_G7 3135.96
117#define NOTE_GS7 3322.44
118#define NOTE_A7 3520.00
119#define NOTE_AS7 3729.31
120#define NOTE_B7 3951.07
121#define NOTE_C8 4186.01
122#define NOTE_CS8 4434.92
123#define NOTE_D8 4698.64
124#define NOTE_DS8 4978.03
125#define NOTE_E8 5274.04
126#define NOTE_F8 5587.65
127#define NOTE_FS8 5919.91
128#define NOTE_G8 6271.93
129#define NOTE_GS8 6644.88
130#define NOTE_A8 7040.00
131#define NOTE_AS8 7458.62
132#define NOTE_B8 7902.13
133
134// Flat Aliases
135#define NOTE_DF0 NOTE_CS0
136#define NOTE_EF0 NOTE_DS0
137#define NOTE_GF0 NOTE_FS0
138#define NOTE_AF0 NOTE_GS0
139#define NOTE_BF0 NOTE_AS0
140#define NOTE_DF1 NOTE_CS1
141#define NOTE_EF1 NOTE_DS1
142#define NOTE_GF1 NOTE_FS1
143#define NOTE_AF1 NOTE_GS1
144#define NOTE_BF1 NOTE_AS1
145#define NOTE_DF2 NOTE_CS2
146#define NOTE_EF2 NOTE_DS2
147#define NOTE_GF2 NOTE_FS2
148#define NOTE_AF2 NOTE_GS2
149#define NOTE_BF2 NOTE_AS2
150#define NOTE_DF3 NOTE_CS3
151#define NOTE_EF3 NOTE_DS3
152#define NOTE_GF3 NOTE_FS3
153#define NOTE_AF3 NOTE_GS3
154#define NOTE_BF3 NOTE_AS3
155#define NOTE_DF4 NOTE_CS4
156#define NOTE_EF4 NOTE_DS4
157#define NOTE_GF4 NOTE_FS4
158#define NOTE_AF4 NOTE_GS4
159#define NOTE_BF4 NOTE_AS4
160#define NOTE_DF5 NOTE_CS5
161#define NOTE_EF5 NOTE_DS5
162#define NOTE_GF5 NOTE_FS5
163#define NOTE_AF5 NOTE_GS5
164#define NOTE_BF5 NOTE_AS5
165#define NOTE_DF6 NOTE_CS6
166#define NOTE_EF6 NOTE_DS6
167#define NOTE_GF6 NOTE_FS6
168#define NOTE_AF6 NOTE_GS6
169#define NOTE_BF6 NOTE_AS6
170#define NOTE_DF7 NOTE_CS7
171#define NOTE_EF7 NOTE_DS7
172#define NOTE_GF7 NOTE_FS7
173#define NOTE_AF7 NOTE_GS7
174#define NOTE_BF7 NOTE_AS7
175#define NOTE_DF8 NOTE_CS8
176#define NOTE_EF8 NOTE_DS8
177#define NOTE_GF8 NOTE_FS8
178#define NOTE_AF8 NOTE_GS8
179#define NOTE_BF8 NOTE_AS8
180
181
182#endif \ No newline at end of file
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h
index 3a4b1e334..025cf5420 100644
--- a/tmk_core/common/action_layer.h
+++ b/tmk_core/common/action_layer.h
@@ -68,6 +68,7 @@ void layer_xor(uint32_t state);
68#define layer_and(state) 68#define layer_and(state)
69#define layer_xor(state) 69#define layer_xor(state)
70#define layer_debug() 70#define layer_debug()
71
71#endif 72#endif
72 73
73/* pressed actions cache */ 74/* pressed actions cache */