From f8a5eaa3fab683f630390c7ca553810db64d15d6 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 24 Jan 2016 01:39:00 -0500 Subject: debugging --- keyboard/planck/Makefile | 8 +++--- keyboard/planck/config.h | 13 ++++----- keyboard/planck/keymaps/lock/keymap.c | 51 +++++++++++++++-------------------- 3 files changed, 32 insertions(+), 40 deletions(-) (limited to 'keyboard/planck') diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index 8414b2ccc0..8c710188cc 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -131,17 +131,17 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # comment out to disable the options. # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# 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 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend # 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 +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # MIDI_ENABLE = YES # MIDI controls -# AUDIO_ENABLE = YES # Audio output on port C6 -# UNICODE_ENABLE = YES # Unicode +AUDIO_ENABLE = YES # Audio output on port C6 +UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID ifdef BACKLIGHT_ENABLE diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index a4c711db82..f51db10871 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h @@ -64,16 +64,17 @@ along with this program. If not, see . */ /* disable debug print */ -#define NO_DEBUG - +// #define NO_DEBUG +#define DEBUG_ACTION + /* disable print */ -#define NO_PRINT +// #define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT +// #define NO_ACTION_TAPPING +#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +#define NO_ACTION_FUNCTION #endif diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c index 9585764629..cad5fc37e3 100644 --- a/keyboard/planck/keymaps/lock/keymap.c +++ b/keyboard/planck/keymaps/lock/keymap.c @@ -5,11 +5,12 @@ #include "backlight.h" #endif #include "action_layer.h" -#include "keymap_midi.h" +// #include "keymap_midi.h" #include "audio.h" #include +#include -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint32_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { /* Qwerty */ {KC_TAB, 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}, @@ -25,27 +26,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [2] = { /* RAISE */ {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_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, UC(0x1028), KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(1), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, [3] = { /* LOWER */ {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, FUNC(3), FUNC(4), RESET, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, + {KC_TRNS, FUNC(3), FUNC(4), RESET, UC(0x1028), KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), S(KC_RBRC), S(KC_BSLS)}, {KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[4] = { /* TENKEY */ - {KC_TAB, N_C5, N_D5, N_E5, N_F5, N_G5, N_A5, KC_KP_7, KC_KP_8, KC_KP_9, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_KP_4, KC_KP_5, KC_KP_6, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_KP_1, KC_KP_2, KC_KP_3, KC_SLSH, KC_ENT}, - {KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_SPC, KC_SPC, KC_KP_0, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[5] = { - { MIDI12 }, - { MIDI12 }, - { MIDI12 }, - {M(0), KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_SPC, KC_SPC, FUNC(1), MIDI, MIDI, MIDI, MIDI} } }; @@ -58,15 +47,15 @@ const uint16_t PROGMEM fn_actions[] = { }; -uint16_t hextokeycode(int hex) { - if (hex == 0x0) { - return KC_0; - } else if (hex < 0xA) { - return KC_1 + (hex - 0x1); - } else { - return KC_A + (hex - 0xA); - } -} +// uint16_t hextokeycode(int hex) { +// if (hex == 0x0) { +// return KC_0; +// } else if (hex < 0xA) { +// return KC_1 + (hex - 0x1); +// } else { +// return KC_A + (hex - 0xA); +// } +// } float walk_up[][2] = { {440.0*pow(2.0,(60)/12.0), 400}, @@ -93,8 +82,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) #ifdef BACKLIGHT_ENABLE backlight_set(BACKLIGHT_LEVELS); #endif - default_layer_and(0); - default_layer_or((1<<5)); + debug_enable = true; + // default_layer_and(0); + // default_layer_or((1<<1)); // uint8_t low = boot_lock_fuse_bits_get(0x0000); // uint8_t high = boot_lock_fuse_bits_get(0x0003); @@ -125,13 +115,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // unregister_code(hextokeycode((lock & 0x0F))); } else { - unregister_code(KC_RSFT); + debug_enable = false; play_notes(&walk_dn, 3, false); + // unregister_code(KC_RSFT); #ifdef BACKLIGHT_ENABLE backlight_set(0); #endif - default_layer_and(0); - default_layer_or(0); + // default_layer_and(0); + // default_layer_or(0); } break; } -- cgit v1.2.3