From 44e4320b2ea508d75f28cb6796f6cf414164564b Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 06:34:56 -0500 Subject: [PATCH 01/13] Nightly --- keyboard/planck/keymaps/pc.c | 71 +++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/keyboard/planck/keymaps/pc.c b/keyboard/planck/keymaps/pc.c index ed062609f4..20bb5d86d7 100644 --- a/keyboard/planck/keymaps/pc.c +++ b/keyboard/planck/keymaps/pc.c @@ -2,6 +2,8 @@ // this is the style you want to emulate. #include "planck.h" +#include "print.h" +#include "action_layer.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif @@ -38,10 +40,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QW] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {RESET, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT }, - {KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, M(_LW), KC_SPC, KC_SPC, M(_RS), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} }, /* Colemak @@ -95,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, RESET, _______}, - {_______, _______, _______, _______, MO(_FN), _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Lower @@ -113,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, MG_B, _______}, - {_______, _______, _______, _______, _______, _______, _______, MO(_FN), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Function @@ -139,20 +141,53 @@ const uint16_t PROGMEM fn_actions[] = { }; + +int tri_layer = 0; +void update_tri_layer(int layer) { + if (tri_layer > 1) { + layer_on(layer); + } else { + layer_off(layer); + } +} + + const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + // MACRODOWN only works in this function + switch(id) + { + case _RS: + if (record->event.pressed) { + print("RS_DN"); + layer_on(_RS); + tri_layer++; + update_tri_layer(_FN); + } else { + print("RS_UP"); + layer_off(_RS); + tri_layer--; + update_tri_layer(_FN); + phex(layer_state); + } + break; + + case _LW: + if (record->event.pressed) { + print("LW_DN"); + layer_on(_LW); + tri_layer++; + update_tri_layer(_FN); + } else { + print("LW_UP"); + layer_off(_LW); + tri_layer--; + update_tri_layer(_FN); + } + break; + + default: + break; + } + return MACRO_NONE; }; From 59e041672ccd35060aba75c7c05561a39c05d742 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 08:20:55 -0500 Subject: [PATCH 02/13] Remapped magic bootloader key to B. --- keyboard/atomic/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/atomic/config.h b/keyboard/atomic/config.h index f30a9e6cc4..1b34decf9c 100644 --- a/keyboard/atomic/config.h +++ b/keyboard/atomic/config.h @@ -130,7 +130,7 @@ along with this program. If not, see . //#define MAGIC_KEY_LAYER7 7 //#define MAGIC_KEY_LAYER8 8 //#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE +#define MAGIC_KEY_BOOTLOADER B //#define MAGIC_KEY_LOCK CAPS //#define MAGIC_KEY_EEPROM E //#define MAGIC_KEY_NKRO N From 4b4d3069b4e71de370f0fea8a949f1ae39bb0993 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 08:50:01 -0500 Subject: [PATCH 03/13] Update and rename pc_atomic.c to pvc_atomic.c Also removed unused FNs --- keyboard/atomic/keymaps/{pc_atomic.c => pvc_atomic.c} | 6 ------ 1 file changed, 6 deletions(-) rename keyboard/atomic/keymaps/{pc_atomic.c => pvc_atomic.c} (96%) diff --git a/keyboard/atomic/keymaps/pc_atomic.c b/keyboard/atomic/keymaps/pvc_atomic.c similarity index 96% rename from keyboard/atomic/keymaps/pc_atomic.c rename to keyboard/atomic/keymaps/pvc_atomic.c index bdf575046b..b18e3a377a 100644 --- a/keyboard/atomic/keymaps/pc_atomic.c +++ b/keyboard/atomic/keymaps/pvc_atomic.c @@ -55,12 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) From 19061f2ff1283f756b162055bac776814caa2d84 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 08:54:22 -0500 Subject: [PATCH 04/13] Update and rename pc_atomic.c to pvc_atomic.c --- keyboard/atomic/keymaps/{pc_atomic.c => pvc_atomic.c} | 6 ------ 1 file changed, 6 deletions(-) rename keyboard/atomic/keymaps/{pc_atomic.c => pvc_atomic.c} (96%) diff --git a/keyboard/atomic/keymaps/pc_atomic.c b/keyboard/atomic/keymaps/pvc_atomic.c similarity index 96% rename from keyboard/atomic/keymaps/pc_atomic.c rename to keyboard/atomic/keymaps/pvc_atomic.c index bdf575046b..b18e3a377a 100644 --- a/keyboard/atomic/keymaps/pc_atomic.c +++ b/keyboard/atomic/keymaps/pvc_atomic.c @@ -55,12 +55,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE - [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER - - [3] = ACTION_DEFAULT_LAYER_SET(0), - [4] = ACTION_DEFAULT_LAYER_SET(1), - }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) From 3d601c1bce23cf31052b9a61818fd1343970499b Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 08:56:27 -0500 Subject: [PATCH 05/13] Rename pc.c to pvc_planck.c --- keyboard/planck/keymaps/{pc.c => pvc_planck.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename keyboard/planck/keymaps/{pc.c => pvc_planck.c} (100%) diff --git a/keyboard/planck/keymaps/pc.c b/keyboard/planck/keymaps/pvc_planck.c similarity index 100% rename from keyboard/planck/keymaps/pc.c rename to keyboard/planck/keymaps/pvc_planck.c From 3dd20f2b6c16ea56bacc5e1581db3fbc1cfc5444 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 11:35:49 -0500 Subject: [PATCH 06/13] Rename pc.c to pvc_planck.c --- keyboard/planck/keymaps/{pc.c => pvc_planck.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename keyboard/planck/keymaps/{pc.c => pvc_planck.c} (100%) diff --git a/keyboard/planck/keymaps/pc.c b/keyboard/planck/keymaps/pvc_planck.c similarity index 100% rename from keyboard/planck/keymaps/pc.c rename to keyboard/planck/keymaps/pvc_planck.c From cf17687f29820b6bf9b8feb3b23dec6e271572c5 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 12:59:16 -0500 Subject: [PATCH 07/13] Adding personal build file settings --- keyboard/atomic/Makefile | 4 ++-- keyboard/planck/Makefile | 4 ++-- keyboard/planck/config.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index 20cf4fff18..f95b2350cd 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -119,8 +119,8 @@ 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 -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality #MIDI_ENABLE = yes # MIDI controls #UNICODE_ENABLE = yes # Unicode #BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index ae637fc295..5271c27957 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -135,8 +135,8 @@ 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 -# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # MIDI_ENABLE = yes # MIDI controls # AUDIO_ENABLE = yes # Audio output on port C6 # UNICODE_ENABLE = yes # Unicode diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index d3719e0cb1..7d64f09773 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -73,10 +73,10 @@ along with this program. If not, see . */ /* disable debug print */ -#define NO_DEBUG +//#define NO_DEBUG /* disable print */ -#define NO_PRINT +//#define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER From f051496f1343259f4da8c5d917b9c9e47b97e38c Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 18:01:29 -0500 Subject: [PATCH 08/13] Checkin --- keyboard/atomic/Makefile | 7 ++ keyboard/atomic/keymaps/pvc_atomic.c | 170 +++++++++++++++++++++++++-- tmk_core/common/action_layer.h | 1 + 3 files changed, 169 insertions(+), 9 deletions(-) diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index f95b2350cd..206b5f119c 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -136,4 +136,11 @@ VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) VPATH += $(TMK_DIR) +debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION +debug-on: all + +debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT +debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) +debug-off: all + include $(TOP_DIR)/quantum/quantum.mk diff --git a/keyboard/atomic/keymaps/pvc_atomic.c b/keyboard/atomic/keymaps/pvc_atomic.c index b18e3a377a..3ddd3e3294 100644 --- a/keyboard/atomic/keymaps/pvc_atomic.c +++ b/keyboard/atomic/keymaps/pvc_atomic.c @@ -1,9 +1,12 @@ #include "atomic.h" +#include "action_layer.h" #define _QW 0 #define _LW 1 #define _RS 2 #define _FN 3 +#define _F1 4 +#define _F2 5 #define _______ KC_TRNS #define ___T___ KC_TRNS @@ -29,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { 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 }, { 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 }, { 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 }, - { 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 }, + { 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 }, }, [_LW] = { /* LOWERED */ { 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,18 +55,167 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, }, + [_F1] = { /* FUNCTION */ + { 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___ }, + { 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 }, + { 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 }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, + { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, + }, + [_F2] = { /* FUNCTION */ + { 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___ }, + { 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 }, + { 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 }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, + { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, + }, }; +#define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) +#define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) + +void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) +{ + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) + { + layer_on(layer3); + } + else + { + layer_off(layer3); + } +} + +void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order) +{ + if (order) + { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) + { + layer_on(layer3); + } + else + { + layer_off(layer3); + layer_off(layer4); + } + } + else + { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) + { + layer_on(layer4); + } + else + { + layer_off(layer3); + layer_off(layer4); + } + } +} + +/* ignore me +void change_quad_layer(uint8_t focus_layer, bool desired_focus_layer_state, uint8_t pair_layer, uint8_t layer3, uint8_t layer4) +{ + + // If desired focus layer state == 1 and current focus layer state == 1 + if ((desired_focus_layer_state) && IS_LAYER_ON(layer1)) + { + // Do Nothing + } + // If desired focus layer state == 0 and current focus layer state == 1 + else if ((desired_focus_layer_state) && IS_LAYER_ON(layer1)) + { + // If + layer_off(layer3); + layer_off(layer4); + } + } + else + { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) + { + layer_on(layer4); + } + else + { + layer_off(layer3); + layer_off(layer4); + } + } +} +*/ + const uint16_t PROGMEM fn_actions[] = { }; -const macro_t *action_get_macro(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 0: - return MACRODOWN(TYPE(KC_T), END); - break; - } - return MACRO_NONE; + + // MACRODOWN only works in this function + switch(id) + { + case _FN: + if (record->event.pressed) { + print("FN_DN\n"); + print_val_bin32(layer_state); + layer_on(_FN); + print_val_bin32(layer_state); + } else { + print("FN_UP\n"); + print_val_bin32(layer_state); + layer_off(_FN); + print_val_bin32(layer_state); + } + break; + + case _RS: + if (record->event.pressed) { + print("RS_DN\n"); + print_val_bin32(layer_state); + layer_on(_RS); + //tri_layer++; + print_val_bin32(layer_state); + //update_tri_layer(_RS, _LW, _FN); + update_quad_layer(_RS, _LW, _F1, _F2, 0); + print_val_bin32(layer_state); + } else { + print("RS_UP\n"); + print_val_bin32(layer_state); + layer_off(_RS); + //tri_layer--; + print_val_bin32(layer_state); + //update_tri_layer(_RS, _LW, _FN); + update_quad_layer(_RS, _LW, _F1, _F2, 0); + print_val_bin32(layer_state); + } + break; + + case _LW: + if (record->event.pressed) { + print("LW_DN\n"); + print_val_bin32(layer_state); + layer_on(_LW); + //tri_layer++; + print_val_bin32(layer_state); + //update_tri_layer(_RS, _LW, _FN); + update_quad_layer(_RS, _LW, _F1, _F2, 1); + print_val_bin32(layer_state); + } else { + print("LW_UP\n"); + print_val_bin32(layer_state); + layer_off(_LW); + //tri_layer--; + print_val_bin32(layer_state); + //update_tri_layer(_RS, _LW, _FN); + update_quad_layer(_RS, _LW, _F1, _F2, 1); + print_val_bin32(layer_state); + } + break; + + default: + break; + } + return MACRO_NONE; }; diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 3a4b1e3349..025cf5420f 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); #define layer_and(state) #define layer_xor(state) #define layer_debug() + #endif /* pressed actions cache */ From 3993afbb2e022f4e6371c729ac6a025f16bc734e Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 22:27:28 -0500 Subject: [PATCH 09/13] adding new per-keymap makefile --- keyboard/atomic/Makefile | 85 +++++++++++++------ keyboard/atomic/keymaps/pvc/makefile.mk | 16 ++++ .../atomic/keymaps/{ => pvc}/pvc_atomic.c | 0 3 files changed, 73 insertions(+), 28 deletions(-) create mode 100644 keyboard/atomic/keymaps/pvc/makefile.mk rename keyboard/atomic/keymaps/{ => pvc}/pvc_atomic.c (100%) diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index 206b5f119c..364efa3fa5 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -27,7 +27,7 @@ # make flip-ee = Download the eeprom file to the device, using Atmel FLIP # (must have Atmel FLIP installed). # -# make debug = Start either simulavr or avarice as specified for debugging, +# make debug = Start either simulavr or avarice as specified for debugging, # with avr-gdb or avr-insight as the front end for debugging. # # make filename.s = Just compile filename.c into the assembler code only. @@ -38,6 +38,27 @@ # To rebuild project do "make clean" then "make all". #---------------------------------------------------------------------------- +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: + # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + # Target file name (without extension). TARGET = atomic @@ -50,14 +71,41 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # # project specific files -SRC = atomic.c \ - backlight.c +SRC = atomic.c + +ifdef keymap + KEYMAP = $(keymap) +endif ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) +ifneq ("$(wildcard keymaps/$(KEYMAP).c)","") + KEYMAP_FILE = keymaps/$(KEYMAP).c else - SRC := keymaps/default.c $(SRC) +ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","") + KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c +ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") + include keymaps/$(KEYMAP)/makefile.mk endif +else +$(error Keymap file does not exist) +endif +endif + +else + +ifneq ("$(wildcard keymaps/default.c)","") + KEYMAP_FILE = keymaps/default.c +else + KEYMAP_FILE = keymaps/default/keymap.c +endif + +ifneq ("$(wildcard keymaps/default/makefile.mk)","") + include keymaps/default/makefile.mk +endif + +endif + +SRC := $(KEYMAP_FILE) $(SRC) CONFIG_H = config.h @@ -111,22 +159,10 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DBOOTLOADER_SIZE=4096 -# Build Options -# comment out to disable the options. -# -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 -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -#MIDI_ENABLE = yes # MIDI controls -#UNICODE_ENABLE = yes # Unicode -#BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +ifeq ($(BACKLIGHT_ENABLE), yes) + SRC += backlight.c +endif -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax @@ -136,11 +172,4 @@ VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) VPATH += $(TMK_DIR) -debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION -debug-on: all - -debug-off: EXTRAFLAGS += -DNO_DEBUG -DNO_PRINT -debug-off: OPT_DEFS := $(filter-out -DCONSOLE_ENABLE,$(OPT_DEFS)) -debug-off: all - -include $(TOP_DIR)/quantum/quantum.mk +include $(TOP_DIR)/quantum/quantum.mk \ No newline at end of file diff --git a/keyboard/atomic/keymaps/pvc/makefile.mk b/keyboard/atomic/keymaps/pvc/makefile.mk new file mode 100644 index 0000000000..ff0a9c338b --- /dev/null +++ b/keyboard/atomic/keymaps/pvc/makefile.mk @@ -0,0 +1,16 @@ +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 = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: + # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboard/atomic/keymaps/pvc_atomic.c b/keyboard/atomic/keymaps/pvc/pvc_atomic.c similarity index 100% rename from keyboard/atomic/keymaps/pvc_atomic.c rename to keyboard/atomic/keymaps/pvc/pvc_atomic.c From 8f85117aa9e060371177e3b523bc89dc7aad19e8 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Fri, 15 Apr 2016 14:42:50 -0500 Subject: [PATCH 10/13] Added Audio to my Atomic --- keyboard/atomic/Makefile | 67 +++--- keyboard/atomic/keymaps/pvc/config.h | 157 +++++++++++++ .../keymaps/pvc/{pvc_atomic.c => keymap.c} | 207 ++++++++---------- keyboard/atomic/keymaps/pvc/makefile.mk | 6 +- keyboard/planck/Makefile | 31 +-- quantum/audio.h | 4 +- 6 files changed, 297 insertions(+), 175 deletions(-) create mode 100644 keyboard/atomic/keymaps/pvc/config.h rename keyboard/atomic/keymaps/pvc/{pvc_atomic.c => keymap.c} (59%) diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index 364efa3fa5..1203cf6a39 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -38,31 +38,9 @@ # To rebuild project do "make clean" then "make all". #---------------------------------------------------------------------------- -# Build Options -# change to "no" to disable the options, or define them in the makefile.mk in -# the appropriate keymap folder that will get included automatically -# -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 -NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: - # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - # Target file name (without extension). TARGET = atomic - # Directory common source filess exist TOP_DIR = ../.. TMK_DIR = ../../tmk_core @@ -73,6 +51,8 @@ TARGET_DIR = . # # project specific files SRC = atomic.c +CONFIG_H = config.h + ifdef keymap KEYMAP = $(keymap) endif @@ -88,7 +68,7 @@ ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") endif else $(error Keymap file does not exist) -endif +endif endif else @@ -107,8 +87,6 @@ endif SRC := $(KEYMAP_FILE) $(SRC) -CONFIG_H = config.h - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -126,7 +104,6 @@ MCU = atmega32u4 # software delays. F_CPU = 16000000 - # # LUFA specific # @@ -158,11 +135,45 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -ifeq ($(BACKLIGHT_ENABLE), yes) - SRC += backlight.c +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +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 + +ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) + SRC := backlight.c $(SRC) +endif # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/keyboard/atomic/keymaps/pvc/config.h b/keyboard/atomic/keymaps/pvc/config.h new file mode 100644 index 0000000000..8449fa06de --- /dev/null +++ b/keyboard/atomic/keymaps/pvc/config.h @@ -0,0 +1,157 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Atomic Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 } +#define ROWS (int []){ D0, D5, B5, B6, B3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +#define MAGIC_KEY_BOOTLOADER B +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/atomic/keymaps/pvc/pvc_atomic.c b/keyboard/atomic/keymaps/pvc/keymap.c similarity index 59% rename from keyboard/atomic/keymaps/pvc/pvc_atomic.c rename to keyboard/atomic/keymaps/pvc/keymap.c index 3ddd3e3294..627f57ff70 100644 --- a/keyboard/atomic/keymaps/pvc/pvc_atomic.c +++ b/keyboard/atomic/keymaps/pvc/keymap.c @@ -1,12 +1,19 @@ #include "atomic.h" #include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif #define _QW 0 #define _LW 1 #define _RS 2 #define _FN 3 -#define _F1 4 -#define _F2 5 + +#define M_QW 0 +#define M_LW 1 +#define M_RS 2 +#define M_FN 3 + #define _______ KC_TRNS #define ___T___ KC_TRNS @@ -32,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { 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 }, { 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 }, { 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 }, - { 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 }, + { 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 }, }, [_LW] = { /* LOWERED */ { 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] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, }, - [_F1] = { /* FUNCTION */ - { 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___ }, - { 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 }, - { 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 }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, - { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, - }, - [_F2] = { /* FUNCTION */ - { 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___ }, - { 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 }, - { 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 }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, - { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, - }, }; #define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) #define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) + +#ifdef AUDIO_ENABLE +float tone_lw[][2] = { + {440.0*pow(2.0,(59)/12.0), 8}, + {440.0*pow(2.0,(60)/12.0), 8}, + {0, 4}, + {440.0*pow(2.0,(67)/12.0), 16} +}; + +float tone_rs[][2] = { + {440.0*pow(2.0,(59)/12.0), 8}, + {440.0*pow(2.0,(60)/12.0), 8}, + {0, 4}, + {440.0*pow(2.0,(67)/12.0), 16}, + {0, 4}, + {440.0*pow(2.0,(71)/12.0), 16} +}; + +float tone_fn[][2] = { + {440.0*pow(2.0,(59)/12.0), 8}, + {440.0*pow(2.0,(60)/12.0), 8}, + {0, 4}, + {440.0*pow(2.0,(67)/12.0), 16}, + {0, 4}, + {440.0*pow(2.0,(69)/12.0), 16}, + {0, 4}, + {440.0*pow(2.0,(67)/12.0), 16} +}; +#endif + + void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef AUDIO_ENABLE + println("PlayNotes FN"); + play_notes(&tone_fn, 8, false); + #endif layer_on(layer3); } else @@ -114,37 +142,6 @@ void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t l } } -/* ignore me -void change_quad_layer(uint8_t focus_layer, bool desired_focus_layer_state, uint8_t pair_layer, uint8_t layer3, uint8_t layer4) -{ - - // If desired focus layer state == 1 and current focus layer state == 1 - if ((desired_focus_layer_state) && IS_LAYER_ON(layer1)) - { - // Do Nothing - } - // If desired focus layer state == 0 and current focus layer state == 1 - else if ((desired_focus_layer_state) && IS_LAYER_ON(layer1)) - { - // If - layer_off(layer3); - layer_off(layer4); - } - } - else - { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) - { - layer_on(layer4); - } - else - { - layer_off(layer3); - layer_off(layer4); - } - } -} -*/ const uint16_t PROGMEM fn_actions[] = { }; @@ -152,70 +149,54 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - // MACRODOWN only works in this function - switch(id) - { - case _FN: - if (record->event.pressed) { - print("FN_DN\n"); - print_val_bin32(layer_state); - layer_on(_FN); - print_val_bin32(layer_state); - } else { - print("FN_UP\n"); - print_val_bin32(layer_state); - layer_off(_FN); - print_val_bin32(layer_state); - } - break; - - case _RS: - if (record->event.pressed) { - print("RS_DN\n"); - print_val_bin32(layer_state); - layer_on(_RS); - //tri_layer++; - print_val_bin32(layer_state); - //update_tri_layer(_RS, _LW, _FN); - update_quad_layer(_RS, _LW, _F1, _F2, 0); - print_val_bin32(layer_state); - } else { - print("RS_UP\n"); - print_val_bin32(layer_state); - layer_off(_RS); - //tri_layer--; - print_val_bin32(layer_state); - //update_tri_layer(_RS, _LW, _FN); - update_quad_layer(_RS, _LW, _F1, _F2, 0); - print_val_bin32(layer_state); - } - break; - - case _LW: - if (record->event.pressed) { - print("LW_DN\n"); - print_val_bin32(layer_state); - layer_on(_LW); - //tri_layer++; - print_val_bin32(layer_state); - //update_tri_layer(_RS, _LW, _FN); - update_quad_layer(_RS, _LW, _F1, _F2, 1); - print_val_bin32(layer_state); - } else { - print("LW_UP\n"); - print_val_bin32(layer_state); - layer_off(_LW); - //tri_layer--; - print_val_bin32(layer_state); - //update_tri_layer(_RS, _LW, _FN); - update_quad_layer(_RS, _LW, _F1, _F2, 1); - print_val_bin32(layer_state); - } - break; - + // MACRODOWN only works in this function + switch(id) { + case M_LW: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + println("PlayNotes LW"); + play_notes(&tone_lw, 4, false); + #endif + layer_on(_LW); + update_tri_layer(_LW, _RS, _FN); + } else { + layer_off(_LW); + update_tri_layer(_LW, _RS, _FN); + } + break; + case M_RS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + println("PlayNotes RS"); + play_notes(&tone_rs, 6, false); + #endif + layer_on(_RS); + update_tri_layer(_LW, _RS, _FN); + } else { + layer_off(_RS); + update_tri_layer(_LW, _RS, _FN); + } + break; default: - break; - } - return MACRO_NONE; + break; + } + return MACRO_NONE; }; + +#ifdef AUDIO_ENABLE +float start_up[][2] = { + {440.0*pow(2.0,(67)/12.0), 12}, + {440.0*pow(2.0,(64)/12.0), 8}, + {440.0*pow(2.0,(55)/12.0), 8}, + {440.0*pow(2.0,(60)/12.0), 8}, + {440.0*pow(2.0,(64)/12.0), 20} +}; +#endif + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + init_notes(); + play_notes(&start_up, 5, false); + println("Matrix Init"); + #endif +} diff --git a/keyboard/atomic/keymaps/pvc/makefile.mk b/keyboard/atomic/keymaps/pvc/makefile.mk index ff0a9c338b..c41102f5d4 100644 --- a/keyboard/atomic/keymaps/pvc/makefile.mk +++ b/keyboard/atomic/keymaps/pvc/makefile.mk @@ -1,16 +1,18 @@ 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 = no # Console for debug(+400) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 +AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index c8517e756f..83b8303b02 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -157,39 +157,10 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifdef KEYMAP -<<<<<<< HEAD -<<<<<<< HEAD -# Build Options -# comment out to disable the options. -# -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 -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = yes # MIDI controls -# AUDIO_ENABLE = yes # Audio output on port C6 -# UNICODE_ENABLE = yes # Unicode -# BLUETOOTH_ENABLE = ye # Enable Bluetooth with the Adafruit EZ-Key HID -# RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend - - -ifdef BACKLIGHT_ENABLE -======= -ifeq ($(BACKLIGHT_ENABLE), yes) ->>>>>>> master - SRC += backlight.c -======= ifeq ("$(wildcard keymaps/$(KEYMAP).c)","") ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","") include keymaps/$(KEYMAP)/makefile.mk endif ->>>>>>> remotes/jackhumbert/new_defaults endif else @@ -212,4 +183,4 @@ VPATH += $(TARGET_DIR) VPATH += $(TOP_DIR) VPATH += $(TMK_DIR) -include $(TOP_DIR)/quantum/quantum.mk +include $(TOP_DIR)/quantum/quantum.mk \ No newline at end of file diff --git a/quantum/audio.h b/quantum/audio.h index 99203cea7a..31f9a35793 100644 --- a/quantum/audio.h +++ b/quantum/audio.h @@ -6,6 +6,6 @@ void play_sample(uint8_t * s, uint16_t l, bool r); void play_note(double freq, int vol); void stop_note(double freq); -void stop_all_notes(); -void init_notes(); +void stop_all_notes(void); +void init_notes(void); void play_notes(float (*np)[][2], uint8_t n_length, bool n_repeat); \ No newline at end of file From 2aa51e4416b65317b16660c0676696974b2dcfc5 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Fri, 15 Apr 2016 16:32:44 -0500 Subject: [PATCH 11/13] Tweaking PVC atomic layout --- keyboard/atomic/Makefile | 30 ++++++++++++------------- keyboard/atomic/keymaps/pvc/keymap.c | 13 +++++++++-- keyboard/atomic/keymaps/pvc/makefile.mk | 27 +++++++++++----------- 3 files changed, 39 insertions(+), 31 deletions(-) diff --git a/keyboard/atomic/Makefile b/keyboard/atomic/Makefile index 1203cf6a39..3f066aebcd 100644 --- a/keyboard/atomic/Makefile +++ b/keyboard/atomic/Makefile @@ -51,8 +51,6 @@ TARGET_DIR = . # # project specific files SRC = atomic.c -CONFIG_H = config.h - ifdef keymap KEYMAP = $(keymap) endif @@ -87,6 +85,8 @@ endif SRC := $(KEYMAP_FILE) $(SRC) +CONFIG_H = config.h + # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -139,21 +139,21 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change to "no" to disable the options, or define them in the makefile.mk in # the appropriate keymap folder that will get included automatically # -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 -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +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 +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. # 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 ifdef KEYMAP diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c index 627f57ff70..7bfd910a17 100644 --- a/keyboard/atomic/keymaps/pvc/keymap.c +++ b/keyboard/atomic/keymaps/pvc/keymap.c @@ -1,13 +1,15 @@ #include "atomic.h" #include "action_layer.h" + #ifdef AUDIO_ENABLE - #include "audio.h" +#include "audio.h" #endif #define _QW 0 #define _LW 1 #define _RS 2 -#define _FN 3 +#define _AD 3 +#define _FN 4 #define M_QW 0 #define M_LW 1 @@ -62,6 +64,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, }, + [_ADJ] = { /* ADJUST */ + { 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___ }, + { 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 }, + { 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 }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, + { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, + }, }; #define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) diff --git a/keyboard/atomic/keymaps/pvc/makefile.mk b/keyboard/atomic/keymaps/pvc/makefile.mk index c41102f5d4..d469966501 100644 --- a/keyboard/atomic/keymaps/pvc/makefile.mk +++ b/keyboard/atomic/keymaps/pvc/makefile.mk @@ -1,18 +1,17 @@ -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 -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: - # https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. # 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 CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file From 9d4bfc1bcf9a93b25ce4f7c32d8f3db12c85c23b Mon Sep 17 00:00:00 2001 From: IBNobody Date: Fri, 15 Apr 2016 22:40:07 -0500 Subject: [PATCH 12/13] Corrected layer macros --- keyboard/atomic/keymaps/pvc/keymap.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c index 7bfd910a17..7abd7f4f7d 100644 --- a/keyboard/atomic/keymaps/pvc/keymap.c +++ b/keyboard/atomic/keymaps/pvc/keymap.c @@ -64,20 +64,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, }, - [_ADJ] = { /* ADJUST */ - { 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___ }, - { 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 }, - { 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 }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D }, - { _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R }, + [_AD] = { /* ADJUST */ + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, }, }; -#define IS_LAYER_ON(layer) ((layer_state) & (1<<(layer))) -#define IS_LAYER_OFF(layer) ((!layer_state) & (1<<(layer))) - +#define IS_LAYER_ON(layer) (layer_state & (1UL << (layer))) +#define IS_LAYER_OFF(layer) (!IS_LAYER_ON(layer)) #ifdef AUDIO_ENABLE + + + + float tone_lw[][2] = { {440.0*pow(2.0,(59)/12.0), 8}, {440.0*pow(2.0,(60)/12.0), 8}, From b5c22ab5b5b77d5e21cc4145831608eed6756ad7 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Sat, 16 Apr 2016 19:27:21 -0500 Subject: [PATCH 13/13] Merging with QMK main to fix audio issues --- keyboard/atomic/keymaps/pvc/keymap.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c index 7abd7f4f7d..189da16c47 100644 --- a/keyboard/atomic/keymaps/pvc/keymap.c +++ b/keyboard/atomic/keymaps/pvc/keymap.c @@ -3,8 +3,10 @@ #ifdef AUDIO_ENABLE #include "audio.h" +#include "musical_notes.h" #endif + #define _QW 0 #define _LW 1 #define _RS 2 @@ -82,10 +84,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { float tone_lw[][2] = { - {440.0*pow(2.0,(59)/12.0), 8}, - {440.0*pow(2.0,(60)/12.0), 8}, - {0, 4}, - {440.0*pow(2.0,(67)/12.0), 16} +Q_NOTE(_C4 ) , +Q_NOTE(_CS4 ) , +Q_NOTE(_D4 ) , +Q_NOTE(_DS4 ) , +Q_NOTE(_E4 ) , +Q_NOTE(_F4 ) , +Q_NOTE(_FS4 ) , +Q_NOTE(_G4 ) , +Q_NOTE(_GS4 ) , +Q_NOTE(_A4 ) , +Q_NOTE(_AS4 ) , +Q_NOTE(_B4 ) , }; float tone_rs[][2] = { @@ -158,6 +168,7 @@ void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t l const uint16_t PROGMEM fn_actions[] = { }; +#define ARRAY_SIZE(x) ((sizeof x) / (sizeof *x)) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -167,7 +178,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { #ifdef AUDIO_ENABLE println("PlayNotes LW"); - play_notes(&tone_lw, 4, false); + print_val_hex32(ARRAY_SIZE(tone_lw)); + play_notes(&tone_lw, 12, false); #endif layer_on(_LW); update_tri_layer(_LW, _RS, _FN);