From 83e1cc241e3aabd69f6cdcd2581477d4b85bb8d3 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Tue, 3 May 2016 12:56:40 -0500 Subject: Clarified audio.c (#302) * Updated personal layouts * tweaked personal * Nightly - Audio Cleanup Refactored the LUTs. Abstracted some of the registers out of audio to use more functional names. Split audio into audio and audio_pwm. WIP * nightly - collapsed code * Added check for note playing to LEDs --- keyboard/atomic/keymaps/pvc/config.h | 5 ++ keyboard/atomic/keymaps/pvc/keymap.c | 107 ++++++++++++++++---------------- keyboard/planck/keymaps/pvc/config.h | 2 +- keyboard/planck/keymaps/pvc/keymap.c | 4 +- keyboard/planck/keymaps/pvc/makefile.mk | 3 +- 5 files changed, 65 insertions(+), 56 deletions(-) (limited to 'keyboard') diff --git a/keyboard/atomic/keymaps/pvc/config.h b/keyboard/atomic/keymaps/pvc/config.h index cc92634646..034bc5dc5c 100644 --- a/keyboard/atomic/keymaps/pvc/config.h +++ b/keyboard/atomic/keymaps/pvc/config.h @@ -158,4 +158,9 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +//#define VIBRATO_ENABLE +//#define VIBRATO_STRENGTH_ENABLE + + #endif diff --git a/keyboard/atomic/keymaps/pvc/keymap.c b/keyboard/atomic/keymaps/pvc/keymap.c index e17c41e23d..3d604a868e 100644 --- a/keyboard/atomic/keymaps/pvc/keymap.c +++ b/keyboard/atomic/keymaps/pvc/keymap.c @@ -11,8 +11,8 @@ #define LAYER_QWERTY 0 #define LAYER_COLEMAK 1 #define LAYER_DVORAK 2 -#define LAYER_LOWER 3 -#define LAYER_RAISE 4 +#define LAYER_RAISE 3 +#define LAYER_LOWER 4 #define LAYER_FUNCTION 5 #define LAYER_MOUSE 6 #define LAYER_MUSIC 7 @@ -21,8 +21,8 @@ #define MACRO_QWERTY 0 #define MACRO_COLEMAK 1 #define MACRO_DVORAK 2 -#define MACRO_LOWER 3 -#define MACRO_RAISE 4 +#define MACRO_RAISE 3 +#define MACRO_LOWER 4 #define MACRO_FUNCTION 5 #define MACRO_MOUSE 6 #define MACRO_TIMBRE_1 7 @@ -42,8 +42,8 @@ #define M_QWRTY M(MACRO_QWERTY) #define M_COLMK M(MACRO_COLEMAK) #define M_DVORK M(MACRO_DVORAK) -#define M_LOWER M(MACRO_LOWER) #define M_RAISE M(MACRO_RAISE) +#define M_LOWER M(MACRO_LOWER) #define M_FUNCT M(MACRO_FUNCTION) #define M_MOUSE M(MACRO_MOUSE) #define TIMBR_1 M(MACRO_TIMBRE_1) @@ -148,23 +148,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT }, }, + [LAYER_RAISE] = { /* RAISED */ + { KC_TILD, KC_PSCR, KC_PAUS, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS }, + { _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME }, + { _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END }, + { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, [LAYER_LOWER] = { /* 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, ________________ }, - { _______, _______, _______, _______, SC_CCLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME }, - { _______, SC_REDO, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END }, + { _______, KC_F13, KC_F14, KC_F15, KC_F16, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS }, + { _______, KC_F17, KC_F18, KC_F19, KC_F20, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME }, + { _______, KC_F21, KC_F22, KC_F23, KC_F24, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END }, { _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______, _______, _______, _______ }, }, - [LAYER_RAISE] = { /* RAISED */ - { KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ________________ }, - { _______, _______, _______, _______, SC_ACLS, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS }, - { _______, SC_SELA, SC_SAVE, _______, _______, _______, _______, _______, _______, _______, _______, _______, ________________, KC_HOME }, - { _______, SC_UNDO, SC_CUT, SC_COPY, SC_PSTE, _______, _______, _______, _______, _______, _______, ________________, _______, KC_END }, - { _______, _______, _______, _______, _______, ________________, _______, _______, _______, _______, _______, _______, _______, _______ }, - }, - [LAYER_FUNCTION] = { /* 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, ________________ }, { 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 }, @@ -281,28 +280,28 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } break; - case MACRO_LOWER: + case MACRO_RAISE: if (record->event.pressed) { - layer_on(LAYER_LOWER); + layer_on(LAYER_RAISE); update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST); } else { - layer_off(LAYER_LOWER); + layer_off(LAYER_RAISE); update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST); } break; - case MACRO_RAISE: + case MACRO_LOWER: if (record->event.pressed) { - layer_on(LAYER_RAISE); + layer_on(LAYER_LOWER); update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST); } else { - layer_off(LAYER_RAISE); + layer_off(LAYER_LOWER); update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST); } break; @@ -468,36 +467,40 @@ void led_set_user(uint8_t usb_led) _delay_ms(10); // gets rid of tick - if ((usb_led & (1<. */ /* disable debug print */ -//#define NO_DEBUG +#define NO_DEBUG /* disable print */ //#define NO_PRINT diff --git a/keyboard/planck/keymaps/pvc/keymap.c b/keyboard/planck/keymaps/pvc/keymap.c index 27850b2154..830b00a4c4 100644 --- a/keyboard/planck/keymaps/pvc/keymap.c +++ b/keyboard/planck/keymaps/pvc/keymap.c @@ -96,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_QWERTY] = { /* 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_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + { 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_SLSH, KC_ENT }, { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_UP, KC_DOWN, KC_LEFT, KC_RGHT }, }, @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_COLEMAK] = { /* COLEMAK */ { KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_ESC }, - { KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT }, + { KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT }, { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, { KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, KC_SPC, M_LOWER, KC_UP, KC_DOWN, KC_LEFT, KC_RGHT }, }, diff --git a/keyboard/planck/keymaps/pvc/makefile.mk b/keyboard/planck/keymaps/pvc/makefile.mk index 4b9e34c53f..b3f1b9e51c 100644 --- a/keyboard/planck/keymaps/pvc/makefile.mk +++ b/keyboard/planck/keymaps/pvc/makefile.mk @@ -4,6 +4,7 @@ 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 = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode @@ -13,4 +14,4 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with # 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 +CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file -- cgit v1.2.3