Skip to content

Commit

Permalink
Migrate led_update_kb implementations to DD (#23980)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Jun 22, 2024
1 parent 35f0a17 commit 99aa4f5
Show file tree
Hide file tree
Showing 39 changed files with 96 additions and 601 deletions.
5 changes: 5 additions & 0 deletions keyboards/aeboards/ext65/rev1/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"extrakey": true,
"nkro": true
},
"indicators": {
"caps_lock": "D3",
"num_lock": "D5",
"scroll_lock": "D2"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"diode_direction": "COL2ROW",
Expand Down
19 changes: 3 additions & 16 deletions keyboards/aeboards/ext65/rev1/rev1.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,10 @@

#include "quantum.h"

void keyboard_pre_init_user(void) {
// Call the keyboard pre init code.
// Set our LED pins as output
gpio_set_pin_output(D5);
gpio_set_pin_output(D3);
gpio_set_pin_output(D2);
gpio_set_pin_output(D1);
}
void keyboard_pre_init_kb(void) {
gpio_set_pin_output(D1);

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
gpio_write_pin(D5, led_state.num_lock);
gpio_write_pin(D3, led_state.caps_lock);
gpio_write_pin(D2, led_state.scroll_lock);
}
return res;
keyboard_pre_init_user();
}

layer_state_t layer_state_set_kb(layer_state_t state) {
Expand Down
5 changes: 5 additions & 0 deletions keyboards/aeboards/ext65/rev2/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"levels": 6,
"breathing": true
},
"indicators": {
"caps_lock": "B3",
"num_lock": "B4",
"scroll_lock": "A15"
},
"rgblight": {
"led_count": 24,
"animations": {
Expand Down
15 changes: 0 additions & 15 deletions keyboards/aeboards/ext65/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,11 @@ bool oled_task_kb(void) {
#else

void keyboard_pre_init_kb(void) {
// Call the keyboard pre init code.
// Set our LED pins as output
gpio_set_pin_output(B4);
gpio_set_pin_output(B3);
gpio_set_pin_output(A15);
gpio_set_pin_output(A14);

keyboard_pre_init_user();
}

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
gpio_write_pin(B4, led_state.num_lock);
gpio_write_pin(B3, led_state.caps_lock);
gpio_write_pin(A15, led_state.scroll_lock);
}
return res;
}

layer_state_t layer_state_set_kb(layer_state_t state) {
switch (get_highest_layer(state)) {
case 1:
Expand Down
6 changes: 6 additions & 0 deletions keyboards/heliar/wm1_hotswap/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"backlight": {
"pin": "B7"
},
"indicators": {
"caps_lock": "D6",
"num_lock": "D7",
"scroll_lock": "D4",
"on_state": 0
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
Expand Down
39 changes: 0 additions & 39 deletions keyboards/heliar/wm1_hotswap/wm1_hotswap.c

This file was deleted.

34 changes: 0 additions & 34 deletions keyboards/hineybush/h10/h10.c

This file was deleted.

4 changes: 4 additions & 0 deletions keyboards/hineybush/h10/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"pin": "B7",
"breathing": true
},
"indicators": {
"caps_lock": "F7",
"on_state": 0
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"community_layouts": ["ortho_6x4", "numpad_6x4"],
Expand Down
31 changes: 0 additions & 31 deletions keyboards/hineybush/h60/h60.c

This file was deleted.

4 changes: 4 additions & 0 deletions keyboards/hineybush/h60/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"pin": "B7",
"levels": 12
},
"indicators": {
"caps_lock": "C6",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
Expand Down
16 changes: 0 additions & 16 deletions keyboards/hineybush/h87a/h87a.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
*/
#include "quantum.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
gpio_set_pin_output(D5);
gpio_set_pin_output(E6);
matrix_init_user();
}

bool led_update_kb(led_t led_state) {
if(led_update_user(led_state)) {
gpio_write_pin(D5, !led_state.caps_lock);
gpio_write_pin(E6, !led_state.scroll_lock);
}
return true;
}

void eeconfig_init_kb(void) { // EEPROM is getting reset!
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness
Expand Down
5 changes: 5 additions & 0 deletions keyboards/hineybush/h87a/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"backlight": {
"pin": "B7"
},
"indicators": {
"caps_lock": "D5",
"scroll_lock": "E6",
"on_state": 0
},
"ws2812": {
"pin": "D3"
},
Expand Down
16 changes: 0 additions & 16 deletions keyboards/hineybush/h88/h88.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
*/
#include "quantum.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
gpio_set_pin_output(D5);
gpio_set_pin_output(E6);
matrix_init_user();
}

bool led_update_kb(led_t led_state) {
if(led_update_user(led_state)) {
gpio_write_pin(D5, !led_state.caps_lock);
gpio_write_pin(E6, !led_state.scroll_lock);
}
return true;
}

void eeconfig_init_kb(void) { // EEPROM is getting reset!
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness
Expand Down
5 changes: 5 additions & 0 deletions keyboards/hineybush/h88/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"backlight": {
"pin": "B7"
},
"indicators": {
"caps_lock": "D5",
"scroll_lock": "E6",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
Expand Down
4 changes: 4 additions & 0 deletions keyboards/hineybush/physix/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
"pin": "B7",
"breathing": true
},
"indicators": {
"caps_lock": "D3",
"scroll_lock": "D5"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
Expand Down
49 changes: 0 additions & 49 deletions keyboards/hineybush/physix/physix.c

This file was deleted.

30 changes: 0 additions & 30 deletions keyboards/kc60se/kc60se.c

This file was deleted.

4 changes: 4 additions & 0 deletions keyboards/kc60se/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"pin": "F5",
"levels": 6
},
"indicators": {
"caps_lock": "B2",
"on_state": 0
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"community_layouts": ["60_ansi", "60_ansi_split_bs_rshift", "60_iso", "60_iso_split_bs_rshift"],
Expand Down
Loading

0 comments on commit 99aa4f5

Please sign in to comment.