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/amj60 | |
| 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/amj60')
| -rw-r--r-- | keyboards/amj60/amj60.c | 29 | ||||
| -rw-r--r-- | keyboards/amj60/config.h | 8 |
2 files changed, 6 insertions, 31 deletions
diff --git a/keyboards/amj60/amj60.c b/keyboards/amj60/amj60.c index 993a5917d..02aa116d5 100644 --- a/keyboards/amj60/amj60.c +++ b/keyboards/amj60/amj60.c | |||
| @@ -1,30 +1 @@ | |||
| 1 | #include "amj60.h" | #include "amj60.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/amj60/config.h b/keyboards/amj60/config.h index 81b70111b..79cfbe59e 100644 --- a/keyboards/amj60/config.h +++ b/keyboards/amj60/config.h | |||
| @@ -38,11 +38,15 @@ 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, D6, B3} | 38 | #define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7, D6, B3} |
| 39 | #define UNUSED_PINS | 39 | #define UNUSED_PINS |
| 40 | 40 | ||
| 41 | #define BACKLIGHT_PIN B6 | ||
| 42 | |||
| 43 | /* COL2ROW or ROW2COL */ | 41 | /* COL2ROW or ROW2COL */ |
| 44 | #define DIODE_DIRECTION COL2ROW | 42 | #define DIODE_DIRECTION COL2ROW |
| 45 | 43 | ||
| 44 | #define LED_CAPS_LOCK_PIN B2 | ||
| 45 | #define LED_PIN_ON_STATE 0 | ||
| 46 | |||
| 47 | #define BACKLIGHT_PIN B6 | ||
| 48 | |||
| 49 | |||
| 46 | /* define if matrix has ghost */ | 50 | /* define if matrix has ghost */ |
| 47 | //#define MATRIX_HAS_GHOST | 51 | //#define MATRIX_HAS_GHOST |
| 48 | 52 | ||
