aboutsummaryrefslogtreecommitdiff
path: root/keyboards/amj60
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-11-17 17:06:30 +0000
committerGitHub <noreply@github.com>2020-11-17 17:06:30 +0000
commitddcb1794fa83e62e5e48536f4bc02ada63da411a (patch)
treedb5df8970f8ed22c77bdd021b781a429a5f05b49 /keyboards/amj60
parentadfd34c4512f6215a49a8f705ce408d6c82fb8cc (diff)
downloadqmk_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.c29
-rw-r--r--keyboards/amj60/config.h8
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
4void 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
11void matrix_scan_kb(void) {
12 // put your looping keyboard code here
13 // runs every cycle (a lot)
14 matrix_scan_user();
15};
16
17void led_init_ports(void) {
18 // * Set our LED pins as output
19 DDRB |= (1<<2);
20}
21
22void 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