This commit is contained in:
Joel Spadin 2024-04-06 02:48:20 +00:00 committed by GitHub
commit 9f479c9fab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View file

@ -24,13 +24,13 @@ struct layer_status_state {
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) { static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
if (state.label == NULL) { if (state.label == NULL) {
char text[7] = {}; char text[16] = {};
sprintf(text, LV_SYMBOL_KEYBOARD " %i", state.index); snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);
lv_label_set_text(label, text); lv_label_set_text(label, text);
} else { } else {
char text[13] = {}; char text[16] = {};
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %s", state.label); snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %s", state.label);

View file

@ -35,7 +35,7 @@ static struct output_status_state get_state(const zmk_event_t *_eh) {
} }
static void set_status_symbol(lv_obj_t *label, struct output_status_state state) { static void set_status_symbol(lv_obj_t *label, struct output_status_state state) {
char text[10] = {}; char text[24] = {};
switch (state.selected_endpoint.transport) { switch (state.selected_endpoint.transport) {
case ZMK_TRANSPORT_USB: case ZMK_TRANSPORT_USB:

View file

@ -93,7 +93,6 @@ void ksbb_inner_kscan_callback(const struct device *dev, uint32_t row, uint32_t
} }
static int ksbb_configure(const struct device *dev, kscan_callback_t callback) { static int ksbb_configure(const struct device *dev, kscan_callback_t callback) {
const struct ksbb_config *cfg = dev->config;
struct ksbb_data *data = dev->data; struct ksbb_data *data = dev->data;
data->callback = callback; data->callback = callback;

View file

@ -82,7 +82,9 @@ static struct zmk_led_hsb hsb_scale_zero_max(struct zmk_led_hsb hsb) {
} }
static struct led_rgb hsb_to_rgb(struct zmk_led_hsb hsb) { static struct led_rgb hsb_to_rgb(struct zmk_led_hsb hsb) {
float r, g, b; float r = 0;
float g = 0;
float b = 0;
uint8_t i = hsb.h / 60; uint8_t i = hsb.h / 60;
float v = hsb.b / ((float)BRT_MAX); float v = hsb.b / ((float)BRT_MAX);