diff options
| author | Joel Challis <git@zvecr.com> | 2019-08-14 20:08:01 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-08-14 12:08:01 -0700 |
| commit | d14ef52b804115bd07f2c22de7d354d6e9e94c58 (patch) | |
| tree | c34c009212dfa04a4bdbb4f4f39af34505184063 | |
| parent | 41482e02a6ac06bd9d0fa31c42d372c9d73c5d2b (diff) | |
| download | qmk_firmware-d14ef52b804115bd07f2c22de7d354d6e9e94c58.tar.gz qmk_firmware-d14ef52b804115bd07f2c22de7d354d6e9e94c58.zip | |
[Keymap] Update gherkin to use gpio (#6520)
| -rw-r--r-- | keyboards/40percentclub/gherkin/keymaps/default/keymap.c | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c index ae6f15862..9d1a67bd3 100644 --- a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c | |||
| @@ -18,46 +18,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 18 | 18 | ||
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | void matrix_init_user(void) { | 21 | void keyboard_pre_init_user(void) { |
| 22 | } | 22 | // Call the keyboard pre init code. |
| 23 | |||
| 24 | void matrix_scan_user(void) { | ||
| 25 | } | ||
| 26 | 23 | ||
| 27 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 24 | // Set our LED pins as output |
| 28 | return true; | 25 | setPinOutput(D5); |
| 26 | setPinOutput(B0); | ||
| 29 | } | 27 | } |
| 30 | 28 | ||
| 31 | void led_set_user(uint8_t usb_led) { | 29 | void led_set_user(uint8_t usb_led) { |
| 32 | 30 | if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { | |
| 33 | if (usb_led & (1 << USB_LED_NUM_LOCK)) { | 31 | writePinLow(D5); |
| 34 | DDRD |= (1 << 5); PORTD &= ~(1 << 5); | ||
| 35 | } else { | ||
| 36 | DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); | ||
| 37 | } | ||
| 38 | |||
| 39 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 40 | DDRB |= (1 << 0); PORTB &= ~(1 << 0); | ||
| 41 | } else { | ||
| 42 | DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); | ||
| 43 | } | ||
| 44 | |||
| 45 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 46 | |||
| 47 | } else { | ||
| 48 | |||
| 49 | } | ||
| 50 | |||
| 51 | if (usb_led & (1 << USB_LED_COMPOSE)) { | ||
| 52 | |||
| 53 | } else { | 32 | } else { |
| 54 | 33 | writePinHigh(D5); | |
| 55 | } | 34 | } |
| 56 | 35 | ||
| 57 | if (usb_led & (1 << USB_LED_KANA)) { | 36 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { |
| 58 | 37 | writePinLow(B0); | |
| 59 | } else { | 38 | } else { |
| 60 | 39 | writePinHigh(B0); | |
| 61 | } | 40 | } |
| 62 | |||
| 63 | } | 41 | } |
