Skip to content

Commit

Permalink
fix(settings): Add missing err handlers on settings_register
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicell authored and petejohanson committed Dec 15, 2020
1 parent 2204a5d commit ae63ce5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/src/ext_power_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ static int ext_power_generic_init(const struct device *dev) {
#if IS_ENABLED(CONFIG_SETTINGS)
settings_subsys_init();

settings_register(&ext_power_conf);
int err = settings_register(&ext_power_conf);
if (err) {
LOG_ERR("Failed to register the ext_power settings handler (err %d)", err);
return err;
}

k_delayed_work_init(&ext_power_save_work, ext_power_save_state_work);

// Set default value (on) if settings isn't set
Expand Down
7 changes: 6 additions & 1 deletion app/src/rgb_underglow.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ static int zmk_rgb_underglow_init(const struct device *_arg) {
#if IS_ENABLED(CONFIG_SETTINGS)
settings_subsys_init();

settings_register(&rgb_conf);
int err = settings_register(&rgb_conf);
if (err) {
LOG_ERR("Failed to register the ext_power settings handler (err %d)", err);
return err;
}

k_delayed_work_init(&underglow_save_work, zmk_rgb_underglow_save_state_work);

settings_load_subtree("rgb/underglow");
Expand Down

0 comments on commit ae63ce5

Please sign in to comment.