aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/tmo50/keymaps/default/keymap.c1
-rw-r--r--keyboards/tmo50/tmo50.c41
2 files changed, 41 insertions, 1 deletions
diff --git a/keyboards/tmo50/keymaps/default/keymap.c b/keyboards/tmo50/keymaps/default/keymap.c
index 419893f1a..7b8b644cc 100644
--- a/keyboards/tmo50/keymaps/default/keymap.c
+++ b/keyboards/tmo50/keymaps/default/keymap.c
@@ -48,4 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
48 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS 48 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
49 ), 49 ),
50}; 50};
51
diff --git a/keyboards/tmo50/tmo50.c b/keyboards/tmo50/tmo50.c
index a42ab4720..4f6288133 100644
--- a/keyboards/tmo50/tmo50.c
+++ b/keyboards/tmo50/tmo50.c
@@ -19,6 +19,15 @@ void matrix_init_kb(void) {
19 // put your keyboard start-up code here 19 // put your keyboard start-up code here
20 // runs once when the firmware starts up 20 // runs once when the firmware starts up
21 21
22 DDRB |= (1 << PB0); //init B0
23 PORTB &= ~(1 << PB0); //turn on B0
24 DDRB |= (1 << PB1);
25 PORTB |= (1<<PB1); //turn off B1
26 DDRB |= (1 << PB2);
27 PORTB |= (1<<PB2);
28 DDRB |= (1 << PB3);
29 PORTB |= (1<<PB3);
30
22 matrix_init_user(); 31 matrix_init_user();
23} 32}
24 33
@@ -41,3 +50,35 @@ void led_set_kb(uint8_t usb_led) {
41 50
42 led_set_user(usb_led); 51 led_set_user(usb_led);
43} 52}
53
54uint32_t layer_state_set_user(uint32_t state)
55{
56 // if on layer 0, turn on B0 LED, otherwise off.
57 if (biton32(state) == 0) {
58 PORTB &= ~(1<<PB0);
59 } else {
60 PORTB |= (1<<PB0);
61 }
62
63 // if on layer 1, turn on B1 LED, otherwise off.
64 if (biton32(state) == 1) {
65 PORTB &= ~(1<<PB1);
66 } else {
67 PORTB |= (1<<PB1);
68 }
69 // if on layer 2, turn on B2 LED, otherwise off.
70 if (biton32(state) == 2) {
71 PORTB &= ~(1<<PB2);
72 } else {
73 PORTB |= (1<<PB2);
74 }
75
76 // if on layer 3, turn on B3 LED, otherwise off.
77 if (biton32(state) == 3) {
78 PORTB &= ~(1<<PB3);
79 } else {
80 PORTB |= (1<<PB3);
81 }
82
83 return state;
84}