Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix compiler warnings #2255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joelspadin
Copy link
Collaborator

Fixed some various compiler warnings.

@joelspadin joelspadin requested a review from a team as a code owner April 6, 2024 02:48
@@ -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) {
const struct ksbb_config *cfg = dev->config;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this is being removed. It would seem to cause any builds that configure hardware soft-off to fail (e.g. west build -p -b nrf52840dk_nrf52840 -- -DSHIELD=zmk_uno)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems like it could be condensed:

diff --git a/app/src/display/widgets/layer_status.c b/app/src/display/widgets/layer_status.c
index 70e54ee4..4f462d70 100644
--- a/app/src/display/widgets/layer_status.c
+++ b/app/src/display/widgets/layer_status.c
@@ -23,19 +23,15 @@ struct layer_status_state {
 };
 
 static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
-    if (state.label == NULL) {
-        char text[16] = {};
+    char text[16] = {};
 
+    if (state.label == NULL) {
         snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);
-
-        lv_label_set_text(label, text);
     } else {
-        char text[16] = {};
-
         snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %s", state.label);
-
-        lv_label_set_text(label, text);
     }
+
+    lv_label_set_text(label, text);
 }
 
 static void layer_status_update_cb(struct layer_status_state state) {

@petejohanson petejohanson self-assigned this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants