diff options
| author | Joel Challis <git@zvecr.com> | 2020-11-18 17:51:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-18 17:51:53 +0000 |
| commit | f00402a2f3d551bcb1fb87245238e2b392192eb5 (patch) | |
| tree | aad0bdc88a3fae31ac58cfdd62d99bac06dc67d0 /keyboards/jc65 | |
| parent | e1e13c53acb24c3617c3de88fa401acb3d628074 (diff) | |
| download | qmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.tar.gz qmk_firmware-f00402a2f3d551bcb1fb87245238e2b392192eb5.zip | |
Refactor to use led config - Part 3 (#10966)
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
Diffstat (limited to 'keyboards/jc65')
| -rw-r--r-- | keyboards/jc65/v32u4/config.h | 3 | ||||
| -rw-r--r-- | keyboards/jc65/v32u4/v32u4.c | 35 |
2 files changed, 3 insertions, 35 deletions
diff --git a/keyboards/jc65/v32u4/config.h b/keyboards/jc65/v32u4/config.h index 8233dd1e8..a00f64a1f 100644 --- a/keyboards/jc65/v32u4/config.h +++ b/keyboards/jc65/v32u4/config.h | |||
| @@ -37,6 +37,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 37 | #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4, F5 } | 37 | #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4, F5 } |
| 38 | #define UNUSED_PINS | 38 | #define UNUSED_PINS |
| 39 | 39 | ||
| 40 | #define LED_CAPS_LOCK_PIN B2 | ||
| 41 | #define LED_PIN_ON_STATE 0 | ||
| 42 | |||
| 40 | #define RGB_DI_PIN E2 | 43 | #define RGB_DI_PIN E2 |
| 41 | #ifdef RGB_DI_PIN | 44 | #ifdef RGB_DI_PIN |
| 42 | #define RGBLIGHT_ANIMATIONS | 45 | #define RGBLIGHT_ANIMATIONS |
diff --git a/keyboards/jc65/v32u4/v32u4.c b/keyboards/jc65/v32u4/v32u4.c index c69c5d531..a6837268e 100644 --- a/keyboards/jc65/v32u4/v32u4.c +++ b/keyboards/jc65/v32u4/v32u4.c | |||
| @@ -1,36 +1 @@ | |||
| 1 | #include "v32u4.h" | #include "v32u4.h" | |
| 2 | |||
| 3 | void matrix_init_kb(void) { | ||
| 4 | // put your keyboard start-up code here | ||
| 5 | // runs once when the firmware starts up | ||
| 6 | |||
| 7 | matrix_init_user(); | ||
| 8 | } | ||
| 9 | |||
| 10 | void matrix_scan_kb(void) { | ||
| 11 | // put your looping keyboard code here | ||
| 12 | // runs every cycle (a lot) | ||
| 13 | |||
| 14 | matrix_scan_user(); | ||
| 15 | } | ||
| 16 | |||
| 17 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 18 | // put your per-action keyboard code here | ||
| 19 | // runs for every action, just before processing by the firmware | ||
| 20 | |||
| 21 | return process_record_user(keycode, record); | ||
| 22 | } | ||
| 23 | |||
| 24 | void led_set_kb(uint8_t usb_led) { | ||
| 25 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 26 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | ||
| 27 | // output low | ||
| 28 | DDRB |= (1<<2); | ||
| 29 | PORTB &= ~(1<<2); | ||
| 30 | } else { | ||
| 31 | // Hi-Z | ||
| 32 | DDRB &= ~(1<<2); | ||
| 33 | PORTB &= ~(1<<2); | ||
| 34 | } | ||
| 35 | led_set_user(usb_led); | ||
| 36 | } | ||
