1 #include "../../crawlpad.h"
10 const uint8_t LED_PINS[] = LED_ROW_PINS;
12 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15 KC_P7, KC_P8, KC_P9, KC_PPLS,
16 KC_P4, KC_P5, KC_P6, KC_PMNS,
17 KC_P1, KC_P2, KC_P3, KC_PAST,
18 MO(1), KC_P0, KC_PDOT, KC_ENT),
21 KC_NLCK, BL1, KC_TRNS, KC_PSLS,
22 RESET, BL2, KC_TRNS, KC_TRNS,
23 KC_TRNS, BL3, KC_TRNS, KC_TRNS,
24 KC_TRNS, BL4, KC_TRNS, KC_TRNS),
28 void set_led(int idx, bool enable) {
29 uint8_t pin = LED_PINS[idx];
31 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
34 _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF);
38 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
42 void matrix_init_user(void) {
43 /* set LED row pins to output and low */
44 DDRB |= (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7);
45 PORTB &= ~(1 << 4) & ~(1 << 5) & ~(1 << 6) & ~(1 << 7);
48 void matrix_scan_user(void) {
51 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 if (record->event.pressed) {
61 if (record->event.pressed) {
68 if (record->event.pressed) {
75 if (record->event.pressed) {
85 void led_set_user(uint8_t usb_led) {
87 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
93 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
99 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
105 if (usb_led & (1 << USB_LED_COMPOSE)) {
111 if (usb_led & (1 << USB_LED_KANA)) {