diff options
| author | Joel Challis <git@zvecr.com> | 2020-11-17 17:06:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-17 17:06:30 +0000 |
| commit | ddcb1794fa83e62e5e48536f4bc02ada63da411a (patch) | |
| tree | db5df8970f8ed22c77bdd021b781a429a5f05b49 /keyboards/moon | |
| parent | adfd34c4512f6215a49a8f705ce408d6c82fb8cc (diff) | |
| download | qmk_firmware-ddcb1794fa83e62e5e48536f4bc02ada63da411a.tar.gz qmk_firmware-ddcb1794fa83e62e5e48536f4bc02ada63da411a.zip | |
Refactor to use led config - Part 1 (#10905)
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
Diffstat (limited to 'keyboards/moon')
| -rw-r--r-- | keyboards/moon/config.h | 3 | ||||
| -rw-r--r-- | keyboards/moon/moon.c | 53 |
2 files changed, 3 insertions, 53 deletions
diff --git a/keyboards/moon/config.h b/keyboards/moon/config.h index a02cfdba1..12a949a07 100644 --- a/keyboards/moon/config.h +++ b/keyboards/moon/config.h | |||
| @@ -31,6 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 31 | #define MATRIX_ROWS 8 | 31 | #define MATRIX_ROWS 8 |
| 32 | #define MATRIX_COLS 11 | 32 | #define MATRIX_COLS 11 |
| 33 | 33 | ||
| 34 | #define LED_CAPS_LOCK_PIN B5 | ||
| 35 | #define LED_SCROLL_LOCK_PIN B6 | ||
| 36 | |||
| 34 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | 37 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ |
| 35 | #define DEBOUNCE 5 | 38 | #define DEBOUNCE 5 |
| 36 | 39 | ||
diff --git a/keyboards/moon/moon.c b/keyboards/moon/moon.c index c218bf5ef..95ce007e2 100644 --- a/keyboards/moon/moon.c +++ b/keyboards/moon/moon.c | |||
| @@ -14,56 +14,3 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "moon.h" | 16 | #include "moon.h" |
| 17 | |||
| 18 | #define CAPS_PIN B5 | ||
| 19 | #define SCROLL_PIN B6 | ||
| 20 | |||
| 21 | // Optional override functions below. | ||
| 22 | // You can leave any or all of these undefined. | ||
| 23 | // These are only required if you want to perform custom actions. | ||
| 24 | |||
| 25 | void matrix_init_kb(void) { | ||
| 26 | // put your keyboard start-up code here | ||
| 27 | // runs once when the firmware starts up | ||
| 28 | |||
| 29 | setPinOutput(CAPS_PIN); | ||
| 30 | setPinOutput(SCROLL_PIN); | ||
| 31 | |||
| 32 | matrix_init_user(); | ||
| 33 | } | ||
| 34 | |||
| 35 | /* | ||
| 36 | |||
| 37 | void matrix_scan_kb(void) { | ||
| 38 | // put your looping keyboard code here | ||
| 39 | // runs every cycle (a lot) | ||
| 40 | |||
| 41 | matrix_scan_user(); | ||
| 42 | } | ||
| 43 | |||
| 44 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | ||
| 45 | // put your per-action keyboard code here | ||
| 46 | // runs for every action, just before processing by the firmware | ||
| 47 | |||
| 48 | return process_record_user(keycode, record); | ||
| 49 | } | ||
| 50 | |||
| 51 | */ | ||
| 52 | |||
| 53 | void led_set_kb(uint8_t usb_led) { | ||
| 54 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
| 55 | |||
| 56 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | ||
| 57 | writePinHigh(CAPS_PIN); | ||
| 58 | } else { | ||
| 59 | writePinLow(CAPS_PIN); | ||
| 60 | } | ||
| 61 | |||
| 62 | if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { | ||
| 63 | writePinHigh(SCROLL_PIN); | ||
| 64 | } else { | ||
| 65 | writePinLow(SCROLL_PIN); | ||
| 66 | } | ||
| 67 | |||
| 68 | led_set_user(usb_led); | ||
| 69 | } | ||
