Migrate led_update_kb implementations to DD (#23980)

This commit is contained in:
Joel Challis 2024-06-22 09:10:12 +01:00 committed by GitHub
parent 35f0a17679
commit 99aa4f5191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
39 changed files with 96 additions and 601 deletions

View File

@ -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",

View File

@ -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) {

View File

@ -22,6 +22,11 @@
"levels": 6,
"breathing": true
},
"indicators": {
"caps_lock": "B3",
"num_lock": "B4",
"scroll_lock": "A15"
},
"rgblight": {
"led_count": 24,
"animations": {

View File

@ -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:

View File

@ -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": {

View File

@ -1,39 +0,0 @@
/* Copyright 2019 HELIAR MK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
void keyboard_pre_init_kb(void)
{
gpio_set_pin_output(D7);
gpio_write_pin_high(D7);
gpio_set_pin_output(D6);
gpio_write_pin_high(D6);
gpio_set_pin_output(D4);
gpio_write_pin_high(D4);
}
bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)){
gpio_write_pin(D7, !led_state.num_lock);
gpio_write_pin(D6, !led_state.caps_lock);
gpio_write_pin(D4, !led_state.scroll_lock);
}
return true;
}

View File

@ -1,34 +0,0 @@
/* Copyright 2020 hineybush
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
gpio_set_pin_output(F7);
}
bool led_update_kb(led_t led_state) {
if(led_update_user(led_state)) {
gpio_write_pin(F7, !led_state.num_lock);
}
return true;
}

View File

@ -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"],

View File

@ -1,31 +0,0 @@
/* Copyright 2020 hineybush
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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(C6);
}
bool led_update_kb(led_t led_state) {
if(led_update_user(led_state)) {
gpio_write_pin(C6, !led_state.caps_lock);
}
return true;
}

View File

@ -34,6 +34,10 @@
"pin": "B7",
"levels": 12
},
"indicators": {
"caps_lock": "C6",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,

View File

@ -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

View File

@ -35,6 +35,11 @@
"backlight": {
"pin": "B7"
},
"indicators": {
"caps_lock": "D5",
"scroll_lock": "E6",
"on_state": 0
},
"ws2812": {
"pin": "D3"
},

View File

@ -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

View File

@ -35,6 +35,11 @@
"backlight": {
"pin": "B7"
},
"indicators": {
"caps_lock": "D5",
"scroll_lock": "E6",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,

View File

@ -33,6 +33,10 @@
"pin": "B7",
"breathing": true
},
"indicators": {
"caps_lock": "D3",
"scroll_lock": "D5"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,

View File

@ -1,49 +0,0 @@
/* Copyright 2019 hineybush
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
gpio_set_pin_output(D3);
gpio_set_pin_output(D5);
matrix_init_user();
}
bool led_update_kb(led_t led_state) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
bool res = led_update_user(led_state);
if(res) {
// gpio_write_pin sets the pin high for 1 and low for 0.
// In this example the pins are inverted, setting
// it low/0 turns it on, and high/1 turns the LED off.
// This behavior depends on whether the LED is between the pin
// and VCC or the pin and GND.
gpio_write_pin(D3, led_state.caps_lock);
gpio_write_pin(D5, led_state.scroll_lock);
}
return res;
return led_update_user(led_state);
}

View File

@ -1,30 +0,0 @@
/* Copyright 2017 Blake C. Lewis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
void matrix_init_kb(void){
gpio_set_pin_output(B2);
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
gpio_write_pin(B2, !led_state.caps_lock);
}
return res;
}

View File

@ -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"],

View File

@ -22,6 +22,10 @@
"resync": true
}
},
"indicators": {
"caps_lock": "B5",
"scroll_lock": "B6"
},
"matrix_pins": {
"cols": ["B4", "D7", "D6", "D4", "C6", "D5", "D3", "D2", "D1", "D0", "B7", "B3", "B2", "B1", "B0", "E6", "F7"],
"rows": ["C7", "F0", "F1", "F4", "F5", "F6"]

View File

@ -1,42 +0,0 @@
/* Copyright 2020 Mathias Andersson <wraul@dbox.se>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
#define CAPS_PIN B5
#define SCROLL_PIN B6
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
gpio_set_pin_output(CAPS_PIN);
gpio_set_pin_output(SCROLL_PIN);
matrix_init_user();
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
gpio_write_pin(CAPS_PIN, led_state.caps_lock);
gpio_write_pin(SCROLL_PIN, led_state.scroll_lock);
}
return res;
}

View File

@ -1,40 +0,0 @@
/**
* cain_re.c
*
Copyright 2020 astro <yuleiz@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
void matrix_init_kb(void)
{
gpio_set_pin_output(NUM_PIN);
gpio_set_pin_output(CAPS_PIN);
gpio_set_pin_output(SCROLL_PIN);
matrix_init_user();
}
bool led_update_kb(led_t led_state)
{
bool res = led_update_user(led_state);
if (res) {
gpio_write_pin(NUM_PIN, led_state.num_lock);
gpio_write_pin(CAPS_PIN, led_state.caps_lock);
gpio_write_pin(SCROLL_PIN, led_state.scroll_lock);
}
return res;
}

View File

@ -1,24 +0,0 @@
/**
* config.h
*
Copyright 2020 astro <yuleiz@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define CAPS_PIN D3
#define NUM_PIN F7
#define SCROLL_PIN B0

View File

@ -8,6 +8,11 @@
"pid": "0x0106",
"device_version": "0.0.1"
},
"indicators": {
"caps_lock": "D3",
"num_lock": "F7",
"scroll_lock": "B0"
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,

View File

@ -8,6 +8,12 @@
"pid": "0x8712",
"device_version": "0.0.1"
},
"indicators": {
"caps_lock": "C6",
"num_lock": "B1",
"scroll_lock": "B2",
"on_state": 0
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,

View File

@ -1,23 +0,0 @@
/**
* rev2.c
*/
#include "quantum.h"
void matrix_init_kb(void) {
gpio_set_pin_output(C6);
gpio_set_pin_output(B2);
gpio_set_pin_output(B1);
matrix_init_user();
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
gpio_write_pin(B1, !led_state.num_lock);
gpio_write_pin(C6, !led_state.caps_lock);
gpio_write_pin(B2, !led_state.scroll_lock);
}
return res;
}

View File

@ -33,6 +33,11 @@
"pin": "B7",
"levels": 5
},
"indicators": {
"caps_lock": "B1",
"scroll_lock": "B2",
"on_state": 0
},
"ws2812": {
"pin": "B0"
},

