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/amjpad | |
| 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/amjpad')
| -rw-r--r-- | keyboards/amjpad/amjpad.c | 29 | ||||
| -rw-r--r-- | keyboards/amjpad/config.h | 3 |
2 files changed, 3 insertions, 29 deletions
diff --git a/keyboards/amjpad/amjpad.c b/keyboards/amjpad/amjpad.c index ac5991bd0..83cdedf68 100644 --- a/keyboards/amjpad/amjpad.c +++ b/keyboards/amjpad/amjpad.c | |||
| @@ -1,30 +1 @@ | |||
| 1 | #include "amjpad.h" | #include "amjpad.h" | |
| 2 | #include "led.h" | ||
| 3 | |||
| 4 | void matrix_init_kb(void) { | ||
| 5 | // put your keyboard start-up code here | ||
| 6 | // runs once when the firmware starts up | ||
| 7 | matrix_init_user(); | ||
| 8 | led_init_ports(); | ||
| 9 | }; | ||
| 10 | |||
| 11 | void matrix_scan_kb(void) { | ||
| 12 | // put your looping keyboard code here | ||
| 13 | // runs every cycle (a lot) | ||
| 14 | matrix_scan_user(); | ||
| 15 | }; | ||
| 16 | |||
| 17 | void led_init_ports(void) { | ||
| 18 | // * Set our LED pins as output | ||
| 19 | DDRD |= (1<<6); | ||
| 20 | } | ||
| 21 | |||
| 22 | void led_set_kb(uint8_t usb_led) { | ||
| 23 | if (usb_led & (1<<USB_LED_NUM_LOCK)) { | ||
| 24 | // Turn numlock on | ||
| 25 | PORTD &= ~(1<<6); | ||
| 26 | } else { | ||
| 27 | // Turn numlock off | ||
| 28 | PORTD |= (1<<6); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/keyboards/amjpad/config.h b/keyboards/amjpad/config.h index bbb48624f..dd579be5f 100644 --- a/keyboards/amjpad/config.h +++ b/keyboards/amjpad/config.h | |||
| @@ -54,6 +54,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 54 | /* Locking resynchronize hack */ | 54 | /* Locking resynchronize hack */ |
| 55 | #define LOCKING_RESYNC_ENABLE | 55 | #define LOCKING_RESYNC_ENABLE |
| 56 | 56 | ||
| 57 | #define LED_NUM_LOCK_PIN D6 | ||
| 58 | #define LED_PIN_ON_STATE 0 | ||
| 59 | |||
| 57 | /* Backlight configuration | 60 | /* Backlight configuration |
| 58 | */ | 61 | */ |
| 59 | #define BACKLIGHT_LEVELS 4 | 62 | #define BACKLIGHT_LEVELS 4 |
