diff options
| author | Joel Challis <git@zvecr.com> | 2020-11-21 19:11:24 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-21 19:11:24 +0000 |
| commit | 23222625c201cd960a5b4a99ee52e74d4c13bba9 (patch) | |
| tree | 0fc0f24d2a60fb9e327debaca0b9fac72716487a /keyboards/amj40 | |
| parent | 4368611bfd87a544689ed10bb4450a39314bf1a1 (diff) | |
| download | qmk_firmware-23222625c201cd960a5b4a99ee52e74d4c13bba9.tar.gz qmk_firmware-23222625c201cd960a5b4a99ee52e74d4c13bba9.zip | |
Refactor to use led config - Part 5 (#10975)
* Refactor to use led config
* Refactor to use led config
* Refactor to use led config
Diffstat (limited to 'keyboards/amj40')
| -rwxr-xr-x | keyboards/amj40/amj40.c | 29 | ||||
| -rwxr-xr-x | keyboards/amj40/config.h | 3 |
2 files changed, 3 insertions, 29 deletions
diff --git a/keyboards/amj40/amj40.c b/keyboards/amj40/amj40.c index 5a2376999..20742c325 100755 --- a/keyboards/amj40/amj40.c +++ b/keyboards/amj40/amj40.c | |||
| @@ -1,30 +1 @@ | |||
| 1 | #include "amj40.h" | #include "amj40.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 | DDRB |= (1<<2); | ||
| 20 | } | ||
| 21 | |||
| 22 | void led_set_kb(uint8_t usb_led) { | ||
| 23 | if (usb_led & (1<<USB_LED_CAPS_LOCK)) { | ||
| 24 | // Turn capslock on | ||
| 25 | PORTB &= ~(1<<2); | ||
| 26 | } else { | ||
| 27 | // Turn capslock off | ||
| 28 | PORTB |= (1<<2); | ||
| 29 | } | ||
| 30 | } | ||
diff --git a/keyboards/amj40/config.h b/keyboards/amj40/config.h index f9a3c1ac6..5534dbf10 100755 --- a/keyboards/amj40/config.h +++ b/keyboards/amj40/config.h | |||
| @@ -38,6 +38,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 38 | #define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7} | 38 | #define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7} |
| 39 | #define UNUSED_PINS | 39 | #define UNUSED_PINS |
| 40 | 40 | ||
| 41 | #define LED_CAPS_LOCK_PIN B2 | ||
| 42 | #define LED_PIN_ON_STATE 0 | ||
| 43 | |||
| 41 | #define BACKLIGHT_PIN B6 | 44 | #define BACKLIGHT_PIN B6 |
| 42 | 45 | ||
| 43 | /* COL2ROW or ROW2COL */ | 46 | /* COL2ROW or ROW2COL */ |