View File

@ -1,39 +0,0 @@
/* Copyright 2019 Ryota Goto
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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(B1);
gpio_set_pin_output(B2);
matrix_init_user();
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if(res) {
gpio_write_pin(B1, !led_state.caps_lock);
gpio_write_pin(B2, !led_state.scroll_lock);
}
return res;
}

View File

@ -35,6 +35,12 @@
"levels": 24,
"breathing": true
},
"indicators": {
"caps_lock": "B3",
"num_lock": "A14",
"scroll_lock": "A15",
"on_state": 0
},
"rgblight": {
"led_count": 24,
"animations": {

View File

@ -1,35 +0,0 @@
/* Copyright 2020 Ramon Imbao
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
void keyboard_pre_init_user(void) {
// Initialize indicator LED pins
gpio_set_pin_output(A14); // Num Lock
gpio_set_pin_output(A15); // Scroll Lock
gpio_set_pin_output(B3); // Caps Lock
}
bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
gpio_write_pin(A14, !led_state.num_lock);
gpio_write_pin(A15, !led_state.scroll_lock);
gpio_write_pin(B3, !led_state.caps_lock);
}
return res;
}

View File

@ -29,6 +29,10 @@
"pin": "B5",
"levels": 10
},
"indicators": {
"caps_lock": "B6",
"on_state": 0
},
"rgblight": {
"led_count": 9,
"animations": {

Some files were not shown because too many files have changed in this diff Show More