Convert eeconfig_init_kb implementations to config (#24087)

This commit is contained in:
Joel Challis 2024-07-12 08:06:19 +01:00 committed by GitHub
parent 2c2885639e
commit 52ee9f2ce1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
31 changed files with 63 additions and 210 deletions

View File

@ -1,27 +0,0 @@
/*
Copyright 2021 0xCB - Conor Burns
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 eeconfig_init_kb(void) {
#ifdef BACKLIGHT_ENABLE
backlight_enable();
backlight_level(5);
#endif
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -9,6 +9,9 @@
"device_version": "0.0.1" "device_version": "0.0.1"
}, },
"backlight": { "backlight": {
"default": {
"brightness": 5
},
"pin": "B5", "pin": "B5",
"levels": 7, "levels": 7,
"breathing": true "breathing": true

View File

@ -1,4 +1,4 @@
/* Copyright 2021 Harrison Chan (Xelus) /* Copyright 2020 GhostSeven <work@ghost7.com>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -13,13 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "quantum.h" #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
void eeconfig_init_kb(void) { // EEPROM is getting reset!
rgblight_enable(); // Enable RGB by default
rgblight_mode(RGBLIGHT_MODE_RGB_TEST); // set to RGBLIGHT_MODE_RGB_TEST by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -1,28 +0,0 @@
/* Copyright 2020 GhostSeven <work@ghost7.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 eeconfig_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 255); // Set default HSV - red hue, full saturation, full brightness
#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
#endif
#endif
eeconfig_init_user();
}

View File

@ -13,13 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "quantum.h" #pragma once
void eeconfig_init_kb(void) { // EEPROM is getting reset! #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -35,6 +35,9 @@
"breathing": true "breathing": true
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 16, "led_count": 16,

View File

@ -13,14 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "quantum.h" #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
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
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -34,6 +34,9 @@
"breathing": true "breathing": true
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 22, "led_count": 22,

View File

@ -13,15 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "quantum.h" #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
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
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -44,6 +44,9 @@
"pin": "D3" "pin": "D3"
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 24, "led_count": 24,

View File

@ -13,13 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "quantum.h" #pragma once
void eeconfig_init_kb(void) { // EEPROM is getting reset! #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 128); // Set default HSV - red hue, full saturation, medium brightness
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -41,6 +41,9 @@
"on_state": 0 "on_state": 0
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 24, "led_count": 24,

View File

@ -34,3 +34,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define MATRIX_ROW_PINS { B1, B6, D0, C7, C6, C5 } #define MATRIX_ROW_PINS { B1, B6, D0, C7, C6, C5 }
#define MATRIX_COL_PINS { F0, F1, F2, F3, F4, F5, F6, F7, A0, A1, A2, A3, A4, A5, B5, B4, B3, B2 } #define MATRIX_COL_PINS { F0, F1, F2, F3, F4, F5, F6, F7, A0, A1, A2, A3, A4, A5, B5, B4, B3, B2 }
#define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)

View File

@ -34,15 +34,6 @@
// #define HSV_custom_color H, S, V // #define HSV_custom_color H, S, V
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
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {

View File

@ -16,6 +16,9 @@
"pin": "B0" "pin": "B0"
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 27, "led_count": 27,

View File

@ -57,6 +57,9 @@
] ]
}, },
"backlight": { "backlight": {
"default": {
"brightness": 3
},
"pin": "B5" "pin": "B5"
}, },
"rgblight": { "rgblight": {

View File

@ -57,6 +57,9 @@
] ]
}, },
"backlight": { "backlight": {
"default": {
"brightness": 3
},
"pin": "B5" "pin": "B5"
}, },
"rgblight": { "rgblight": {

View File

@ -28,15 +28,6 @@ bool led_update_kb(led_t led_state) {
} }
#endif #endif
void eeconfig_init_kb(void) {
#ifdef BACKLIGHT_ENABLE
backlight_enable();
backlight_level(3);
#endif
eeconfig_update_kb(0);
eeconfig_init_user();
}
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) { bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) { return false; } if (!encoder_update_user(index, clockwise)) { return false; }

View File

@ -3,12 +3,6 @@
#include "quantum.h" #include "quantum.h"
#ifdef RGBLIGHT_ENABLE
void eeconfig_init_kb(void) {
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL);
};
#endif
#ifdef OLED_ENABLE #ifdef OLED_ENABLE
bool oled_task_kb(void) { bool oled_task_kb(void) {
if (!oled_task_user()) { return false; } if (!oled_task_user()) { return false; }

View File

@ -29,6 +29,9 @@
"knight": true, "knight": true,
"christmas": true, "christmas": true,
"static_gradient": true "static_gradient": true
},
"default": {
"animation": "rainbow_swirl"
} }
}, },
"ws2812": { "ws2812": {

View File

@ -1,4 +1,6 @@
#pragma once #pragma once
#define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 5)
#define RGBLIGHT_LAYERS #define RGBLIGHT_LAYERS
#define RGBLIGHT_LAYER_BLINK #define RGBLIGHT_LAYER_BLINK

View File

@ -1,14 +0,0 @@
#include "quantum.h"
void eeconfig_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable(); // Enable RGB underglow by default
rgblight_sethsv(0, 255, 255);
#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 5); // Set to RGB_RAINBOW_SWIRL animation by default
#endif
#endif
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -13,14 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "quantum.h" #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 2)
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
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -39,6 +39,9 @@
"pin": "B3" "pin": "B3"
}, },
"rgblight": { "rgblight": {
"default": {
"val": 128
},
"saturation_steps": 8, "saturation_steps": 8,
"brightness_steps": 8, "brightness_steps": 8,
"led_count": 24, "led_count": 24,

View File

@ -13,14 +13,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once
#include "quantum.h" #define RGBLIGHT_DEFAULT_MODE (RGBLIGHT_MODE_RAINBOW_SWIRL + 5)
void eeconfig_init_kb(void) { // EEPROM is getting reset!
rgblight_enable(); // Enable RGB by default
rgblight_sethsv(0, 255, 125); // Set default HSV - red hue, full saturation, medium brightness
rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 5); // set to RGB_RAINBOW_SWIRL by default
eeconfig_update_kb(0);
eeconfig_init_user();
}

View File

@ -12,6 +12,9 @@
"pin": "B0" "pin": "B0"
}, },
"rgblight": { "rgblight": {
"default": {
"val": 125
},
"led_count": 68, "led_count": 68,
"max_brightness": 125, "max_brightness": 125,
"sleep": true, "sleep": true,

View File

@ -23,6 +23,11 @@
"resync": true "resync": true
} }
}, },
"audio": {
"default": {
"clicky": false
}
},
"matrix_pins": { "matrix_pins": {
"cols": ["B7", "B0", "F5", "D5", "B1", "B2", "B3", "D3", "D2", "C7", "B6", "B5", "B4", "D7", "D6", "D4"], "cols": ["B7", "B0", "F5", "D5", "B1", "B2", "B3", "D3", "D2", "C7", "B6", "B5", "B4", "D7", "D6", "D4"],
"rows": ["F0", "E6", "F4", "F6", "F7"] "rows": ["F0", "E6", "F4", "F6", "F7"]

View File

@ -30,26 +30,6 @@ float tone_device_indication[][2] = SONG(FANTASIE_IMPROMPTU);
#endif #endif
// We want to enable audio clicky (i.e. compile it into firmware),
// but not have it "turned on" by default.
#ifdef AUDIO_CLICKY
#include "process_clicky.h"
extern audio_config_t audio_config;
void eeconfig_init_kb(void) {
// Reset Keyboard EEPROM value to blank, rather than to a set value
eeconfig_update_kb(0);
// Need to read here because this isn't done before calling eeconfig_init_kb()
audio_config.raw = eeconfig_read_audio();
// ...and this call needs audio_config initialized.
clicky_off();
eeconfig_init_user();
}
#endif // AUDIO_CLICKY
void keyboard_pre_init_kb(void) { void keyboard_pre_init_kb(void) {
gpio_set_pin_output(F1); gpio_set_pin_output(F1);

View File

@ -21,6 +21,9 @@
"rgb_test": true, "rgb_test": true,
"alternating": true, "alternating": true,
"twinkle": true "twinkle": true
},
"default": {
"animation": "rgb_test"
} }
}, },
"ws2812": { "ws2812": {

View File

@ -26,6 +26,9 @@
"rgb_test": true, "rgb_test": true,
"alternating": true, "alternating": true,
"twinkle": true "twinkle": true
},
"default": {
"animation": "rgb_test"
} }
}, },
"features": { "features": {

View File

@ -1,28 +0,0 @@
/* Copyright 2021 Harrison Chan (Xelus)
*
* 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 eeconfig_init_kb(void) { // EEPROM is getting reset!
rgblight_enable(); // Enable RGB by default
rgblight_mode(RGBLIGHT_MODE_RGB_TEST); // set to RGBLIGHT_MODE_RGB_TEST by default
eeconfig_update_kb(0);
eeconfig_init_user();
}
// Tested and verified working on Ninjin
void matrix_io_delay(void) { __asm__ volatile("nop\nnop\nnop\n"); }