From b2bc215934ddd31315db4304223750aee3eaf38d Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 13 Nov 2016 00:42:07 -0500 Subject: add sethbc keymap for gh60 and update macro expansion in connection with same --- keyboards/gh60/gh60.h | 32 +++++++------- keyboards/gh60/keymaps/sethbc/Makefile | 3 ++ keyboards/gh60/keymaps/sethbc/keymap.c | 76 ++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 keyboards/gh60/keymaps/sethbc/Makefile create mode 100644 keyboards/gh60/keymaps/sethbc/keymap.c (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/gh60.h b/keyboards/gh60/gh60.h index 82624b614..899f7dc6a 100644 --- a/keyboards/gh60/gh60.h +++ b/keyboards/gh60/gh60.h @@ -4,7 +4,7 @@ #include "quantum.h" #include "led.h" -/* GH60 LEDs +/* GH60 LEDs * GPIO pads * 0 F7 WASD LEDs * 1 F6 ESC LED @@ -49,13 +49,13 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ - K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \ - K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \ -) +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ + { KC_##K30, KC_NO, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_##K3D }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ +} #define KEYMAP_HHKB( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ @@ -63,12 +63,14 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ - K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ -) +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ + { KC_##K30, KC_NO, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ +} + + #endif diff --git a/keyboards/gh60/keymaps/sethbc/Makefile b/keyboards/gh60/keymaps/sethbc/Makefile new file mode 100644 index 000000000..457a3d01d --- /dev/null +++ b/keyboards/gh60/keymaps/sethbc/Makefile @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/gh60/keymaps/sethbc/keymap.c b/keyboards/gh60/keymaps/sethbc/keymap.c new file mode 100644 index 000000000..85a46a29b --- /dev/null +++ b/keyboards/gh60/keymaps/sethbc/keymap.c @@ -0,0 +1,76 @@ +#include "gh60.h" +#include "action_layer.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + KEYMAP_HHKB( + FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ + LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ + LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, FN1, \ + LCTL,LALT,LGUI, SPC, RGUI,RALT,APP, RCTL), + /* 1: fn */ + KEYMAP_HHKB( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP,TRNS,TRNS, \ + TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RIGHT,PENT, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END,PGDN,DOWN,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), + [1] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; + +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); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + +} + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} -- cgit v1.2.3 From 3774a7fcdab5544fc787f4c200be05fcd417e31f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 17 Nov 2016 17:42:14 -0500 Subject: rgb light through midi --- keyboards/amj60/config.h | 2 +- keyboards/clueboard/rev1/config.h | 2 +- keyboards/clueboard/rev2/config.h | 2 +- keyboards/cluecard/config.h | 2 +- keyboards/cluecard/keymaps/rgb_effects/config.h | 2 +- keyboards/cluepad/config.h | 2 +- keyboards/ergodox/keymaps/jack/config.h | 3 +- keyboards/gh60/keymaps/robotmaxtron/config.h | 2 +- keyboards/handwired/minorca/keymaps/rgb/config.h | 2 +- keyboards/jd40/config.h | 2 +- keyboards/kc60/keymaps/ws2812/config.h | 2 +- keyboards/lets_split/config.h | 2 +- keyboards/lets_split/keymaps/i2c/config.h | 2 +- keyboards/lets_split/keymaps/serial/config.h | 2 +- keyboards/phantom/config.h | 2 +- keyboards/planck/keymaps/experimental/config.h | 2 +- keyboards/planck/keymaps/yang/config.h | 2 +- keyboards/preonic/config.h | 2 +- keyboards/preonic/keymaps/kinesis/config.h | 2 +- keyboards/satan/config.h | 2 +- keyboards/tada68/config.h | 2 +- quantum/light_ws2812.c | 2 - quantum/rgblight.c | 10 +-- quantum/rgblight.h | 2 +- readme.md | 4 +- tmk_core/protocol/lufa/lufa.c | 96 ++++++++++++++++++++++++ 26 files changed, 126 insertions(+), 31 deletions(-) (limited to 'keyboards/gh60') diff --git a/keyboards/amj60/config.h b/keyboards/amj60/config.h index d98e0e9f2..7c06f9a6c 100644 --- a/keyboards/amj60/config.h +++ b/keyboards/amj60/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/clueboard/rev1/config.h b/keyboards/clueboard/rev1/config.h index 8c9497232..f40876ffb 100644 --- a/keyboards/clueboard/rev1/config.h +++ b/keyboards/clueboard/rev1/config.h @@ -26,7 +26,7 @@ /* Underlight configuration */ #define RGB_DI_PIN B2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index 15ca4ece8..8435fd02b 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h @@ -30,7 +30,7 @@ /* Underlight configuration */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/cluecard/config.h b/keyboards/cluecard/config.h index 765347b13..6520eb557 100644 --- a/keyboards/cluecard/config.h +++ b/keyboards/cluecard/config.h @@ -140,7 +140,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN E6 -//#define RGBLIGHT_TIMER +//#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 4 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/cluecard/keymaps/rgb_effects/config.h b/keyboards/cluecard/keymaps/rgb_effects/config.h index e88847df4..c6c9342c8 100644 --- a/keyboards/cluecard/keymaps/rgb_effects/config.h +++ b/keyboards/cluecard/keymaps/rgb_effects/config.h @@ -4,7 +4,7 @@ #include "../../config.h" // place overrides here -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 diff --git a/keyboards/cluepad/config.h b/keyboards/cluepad/config.h index bae05fade..bd64dfd27 100644 --- a/keyboards/cluepad/config.h +++ b/keyboards/cluepad/config.h @@ -70,7 +70,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN F6 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 4 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/ergodox/keymaps/jack/config.h b/keyboards/ergodox/keymaps/jack/config.h index 5bf109c18..5c1165226 100644 --- a/keyboards/ergodox/keymaps/jack/config.h +++ b/keyboards/ergodox/keymaps/jack/config.h @@ -5,12 +5,13 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 15 // Number of LEDs #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 255 #define RGBLIGHT_VAL_STEP 12 #define RGB_MIDI +#define RGBW_BB_TWI #endif \ No newline at end of file diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h index 6a29e6b8c..bcd753461 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/config.h +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h @@ -182,7 +182,7 @@ along with this program. If not, see . #define ws2812_pin PF4 */ #define RGB_DI_PIN F4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h index deaac2e26..43b3c5911 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/config.h +++ b/keyboards/handwired/minorca/keymaps/rgb/config.h @@ -11,7 +11,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D5 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 13 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h index e2594f4b3..047be5707 100644 --- a/keyboards/jd40/config.h +++ b/keyboards/jd40/config.h @@ -70,7 +70,7 @@ along with this program. If not, see . ) #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 // Number of LEDs #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/kc60/keymaps/ws2812/config.h b/keyboards/kc60/keymaps/ws2812/config.h index 2f39ea8e5..43abf6228 100644 --- a/keyboards/kc60/keymaps/ws2812/config.h +++ b/keyboards/kc60/keymaps/ws2812/config.h @@ -2,7 +2,7 @@ /* WS2812B RGB Underglow LED */ #define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/lets_split/keymaps/i2c/config.h b/keyboards/lets_split/keymaps/i2c/config.h index 2671fabf6..72e5ae66b 100644 --- a/keyboards/lets_split/keymaps/i2c/config.h +++ b/keyboards/lets_split/keymaps/i2c/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/lets_split/keymaps/serial/config.h b/keyboards/lets_split/keymaps/serial/config.h index f4d900acc..b0ad522fc 100644 --- a/keyboards/lets_split/keymaps/serial/config.h +++ b/keyboards/lets_split/keymaps/serial/config.h @@ -75,7 +75,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index 983a1d73f..71a33498b 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* Underlight configuration */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 20 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index 52acd1905..cc093bee4 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h @@ -9,7 +9,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN B1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/planck/keymaps/yang/config.h b/keyboards/planck/keymaps/yang/config.h index feb5a1190..4ed19d76f 100644 --- a/keyboards/planck/keymaps/yang/config.h +++ b/keyboards/planck/keymaps/yang/config.h @@ -5,7 +5,7 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 3fb978c2f..f88acf211 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h index 086baa84f..e6099ceb8 100644 --- a/keyboards/preonic/keymaps/kinesis/config.h +++ b/keyboards/preonic/keymaps/kinesis/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h index 7e9f91cc8..eb357b39e 100644 --- a/keyboards/satan/config.h +++ b/keyboards/satan/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ #define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/tada68/config.h b/keyboards/tada68/config.h index 5d8757936..19cf9c9b3 100644 --- a/keyboards/tada68/config.h +++ b/keyboards/tada68/config.h @@ -67,7 +67,7 @@ along with this program. If not, see . */ /*#define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 2 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index aac058f53..a883b1388 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c @@ -16,8 +16,6 @@ #include #include "debug.h" -#define RGBW_BB_TWI 1 - #ifdef RGBW_BB_TWI // Port for the I2C diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 1901010bf..6b58f6654 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -174,7 +174,7 @@ void rgblight_init(void) { } eeconfig_debug_rgblight(); // display current eeprom values - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_init(); // setup the timer #endif @@ -221,7 +221,7 @@ void rgblight_mode(uint8_t mode) { eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight mode: %u\n", rgblight_config.mode); if (rgblight_config.mode == 1) { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); #endif } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { @@ -231,7 +231,7 @@ void rgblight_mode(uint8_t mode) { // MODE 15-20, snake // MODE 21-23, knight - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); #endif } @@ -245,7 +245,7 @@ void rgblight_toggle(void) { if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); } else { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_disable(); #endif _delay_ms(50); @@ -371,7 +371,7 @@ void rgblight_set(void) { } } -#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) +#ifdef RGBLIGHT_ANIMATIONS // Animation timer -- AVR Timer3 void rgblight_timer_init(void) { diff --git a/quantum/rgblight.h b/quantum/rgblight.h index d16ba24e5..330c2fe1b 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,7 +1,7 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) +#ifdef RGBLIGHT_ANIMATIONS #define RGBLIGHT_MODES 23 #else #define RGBLIGHT_MODES 1 diff --git a/readme.md b/readme.md index d5a259ccb..2364b5301 100644 --- a/readme.md +++ b/readme.md @@ -1135,12 +1135,12 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring RGBLIGHT_ENABLE = yes -In order to use the underglow timer functions, you need to have `#define RGBLIGHT_TIMER` in your `config.h`, and have audio disabled (`AUDIO_ENABLE = no` in your Makefile). +In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`. Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: #define RGB_DI_PIN F4 // The pin your RGB strip is wired to - #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) + #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio) #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b628cde37..7eb9be601 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -51,6 +51,7 @@ #include "descriptor.h" #include "lufa.h" +#include "quantum.h" #ifdef NKRO_ENABLE #include "keycode_config.h" @@ -1111,9 +1112,104 @@ void cc_callback(MidiDevice * device, #endif } +void send_dword(uint32_t number) { + uint16_t word = (number >> 16); + send_word(word); + send_word(number & 0xFFFFUL); +} + +void send_word(uint16_t number) { + uint8_t byte = number >> 8; + send_byte(byte); + send_byte(number & 0xFF); +} + +void send_byte(uint8_t number) { + uint8_t nibble = number >> 4; + send_nibble(nibble); + send_nibble(number & 0xF); +} + +void send_nibble(uint8_t number) { + switch (number) { + case 0: + register_code(KC_0); + unregister_code(KC_0); + break; + case 1 ... 9: + register_code(KC_1 + (number - 1)); + unregister_code(KC_1 + (number - 1)); + break; + case 0xA ... 0xF: + register_code(KC_A + (number - 0xA)); + unregister_code(KC_A + (number - 0xA)); + break; + } +} + +uint8_t midi_buffer[16] = {0}; + void sysex_callback(MidiDevice * device, uint16_t start, uint8_t length, uint8_t * data) { // for (int i = 0; i < length; i++) // midi_send_cc(device, 15, 0x7F & data[i], 0x7F & (start + i)); + // if (start == 0x27) { + // SEND_STRING("\n"); + // send_word(start); + // SEND_STRING(": "); + for (uint8_t place = 0; place < length; place++) { + // send_byte(*data); + midi_buffer[start + place] = *data; + if (*data == 0xF7) + sysex_buffer_callback(start + place, &midi_buffer); + // SEND_STRING(" "); + data++; + } + // } + +} + +void sysex_buffer_callback(uint8_t length, uint8_t * data) { + uint8_t * pointer_copy = data; + + if (*data++ != 0xF0) + return + data++; + data++; + data++; + data++; + + switch (*data++) { + case 0x27: ; // RGB LED functions + switch (*data++) + case 0x00: ; // Update HSV + uint32_t part1 = *data++; + uint32_t part2 = *data++; + uint32_t part3 = *data++; + uint32_t part4 = *data++; + uint32_t part5 = *data++; + uint32_t chunk = ((part1 & 0x1FUL) << 28) | (part2 << 21) | (part3 << 14) | (part4 << 7) | part5; + // SEND_STRING("\nCHUNK: "); + // send_dword(chunk); + rgblight_sethsv(((chunk >> 16) & 0xFFFF) % 360, (chunk >> 8) & 0xFF, chunk & 0xFF); + // SEND_STRING("\nHUE: "); + // send_word(((chunk >> 16) & 0xFFFF) % 360); + // SEND_STRING("\nSAT: "); + // send_word((chunk >> 8) & 0xFF); + // SEND_STRING("\nVAL: "); + // send_word(chunk & 0xFF); + break; + case 0x01: ; // Update RGB + break; + break; + } + + // SEND_STRING("\nDATA:\n"); + // while (*pointer_copy != 0xF7) { + // send_byte(*pointer_copy++); + // SEND_STRING(" "); + // } + } + #endif -- cgit v1.2.3 From 620e4f74d39bbcd9a41b6deed0fb990dfadbd106 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 19 Nov 2016 11:37:12 -0500 Subject: move KC expansion to separate macros --- keyboards/gh60/gh60.h | 49 ++++++++++++++++++++++++++-- keyboards/gh60/keymaps/default/keymap.c | 12 +++---- keyboards/gh60/keymaps/robotmaxtron/keymap.c | 24 +++++++------- keyboards/gh60/keymaps/sethbc/keymap.c | 4 +-- 4 files changed, 66 insertions(+), 23 deletions(-) (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/gh60.h b/keyboards/gh60/gh60.h index 899f7dc6a..4f206cc16 100644 --- a/keyboards/gh60/gh60.h +++ b/keyboards/gh60/gh60.h @@ -34,6 +34,20 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ +} + +#define KC_KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ ) { \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ @@ -42,13 +56,28 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ } -/* ANSI valiant. No extra keys for ISO */ +/* ANSI variant. No extra keys for ISO */ #define KEYMAP_ANSI( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ K40, K41, K42, K45, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \ +} + +/* ANSI variant with KC expansion */ +#define KC_KEYMAP_ANSI( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K45, K4A, K4B, K4C, K4D \ ) { \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ @@ -57,12 +86,28 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ } +/* HHKB Variant */ #define KEYMAP_HHKB( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ K40, K41, K42, K45, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ +} + +/* HHKB Variant with KC expansion */ +#define KC_KEYMAP_HHKB( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ + K40, K41, K42, K45, K4A, K4B, K4C, K4D \ ) { \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ @@ -71,6 +116,4 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ } - - #endif diff --git a/keyboards/gh60/keymaps/default/keymap.c b/keyboards/gh60/keymaps/default/keymap.c index 3622be41b..5c88b2ecf 100644 --- a/keyboards/gh60/keymaps/default/keymap.c +++ b/keyboards/gh60/keymaps/default/keymap.c @@ -3,21 +3,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - KEYMAP( + KC_KEYMAP( ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \ LSFT,FN1, Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, RSFT, \ LCTL,LGUI,LALT, SPC, BSLS,RALT,RGUI,APP, RCTL), /* 1: fn */ - KEYMAP( + KC_KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), /* 2: arrows */ - KEYMAP( + KC_KEYMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ @@ -49,7 +49,7 @@ void matrix_scan_user(void) { //Layer LED indicators uint32_t layer = layer_state; - + if (layer & (1<<1)) { gh60_wasd_leds_on(); gh60_fn_led_on(); @@ -57,7 +57,7 @@ void matrix_scan_user(void) { gh60_wasd_leds_off(); gh60_fn_led_off(); } - + if (layer & (1<<2)) { gh60_poker_leds_on(); gh60_esc_led_on(); @@ -65,5 +65,5 @@ void matrix_scan_user(void) { gh60_poker_leds_off(); gh60_esc_led_off(); } - + }; diff --git a/keyboards/gh60/keymaps/robotmaxtron/keymap.c b/keyboards/gh60/keymaps/robotmaxtron/keymap.c index 263eec4e5..d53589e81 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/keymap.c +++ b/keyboards/gh60/keymaps/robotmaxtron/keymap.c @@ -8,7 +8,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* - * Base layer, pretty standard ANSI layout. + * Base layer, pretty standard ANSI layout. * ,-----------------------------------------------------------. * |FN12| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | * |-----------------------------------------------------------| @@ -21,14 +21,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Fn |Menu|Ctrl| * `-----------------------------------------------------------' */ - [_BL] = KEYMAP( + [_BL] = KC_KEYMAP( FN12,1,2,3,4,5,6,7,8,9,0,MINS,EQL,BSPC, \ TAB,Q,W,E,R,T,Y,U,I,O,P,LBRC,RBRC,BSLS, \ FN2,A,S,D,F,G,H,J,K,L,SCLN,QUOT,NO,ENT, \ LSFT,NO,Z,X,C,V,B,N,M,COMM,DOT,SLSH,NO,RSFT, \ LCTL,LGUI,LALT, SPC, NO,RALT,FN0,APP, RCTL), - - /* + + /* * Locking arrow keys to WASD for when you need dedicated arrow keys * ,-----------------------------------------------------------. * | | | | | | | | | | | | | | | @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [_AL] = KEYMAP( + [_AL] = KC_KEYMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,UP,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), - /* + /* * Primary function layer, mostly the same as the traditional Pok3r layout. * ,-------------------------------------------------------------. * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL | @@ -64,16 +64,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-------------------------------------------------------------' */ - [_FL] = KEYMAP( + [_FL] = KC_KEYMAP( GRAVE,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12, DELETE, \ TRNS,FN1,TRNS,TRNS,TRNS,TRNS,CALC,PGUP,UP,PGDN,PSCR,SLCK,PAUS,TRNS, \ TRNS,MUTE,_VOLDOWN,_VOLUP,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,INS,TRNS,TRNS,TRNS, \ TRNS,TRNS,FN3,TRNS,TRNS,TRNS,TRNS,END,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), - - /* + + /* * Locking layer for controlling the underglow. - * + * * ,-----------------------------------------------------------. * | | | | | | | | | | | | | | | * |-----------------------------------------------------------| @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [_UL] = KEYMAP( + [_UL] = KC_KEYMAP( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ TRNS,FN4,FN5,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ @@ -124,7 +124,7 @@ 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 + // MACRODOWN only works in this function switch(id) { case 0: if (record->event.pressed) { diff --git a/keyboards/gh60/keymaps/sethbc/keymap.c b/keyboards/gh60/keymaps/sethbc/keymap.c index 85a46a29b..141c7f0b0 100644 --- a/keyboards/gh60/keymaps/sethbc/keymap.c +++ b/keyboards/gh60/keymaps/sethbc/keymap.c @@ -6,14 +6,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - KEYMAP_HHKB( + KC_KEYMAP_HHKB( FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, FN1, \ LCTL,LALT,LGUI, SPC, RGUI,RALT,APP, RCTL), /* 1: fn */ - KEYMAP_HHKB( + KC_KEYMAP_HHKB( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP,TRNS,TRNS, \ TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RIGHT,PENT, \ -- cgit v1.2.3 From df8724ce08e09b6b077b601da7976639140655d7 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 19 Nov 2016 12:19:21 -0500 Subject: remove KC expansion from GH60 --- keyboards/gh60/gh60.h | 44 ------------------------ keyboards/gh60/keymaps/default/keymap.c | 36 ++++++++++---------- keyboards/gh60/keymaps/robotmaxtron/keymap.c | 50 ++++++++++++++-------------- keyboards/gh60/keymaps/sethbc/keymap.c | 24 ++++++------- 4 files changed, 55 insertions(+), 99 deletions(-) (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/gh60.h b/keyboards/gh60/gh60.h index 4f206cc16..66bc2790d 100644 --- a/keyboards/gh60/gh60.h +++ b/keyboards/gh60/gh60.h @@ -42,20 +42,6 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ } -#define KC_KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ -} - /* ANSI variant. No extra keys for ISO */ #define KEYMAP_ANSI( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ @@ -71,21 +57,6 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \ } -/* ANSI variant with KC expansion */ -#define KC_KEYMAP_ANSI( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ - { KC_##K30, KC_NO, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ -} - /* HHKB Variant */ #define KEYMAP_HHKB( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ @@ -101,19 +72,4 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ } -/* HHKB Variant with KC expansion */ -#define KC_KEYMAP_HHKB( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \ - { KC_##K30, KC_NO, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ -} - #endif diff --git a/keyboards/gh60/keymaps/default/keymap.c b/keyboards/gh60/keymaps/default/keymap.c index 5c88b2ecf..92f545984 100644 --- a/keyboards/gh60/keymaps/default/keymap.c +++ b/keyboards/gh60/keymaps/default/keymap.c @@ -3,26 +3,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - KC_KEYMAP( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \ - LSFT,FN1, Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, RSFT, \ - LCTL,LGUI,LALT, SPC, BSLS,RALT,RGUI,APP, RCTL), + KEYMAP( + KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_GRV,\ + 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_BSPC,\ + 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_NO,KC_ENT,\ + KC_LSFT,F(1),KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,F(0),KC_RSFT,\ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_BSLS,KC_RALT,KC_RGUI,KC_APP,KC_RCTL), /* 1: fn */ - KC_KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + KEYMAP( + KC_ESC,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_TRNS,\ + KC_TRNS,KC_TRNS,KC_UP,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_LEFT,KC_DOWN,KC_RGHT,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,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,KC_TRNS), /* 2: arrows */ - KC_KEYMAP( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,LEFT,DOWN,RGHT), + KEYMAP( + 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,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,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,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,\ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/gh60/keymaps/robotmaxtron/keymap.c b/keyboards/gh60/keymaps/robotmaxtron/keymap.c index d53589e81..9acac7cec 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/keymap.c +++ b/keyboards/gh60/keymaps/robotmaxtron/keymap.c @@ -10,7 +10,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* * Base layer, pretty standard ANSI layout. * ,-----------------------------------------------------------. - * |FN12| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |F(12)| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | * |-----------------------------------------------------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| * |-----------------------------------------------------------| @@ -21,12 +21,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Fn |Menu|Ctrl| * `-----------------------------------------------------------' */ - [_BL] = KC_KEYMAP( - FN12,1,2,3,4,5,6,7,8,9,0,MINS,EQL,BSPC, \ - TAB,Q,W,E,R,T,Y,U,I,O,P,LBRC,RBRC,BSLS, \ - FN2,A,S,D,F,G,H,J,K,L,SCLN,QUOT,NO,ENT, \ - LSFT,NO,Z,X,C,V,B,N,M,COMM,DOT,SLSH,NO,RSFT, \ - LCTL,LGUI,LALT, SPC, NO,RALT,FN0,APP, RCTL), + [_BL] = KEYMAP( + F(12),KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSPC, \ + 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, \ + F(2),KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_NO,KC_ENT, \ + KC_LSFT,KC_NO,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_NO,KC_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_NO,KC_RALT,F(0),KC_APP,KC_RCTL), /* * Locking arrow keys to WASD for when you need dedicated arrow keys @@ -42,12 +42,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [_AL] = KC_KEYMAP( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,UP,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + [_AL] = KEYMAP( + 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,KC_UP,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_LEFT,KC_DOWN,KC_RGHT,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,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,KC_TRNS), /* @@ -64,12 +64,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-------------------------------------------------------------' */ - [_FL] = KC_KEYMAP( - GRAVE,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12, DELETE, \ - TRNS,FN1,TRNS,TRNS,TRNS,TRNS,CALC,PGUP,UP,PGDN,PSCR,SLCK,PAUS,TRNS, \ - TRNS,MUTE,_VOLDOWN,_VOLUP,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,INS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,FN3,TRNS,TRNS,TRNS,TRNS,END,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + [_FL] = KEYMAP( + KC_GRAVE,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_DELETE, \ + KC_TRNS,F(1),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_CALC,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_SLCK,KC_PAUS,KC_TRNS, \ + KC_TRNS,KC_MUTE,KC__VOLDOWN,KC__VOLUP,KC_TRNS,KC_TRNS,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,F(3),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_END,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), /* * Locking layer for controlling the underglow. @@ -86,12 +86,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [_UL] = KC_KEYMAP( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,FN4,FN5,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,FN6,FN7,FN8,FN9,FN10,FN11,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + [_UL] = KEYMAP( + 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,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,F(4),F(5),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,F(6),F(7),F(8),F(9),F(10),F(11),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), }; enum function_id { diff --git a/keyboards/gh60/keymaps/sethbc/keymap.c b/keyboards/gh60/keymaps/sethbc/keymap.c index 141c7f0b0..599e664e2 100644 --- a/keyboards/gh60/keymaps/sethbc/keymap.c +++ b/keyboards/gh60/keymaps/sethbc/keymap.c @@ -6,19 +6,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - KC_KEYMAP_HHKB( - FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ - LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, FN1, \ - LCTL,LALT,LGUI, SPC, RGUI,RALT,APP, RCTL), + KEYMAP_HHKB( + F(0),KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSLS,KC_GRV,\ + 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_BSPC,\ + KC_LCTL,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_ENT,\ + KC_LSFT,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,F(1),\ + KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,KC_RALT,KC_APP,KC_RCTL), /* 1: fn */ - KC_KEYMAP_HHKB( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP,TRNS,TRNS, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RIGHT,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END,PGDN,DOWN,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), + KEYMAP_HHKB( + 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,KC_TRNS,KC_TRNS,\ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,\ + KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RIGHT,KC_PENT,\ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END,KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS,\ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), }; enum function_id { -- cgit v1.2.3 From b7696fb3b0a38bd795cbda6d7629711c3564620c Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 20 Dec 2016 18:43:06 +0100 Subject: - Updated gh60 files --- keyboards/gh60/gh60.h | 2 +- keyboards/gh60/keymaps/dbroqua_hhkb/Makefile | 112 ++++++++++++++++++++++++ keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c | 124 +++++++++++++++++++++++++++ 3 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 keyboards/gh60/keymaps/dbroqua_hhkb/Makefile create mode 100644 keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/gh60.h b/keyboards/gh60/gh60.h index 66bc2790d..99ccf1757 100644 --- a/keyboards/gh60/gh60.h +++ b/keyboards/gh60/gh60.h @@ -72,4 +72,4 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D } \ } -#endif +#endif \ No newline at end of file diff --git a/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile b/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile new file mode 100644 index 000000000..b9bbb669d --- /dev/null +++ b/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile @@ -0,0 +1,112 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# 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, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +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 +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# 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 +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID +# RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + diff --git a/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c b/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c new file mode 100644 index 000000000..0c2e980d2 --- /dev/null +++ b/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c @@ -0,0 +1,124 @@ +#include "gh60.h" +#include "action_layer.h" + +#define _DEFAULT 0 +#define _FN 1 +#define _WASD 2 + +//bool esc_led_on; + +enum planck_keycodes { + DEFAULT = SAFE_RANGE +}; + +// Fillers to make layering more clear +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty gui/alt/space/alt/gui + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN | + * |-----------------------------------------------------------------------------------------+ + * |LGUI | LAlt | Space | RAlt |RGUI | + * `-----------------------------------------------------------------' + */ + [_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \ + ______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \ + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------+ + * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | | + * |-----------------------------------------------------------------------------------------+ + * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | + * |-----------------------------------------------------------------------------------------+ + * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | | + * |-----------------------------------------------------------------------------------------+ + * | | | | Stop | | + * `-----------------------------------------------------------------' + */ + [_FN] = KEYMAP_HHKB( /* Layer 1 */ + ______, 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_INS, KC_DEL, \ + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ + ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \ + ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \ + ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | Up | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | Left| Down|Right| | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `-----------------------------------------------------------------' + */ + [_WASD] = KEYMAP_HHKB( /* Layer 1 */ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + return MACRO_NONE; +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay +}; + +//bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// switch (keycode) { +// case ESC_LED: +// if (record->event.pressed) { +// if (esc_led_on == true ){ +// gh60_esc_led_off(); +// }else{ +// gh60_esc_led_on(); +// } +// esc_led_on = !esc_led_on; +// } +// return false; +// break; +// } +// return true; +//} + +void matrix_scan_user(void) { + uint32_t layer = layer_state; + + if (layer & (1<<1)) { + gh60_fn_led_on(); + } else { + gh60_fn_led_off(); + } + + if (layer & (1<<2)) { + gh60_wasd_leds_on(); + } else { + gh60_wasd_leds_off(); + } +}; \ No newline at end of file -- cgit v1.2.3 From 5ee136a36f6fd8cb697f97baf0d72192615b857d Mon Sep 17 00:00:00 2001 From: dbroqua Date: Wed, 21 Dec 2016 23:12:33 +0100 Subject: - Renamed dbroqua_hhkb as dbroqua for gh60 layout --- keyboards/gh60/keymaps/dbroqua/Makefile | 112 ++++++++++++++++++++++++ keyboards/gh60/keymaps/dbroqua/keymap.c | 124 +++++++++++++++++++++++++++ keyboards/gh60/keymaps/dbroqua_hhkb/Makefile | 112 ------------------------ keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c | 124 --------------------------- 4 files changed, 236 insertions(+), 236 deletions(-) create mode 100644 keyboards/gh60/keymaps/dbroqua/Makefile create mode 100644 keyboards/gh60/keymaps/dbroqua/keymap.c delete mode 100644 keyboards/gh60/keymaps/dbroqua_hhkb/Makefile delete mode 100644 keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/keymaps/dbroqua/Makefile b/keyboards/gh60/keymaps/dbroqua/Makefile new file mode 100644 index 000000000..b9bbb669d --- /dev/null +++ b/keyboards/gh60/keymaps/dbroqua/Makefile @@ -0,0 +1,112 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# 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, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +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 +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# 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 +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID +# RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + diff --git a/keyboards/gh60/keymaps/dbroqua/keymap.c b/keyboards/gh60/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000..0c2e980d2 --- /dev/null +++ b/keyboards/gh60/keymaps/dbroqua/keymap.c @@ -0,0 +1,124 @@ +#include "gh60.h" +#include "action_layer.h" + +#define _DEFAULT 0 +#define _FN 1 +#define _WASD 2 + +//bool esc_led_on; + +enum planck_keycodes { + DEFAULT = SAFE_RANGE +}; + +// Fillers to make layering more clear +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty gui/alt/space/alt/gui + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN | + * |-----------------------------------------------------------------------------------------+ + * |LGUI | LAlt | Space | RAlt |RGUI | + * `-----------------------------------------------------------------' + */ + [_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \ + ______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \ + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------+ + * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | | + * |-----------------------------------------------------------------------------------------+ + * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | + * |-----------------------------------------------------------------------------------------+ + * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | | + * |-----------------------------------------------------------------------------------------+ + * | | | | Stop | | + * `-----------------------------------------------------------------' + */ + [_FN] = KEYMAP_HHKB( /* Layer 1 */ + ______, 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_INS, KC_DEL, \ + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ + ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \ + ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \ + ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | Up | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | Left| Down|Right| | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `-----------------------------------------------------------------' + */ + [_WASD] = KEYMAP_HHKB( /* Layer 1 */ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + return MACRO_NONE; +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay +}; + +//bool process_record_user(uint16_t keycode, keyrecord_t *record) { +// switch (keycode) { +// case ESC_LED: +// if (record->event.pressed) { +// if (esc_led_on == true ){ +// gh60_esc_led_off(); +// }else{ +// gh60_esc_led_on(); +// } +// esc_led_on = !esc_led_on; +// } +// return false; +// break; +// } +// return true; +//} + +void matrix_scan_user(void) { + uint32_t layer = layer_state; + + if (layer & (1<<1)) { + gh60_fn_led_on(); + } else { + gh60_fn_led_off(); + } + + if (layer & (1<<2)) { + gh60_wasd_leds_on(); + } else { + gh60_wasd_leds_off(); + } +}; \ No newline at end of file diff --git a/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile b/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile deleted file mode 100644 index b9bbb669d..000000000 --- a/keyboards/gh60/keymaps/dbroqua_hhkb/Makefile +++ /dev/null @@ -1,112 +0,0 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# 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, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -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 -KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key -# 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 -# MIDI_ENABLE ?= YES # MIDI controls -# UNICODE_ENABLE ?= YES # Unicode -# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID -# RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - diff --git a/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c b/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c deleted file mode 100644 index 0c2e980d2..000000000 --- a/keyboards/gh60/keymaps/dbroqua_hhkb/keymap.c +++ /dev/null @@ -1,124 +0,0 @@ -#include "gh60.h" -#include "action_layer.h" - -#define _DEFAULT 0 -#define _FN 1 -#define _WASD 2 - -//bool esc_led_on; - -enum planck_keycodes { - DEFAULT = SAFE_RANGE -}; - -// Fillers to make layering more clear -#define ______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty gui/alt/space/alt/gui - * ,-----------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | - * |-----------------------------------------------------------------------------------------+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | - * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN | - * |-----------------------------------------------------------------------------------------+ - * |LGUI | LAlt | Space | RAlt |RGUI | - * `-----------------------------------------------------------------' - */ - [_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ - 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_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \ - ______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \ - ), - -/* FN Layer - * ,-----------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | - * |-----------------------------------------------------------------------------------------+ - * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | | - * |-----------------------------------------------------------------------------------------+ - * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | - * |-----------------------------------------------------------------------------------------+ - * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | | - * |-----------------------------------------------------------------------------------------+ - * | | | | Stop | | - * `-----------------------------------------------------------------' - */ - [_FN] = KEYMAP_HHKB( /* Layer 1 */ - ______, 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_INS, KC_DEL, \ - KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ - ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \ - ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \ - ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ - ), - -/* FN Layer - * ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | Up | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | Left| Down|Right| | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | - * `-----------------------------------------------------------------' - */ - [_WASD] = KEYMAP_HHKB( /* Layer 1 */ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ - ______, ______, ______, ______, ______, ______, ______, ______ \ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay -}; - -//bool process_record_user(uint16_t keycode, keyrecord_t *record) { -// switch (keycode) { -// case ESC_LED: -// if (record->event.pressed) { -// if (esc_led_on == true ){ -// gh60_esc_led_off(); -// }else{ -// gh60_esc_led_on(); -// } -// esc_led_on = !esc_led_on; -// } -// return false; -// break; -// } -// return true; -//} - -void matrix_scan_user(void) { - uint32_t layer = layer_state; - - if (layer & (1<<1)) { - gh60_fn_led_on(); - } else { - gh60_fn_led_off(); - } - - if (layer & (1<<2)) { - gh60_wasd_leds_on(); - } else { - gh60_wasd_leds_off(); - } -}; \ No newline at end of file -- cgit v1.2.3 From 46ff5f3b9007e9fd4714ed7e34c7a8b77cf052ae Mon Sep 17 00:00:00 2001 From: dbroqua Date: Thu, 22 Dec 2016 08:26:55 +0100 Subject: - Fixed bad typo in dbroqua layout for gh60 - Removed unused function in dbroqua layout for gh60 --- keyboards/gh60/keymaps/dbroqua/keymap.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/keymaps/dbroqua/keymap.c b/keyboards/gh60/keymaps/dbroqua/keymap.c index 0c2e980d2..3c16baa22 100644 --- a/keyboards/gh60/keymaps/dbroqua/keymap.c +++ b/keyboards/gh60/keymaps/dbroqua/keymap.c @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ ), -/* FN Layer +/* WASD Layer * ,-----------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `-----------------------------------------------------------------' */ - [_WASD] = KEYMAP_HHKB( /* Layer 1 */ + [_WASD] = KEYMAP_HHKB( /* Layer 2 */ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ @@ -90,23 +90,6 @@ const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay }; -//bool process_record_user(uint16_t keycode, keyrecord_t *record) { -// switch (keycode) { -// case ESC_LED: -// if (record->event.pressed) { -// if (esc_led_on == true ){ -// gh60_esc_led_off(); -// }else{ -// gh60_esc_led_on(); -// } -// esc_led_on = !esc_led_on; -// } -// return false; -// break; -// } -// return true; -//} - void matrix_scan_user(void) { uint32_t layer = layer_state; -- cgit v1.2.3 From 033f0b92c4c5f6fbad08bacc87f2cf6776949f90 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Sat, 24 Dec 2016 14:43:07 +0100 Subject: - Added RGB layer on dbroqua GH60 layout --- keyboards/gh60/keymaps/dbroqua/Makefile | 2 +- keyboards/gh60/keymaps/dbroqua/config.h | 187 ++++++++++++++++++++++++++++++++ keyboards/gh60/keymaps/dbroqua/keymap.c | 109 +++++++++++++++++-- 3 files changed, 288 insertions(+), 10 deletions(-) create mode 100644 keyboards/gh60/keymaps/dbroqua/config.h (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/keymaps/dbroqua/Makefile b/keyboards/gh60/keymaps/dbroqua/Makefile index b9bbb669d..f1644a8e4 100644 --- a/keyboards/gh60/keymaps/dbroqua/Makefile +++ b/keyboards/gh60/keymaps/dbroqua/Makefile @@ -104,7 +104,7 @@ NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: ht # MIDI_ENABLE ?= YES # MIDI controls # UNICODE_ENABLE ?= YES # Unicode # BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID -# RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow +RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/gh60/keymaps/dbroqua/config.h b/keyboards/gh60/keymaps/dbroqua/config.h new file mode 100644 index 000000000..75ccec097 --- /dev/null +++ b/keyboards/gh60/keymaps/dbroqua/config.h @@ -0,0 +1,187 @@ +/* +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 geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * 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 MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 PAUSE +//#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 + +/* + * RGB Underglow + * These settings are for the F4 by default: + * + * + * #define ws2812_PORTREG PORTF + * #define ws2812_DDRREG DDRF + * #define ws2812_pin PF4 + * #define RGBLED_NUM 14 // Number of LEDs + * #define RGBLIGHT_HUE_STEP 10 + * #define RGBLIGHT_SAT_STEP 17 + * #define RGBLIGHT_VAL_STEP 17 + * + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c +*/ + +/* Deprecated code below +#define ws2812_PORTREG PORTF +#define ws2812_DDRREG DDRF +#define ws2812_pin PF4 +*/ +#define RGB_DI_PIN F4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 11 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/gh60/keymaps/dbroqua/keymap.c b/keyboards/gh60/keymaps/dbroqua/keymap.c index 3c16baa22..be88edc09 100644 --- a/keyboards/gh60/keymaps/dbroqua/keymap.c +++ b/keyboards/gh60/keymaps/dbroqua/keymap.c @@ -1,9 +1,11 @@ #include "gh60.h" #include "action_layer.h" +#include "rgblight.h" #define _DEFAULT 0 #define _FN 1 #define _WASD 2 +#define _SFX 3 //bool esc_led_on; @@ -50,11 +52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------' */ [_FN] = KEYMAP_HHKB( /* Layer 1 */ - ______, 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_INS, KC_DEL, \ + TG(_SFX),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_INS, KC_DEL, \ KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \ ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \ - ______, ______, ______, KC_FN1, KC_MSTP, ______, ______, ______ \ + ______, ______, ______, TG(_WASD), KC_MSTP, ______, ______, ______ \ ), /* WASD Layer @@ -71,11 +73,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------' */ [_WASD] = KEYMAP_HHKB( /* Layer 2 */ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ - ______, ______, ______, ______, ______, ______, ______, ______ \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, KC_LEFT, KC_DOWN,KC_RGHT,______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ + ), + +/* SFX Layer + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL- | BL+ | BL | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | RGBT| RGBM| | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `-----------------------------------------------------------------' + */ + [_SFX] = KEYMAP_HHKB( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ ) }; @@ -85,11 +108,73 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +enum function_id { + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL +}; + const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // toggle wasd overlay + [0] = ACTION_FUNCTION(RGBLED_TOGGLE), + [1] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL) }; +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + } +} + void matrix_scan_user(void) { uint32_t layer = layer_state; @@ -104,4 +189,10 @@ void matrix_scan_user(void) { } else { gh60_wasd_leds_off(); } + + if (layer & (1<<3)) { + gh60_esc_led_on(); + } else { + gh60_esc_led_off(); + } }; \ No newline at end of file -- cgit v1.2.3 From a8a49276220ab6b91b0d8e40282c2ae5cb87444e Mon Sep 17 00:00:00 2001 From: Eric Dodd Date: Wed, 1 Mar 2017 21:39:19 -0500 Subject: gh60 spacefn --- keyboards/gh60/keymaps/unxmaal/Makefile | 112 +++++++++++ keyboards/gh60/keymaps/unxmaal/README.md | 20 ++ keyboards/gh60/keymaps/unxmaal/WS2812-wiring.jpg | Bin 0 -> 1038926 bytes keyboards/gh60/keymaps/unxmaal/config.h | 190 +++++++++++++++++++ keyboards/gh60/keymaps/unxmaal/keymap.c | 228 +++++++++++++++++++++++ 5 files changed, 550 insertions(+) create mode 100644 keyboards/gh60/keymaps/unxmaal/Makefile create mode 100644 keyboards/gh60/keymaps/unxmaal/README.md create mode 100644 keyboards/gh60/keymaps/unxmaal/WS2812-wiring.jpg create mode 100644 keyboards/gh60/keymaps/unxmaal/config.h create mode 100644 keyboards/gh60/keymaps/unxmaal/keymap.c (limited to 'keyboards/gh60') diff --git a/keyboards/gh60/keymaps/unxmaal/Makefile b/keyboards/gh60/keymaps/unxmaal/Makefile new file mode 100644 index 000000000..c73cf1141 --- /dev/null +++ b/keyboards/gh60/keymaps/unxmaal/Makefile @@ -0,0 +1,112 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# 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, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +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 +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# 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 +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + diff --git a/keyboards/gh60/keymaps/unxmaal/README.md b/keyboards/gh60/keymaps/unxmaal/README.md new file mode 100644 index 000000000..52bf97ef4 --- /dev/null +++ b/keyboards/gh60/keymaps/unxmaal/README.md @@ -0,0 +1,20 @@ +Unxmaal's GH60 Layout +===================== +* Mostly stolen from /u/robotmaxtron + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +* Standard Mac ANSI layout +* Spacebar acts as space when tapped, Fn when held +* Menu acts as menu when tapped, Fn2 when held +* Layer1: + * Top row = `~, F1-F12, Del + * JKIL = arrow cluster +* Layer2: + * Top row = media controls + * JKIL = PgDn/Up/Home/Insert + * Backspace = Reset + +### Additional Credits +Keymap has been based on various keymaps available from the QMK Repo for the GH60-SATAN and KC60 keyboards. diff --git a/keyboards/gh60/keymaps/unxmaal/WS2812-wiring.jpg b/keyboards/gh60/keymaps/unxmaal/WS2812-wiring.jpg new file mode 100644 index 000000000..4ab8cc31a Binary files /dev/null and b/keyboards/gh60/keymaps/unxmaal/WS2812-wiring.jpg differ diff --git a/keyboards/gh60/keymaps/unxmaal/config.h b/keyboards/gh60/keymaps/unxmaal/config.h new file mode 100644 index 000000000..bb218d6fd --- /dev/null +++ b/keyboards/gh60/keymaps/unxmaal/config.h @@ -0,0 +1,190 @@ +/* +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 geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * 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 MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +// Rev A +// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } +// Rev B/C +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 PAUSE +//#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 + +/* + * RGB Underglow + * These settings are for the F4 by default: + * + * + * #define ws2812_PORTREG PORTF + * #define ws2812_DDRREG DDRF + * #define ws2812_pin PF4 + * #define RGBLED_NUM 14 // Number of LEDs + * #define RGBLIGHT_HUE_STEP 10 + * #define RGBLIGHT_SAT_STEP 17 + * #define RGBLIGHT_VAL_STEP 17 + * + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c +*/ + +/* Deprecated code below +#define ws2812_PORTREG PORTF +#define ws2812_DDRREG DDRF +#define ws2812_pin PF4 +*/ +#define RGB_DI_PIN F4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/gh60/keymaps/unxmaal/keymap.c b/keyboards/gh60/keymaps/unxmaal/keymap.c new file mode 100644 index 000000000..7c9bd6a6d --- /dev/null +++ b/keyboards/gh60/keymaps/unxmaal/keymap.c @@ -0,0 +1,228 @@ +#include "gh60.h" +#include "action_layer.h" + +#define _BL 0 +#define _AL 1 +#define _FL 2 +#define _UL 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ANSI Base, Mac style + * ,-----------------------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| = | Backsp | + * |-----------------------------------------------------------------------------| + * |Tab | Q | W | E | R | T | Y | U | I| O| P| [| ]| \| + * |-----------------------------------------------------------------------------| + * |Caps/Fn | A| S| D| F| G| H| J| K| L| ;| '| Enter | + * |-----------------------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | + * |-----------------------------------------------------------------------------| + * |Fn|Alt |Gui | Space(tapped), Fn(held) |Gui |Alt |Menu(tapped, Fn2(held)|Ctrl| + * `-----------------------------------------------------------------------------' + */ + [_BL] = KEYMAP( + KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSPC, \ + 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_LCTL,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_NO,KC_ENT, \ + KC_LSFT,KC_NO,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_NO,KC_RSFT, \ + MO(1),KC_LALT,KC_LGUI, LT(1,KC_SPACE), KC_NO, KC_RGUI, KC_RALT, LT(2,KC_MENU), KC_RCTL), + + /* + * Pok3r style arrow cluster + * ,-----------------------------------------------------------. + * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL | + * |-----------------------------------------------------------| + * | | | | | | | | |Up| | | | | | + * |-----------------------------------------------------------| + * | | | | | | | |Left|Down|Right| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [_AL] = KEYMAP( + 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,KC_DELETE, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,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_LEFT,KC_DOWN,KC_RGHT,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,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), + + + /* + * Secondary function layer + * ,-------------------------------------------------------------. + * | | | | | | | | RW|Play|FF| Mute| Vol Down | Vol up |Reset | + * |-------------------------------------------------------------| + * | | | | | | | | | |PgUp| | | | | + * |-------------------------------------------------------------| + * | | | | | | | |Home|PgDown|End| | | | + * |-------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-------------------------------------------------------------| + * | | | | | | | | | + * `-------------------------------------------------------------' + */ + [_FL] = KEYMAP( + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MPLY,KC_MNXT,KC_MUTE,KC_VOLD,KC_VOLU,RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PGUP,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_TRNS,KC_HOME,KC_PGDN,KC_END,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,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), + + /* + * Locking layer for controlling the underglow. + * NOTE: currently unused. + * + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | |On|Mode| | | | | | | | | | | + * |-----------------------------------------------------------| + * | | |Hue+|Hue-|Sat+|Sat-|Val+|Val-| | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [_UL] = KEYMAP( + 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,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,F(4),F(5),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,F(6),F(7),F(8),F(9),F(10),F(11),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), +}; + +enum function_id { + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(2), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(1), // Toggle Arrow Layer overlay + [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer + [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay + [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow + [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode + [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [12] = ACTION_FUNCTION(SHIFT_ESC), + [13] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), +}; + +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); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + +// Layer LED indicators +// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster + uint32_t layer = layer_state; + if (layer & (1<<1)) { + gh60_wasd_leds_on(); + } else { + gh60_wasd_leds_off(); + } + + if (layer & (1<<2)) { + gh60_esc_led_on(); + } else { + gh60_esc_led_off(); + } +}; + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + static uint8_t shift_esc_shift_mask; + // Shift + ESC = ~ + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +}; -- cgit v1.2.3