diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2014-12-11 17:36:42 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2014-12-11 17:36:42 -0500 |
| commit | d9a1b9086f23477ffdcce3c1ff49ec1ce7c8791f (patch) | |
| tree | 47fb4e6f2311dd5193af921c379629dac98c09a2 | |
| parent | 1c6770f18cd5d7794c9ad198ada8062de8679e7c (diff) | |
| download | qmk_firmware-d9a1b9086f23477ffdcce3c1ff49ec1ce7c8791f.tar.gz qmk_firmware-d9a1b9086f23477ffdcce3c1ff49ec1ce7c8791f.zip | |
led
| -rw-r--r-- | common/action.c | 2 | ||||
| -rw-r--r-- | common/led.h | 1 | ||||
| -rw-r--r-- | keyboard/gh60/keymap_common.h | 48 | ||||
| -rw-r--r-- | keyboard/gh60/keymap_planck.c | 2 | ||||
| -rw-r--r-- | keyboard/gh60/led.c | 14 | ||||
| -rw-r--r-- | keyboard/gh60/matrix.c | 22 |
6 files changed, 40 insertions, 49 deletions
diff --git a/common/action.c b/common/action.c index ec8eeae7b..220de0f8a 100644 --- a/common/action.c +++ b/common/action.c | |||
| @@ -348,7 +348,7 @@ void register_code(uint8_t code) | |||
| 348 | return; | 348 | return; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | #ifdef LOCKING_SUPPORT_ENABLE | 351 | #ifdef LOCKING_SUPPORT_ENABLE |
| 352 | else if (KC_LOCKING_CAPS == code) { | 352 | else if (KC_LOCKING_CAPS == code) { |
| 353 | #ifdef LOCKING_RESYNC_ENABLE | 353 | #ifdef LOCKING_RESYNC_ENABLE |
| 354 | // Resync: ignore if caps lock already is on | 354 | // Resync: ignore if caps lock already is on |
diff --git a/common/led.h b/common/led.h index 402a247b9..b84a3ff94 100644 --- a/common/led.h +++ b/common/led.h | |||
| @@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 26 | #define USB_LED_SCROLL_LOCK 2 | 26 | #define USB_LED_SCROLL_LOCK 2 |
| 27 | #define USB_LED_COMPOSE 3 | 27 | #define USB_LED_COMPOSE 3 |
| 28 | #define USB_LED_KANA 4 | 28 | #define USB_LED_KANA 4 |
| 29 | #define USB_LED_FUNCTION 5 | ||
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | void led_set(uint8_t usb_led); | 32 | void led_set(uint8_t usb_led); |
diff --git a/keyboard/gh60/keymap_common.h b/keyboard/gh60/keymap_common.h index 896badd74..738741815 100644 --- a/keyboard/gh60/keymap_common.h +++ b/keyboard/gh60/keymap_common.h | |||
| @@ -38,47 +38,15 @@ extern const uint16_t fn_actions[]; | |||
| 38 | * K2C, K31 and K3C are extra keys for ISO | 38 | * K2C, K31 and K3C are extra keys for ISO |
| 39 | */ | 39 | */ |
| 40 | #define KEYMAP( \ | 40 | #define KEYMAP( \ |
| 41 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | 41 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ |
| 42 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | 42 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ |
| 43 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ | 43 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ |
| 44 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ | 44 | K30, K31, K32, K33, K34, K35, K37, K38, K39, K3A, K3B \ |
| 45 | K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ | ||
| 46 | ) { \ | 45 | ) { \ |
| 47 | { 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 }, \ | 46 | { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B }, \ |
| 48 | { 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 }, \ | 47 | { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B }, \ |
| 49 | { 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 }, \ | 48 | { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B }, \ |
| 50 | { 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 }, \ | 49 | { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B } \ |
| 51 | { 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 } \ | ||
| 52 | } | 50 | } |
| 53 | 51 | ||
| 54 | /* ANSI valiant. No extra keys for ISO */ | ||
| 55 | #define KEYMAP_ANSI( \ | ||
| 56 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | ||
| 57 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 58 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ | ||
| 59 | K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ | ||
| 60 | K40, K41, K42, K45, K4A, K4B, K4C, K4D \ | ||
| 61 | ) KEYMAP( \ | ||
| 62 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | ||
| 63 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 64 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ | ||
| 65 | K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \ | ||
| 66 | K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \ | ||
| 67 | ) | ||
| 68 | |||
| 69 | |||
| 70 | #define KEYMAP_HHKB( \ | ||
| 71 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ | ||
| 72 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 73 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ | ||
| 74 | K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ | ||
| 75 | K40, K41, K42, K45, K4A, K4B, K4C, K4D \ | ||
| 76 | ) KEYMAP( \ | ||
| 77 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | ||
| 78 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 79 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ | ||
| 80 | K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ | ||
| 81 | K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ | ||
| 82 | ) | ||
| 83 | |||
| 84 | #endif | 52 | #endif |
diff --git a/keyboard/gh60/keymap_planck.c b/keyboard/gh60/keymap_planck.c index 636589d1e..ab167a734 100644 --- a/keyboard/gh60/keymap_planck.c +++ b/keyboard/gh60/keymap_planck.c | |||
| @@ -22,7 +22,7 @@ const uint16_t PROGMEM fn_actions[] = { | |||
| 22 | [1] = ACTION_DEFAULT_LAYER_SET(0), // set Qwerty layout | 22 | [1] = ACTION_DEFAULT_LAYER_SET(0), // set Qwerty layout |
| 23 | [2] = ACTION_DEFAULT_LAYER_SET(1), // set Photoshop presets | 23 | [2] = ACTION_DEFAULT_LAYER_SET(1), // set Photoshop presets |
| 24 | [3] = ACTION_LAYER_ON_OFF(2), // Photoshop function layer | 24 | [3] = ACTION_LAYER_ON_OFF(2), // Photoshop function layer |
| 25 | 25 | ||
| 26 | [4] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F9), // photo folder AHK | 26 | [4] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL | MOD_LALT, KC_F9), // photo folder AHK |
| 27 | [5] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_I), // select inverse | 27 | [5] = ACTION_MODS_KEY(MOD_LSFT | MOD_LCTL, KC_I), // select inverse |
| 28 | [6] = ACTION_MODS_KEY(MOD_LSFT, KC_M), // marquee select | 28 | [6] = ACTION_MODS_KEY(MOD_LSFT, KC_M), // marquee select |
diff --git a/keyboard/gh60/led.c b/keyboard/gh60/led.c index 62abcd79d..7c9851080 100644 --- a/keyboard/gh60/led.c +++ b/keyboard/gh60/led.c | |||
| @@ -22,13 +22,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 22 | 22 | ||
| 23 | void led_set(uint8_t usb_led) | 23 | void led_set(uint8_t usb_led) |
| 24 | { | 24 | { |
| 25 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | 25 | if (usb_led & (1<<USB_LED_FUNCTION)) { |
| 26 | // output low | 26 | // Output high. |
| 27 | DDRB |= (1<<2); | 27 | DDRF |= (1<<0); |
| 28 | PORTB &= ~(1<<2); | 28 | PORTF |= (1<<0); |
| 29 | } else { | 29 | } else { |
| 30 | // Hi-Z | 30 | // Output low. |
| 31 | DDRB &= ~(1<<2); | 31 | DDRF &= ~(1<<0); |
| 32 | PORTB &= ~(1<<2); | 32 | PORTF &= ~(1<<0); |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c index 508b1afbc..83016b77a 100644 --- a/keyboard/gh60/matrix.c +++ b/keyboard/gh60/matrix.c | |||
| @@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
| 23 | #include <avr/io.h> | 23 | #include <avr/io.h> |
| 24 | #include <util/delay.h> | 24 | #include <util/delay.h> |
| 25 | #include "action_layer.h" | ||
| 25 | #include "print.h" | 26 | #include "print.h" |
| 26 | #include "debug.h" | 27 | #include "debug.h" |
| 27 | #include "util.h" | 28 | #include "util.h" |
| @@ -55,12 +56,21 @@ uint8_t matrix_cols(void) | |||
| 55 | return MATRIX_COLS; | 56 | return MATRIX_COLS; |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 59 | static | ||
| 60 | void setup_leds(void) { | ||
| 61 | DDRF |= 0x00; | ||
| 62 | PORTF |= 0x00; | ||
| 63 | } | ||
| 64 | |||
| 65 | |||
| 58 | void matrix_init(void) | 66 | void matrix_init(void) |
| 59 | { | 67 | { |
| 60 | // initialize row and col | 68 | // initialize row and col |
| 61 | unselect_rows(); | 69 | unselect_rows(); |
| 62 | init_cols(); | 70 | init_cols(); |
| 63 | 71 | ||
| 72 | setup_leds(); | ||
| 73 | |||
| 64 | // initialize matrix state: all keys off | 74 | // initialize matrix state: all keys off |
| 65 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | 75 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { |
| 66 | matrix[i] = 0; | 76 | matrix[i] = 0; |
| @@ -94,6 +104,18 @@ uint8_t matrix_scan(void) | |||
| 94 | } | 104 | } |
| 95 | } | 105 | } |
| 96 | 106 | ||
| 107 | // uint8_t layer = biton32(default_layer_state); | ||
| 108 | switch (default_layer_state) { | ||
| 109 | case 1: | ||
| 110 | DDRF &= ~(1<<0); | ||
| 111 | PORTF &= ~(1<<0); | ||
| 112 | break; | ||
| 113 | case 2: | ||
| 114 | DDRF |= (1<<0); | ||
| 115 | PORTF |= (1<<0); | ||
| 116 | break; | ||
| 117 | } | ||
| 118 | |||
| 97 | return 1; | 119 | return 1; |
| 98 | } | 120 | } |
| 99 | 121 | ||
