forked from kofal.net/zmk
fix(behaviors): Prevent accidental transparent behavior return values.
Needed because k_work_reschedule can return positive success codes.
This commit is contained in:
@@ -50,7 +50,8 @@ static struct k_work_delayable ext_power_save_work;
|
|||||||
|
|
||||||
int ext_power_save_state() {
|
int ext_power_save_state() {
|
||||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||||
return k_work_reschedule(&ext_power_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
int ret = k_work_reschedule(&ext_power_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||||
|
return MIN(ret, 0);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ static int zmk_rgb_underglow_init(const struct device *_arg) {
|
|||||||
|
|
||||||
int zmk_rgb_underglow_save_state() {
|
int zmk_rgb_underglow_save_state() {
|
||||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||||
return k_work_reschedule(&underglow_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
int ret = k_work_reschedule(&underglow_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||||
|
return MIN(ret, 0);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user