chore: Various soft-off review fixes

* Code style to avoid goto.
* Enable pm.c compilation via dedicated Kconfig flag.
* Comment wakeup trigger PM behavior.
This commit is contained in:
Pete Johanson
2023-12-29 15:03:14 -08:00
parent fceb0351a5
commit 5ebe924e94
6 changed files with 26 additions and 12 deletions

View File

@@ -15,6 +15,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/endpoints.h>
#if IS_ENABLED(CONFIG_ZMK_PM_SOFT_OFF)
#define HAS_WAKERS DT_HAS_COMPAT_STATUS_OKAY(zmk_soft_off_wakeup_sources)
#if HAS_WAKERS
@@ -63,3 +65,5 @@ int zmk_pm_soft_off(void) {
LOG_DBG("soft-off: go to sleep");
return pm_state_force(0U, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
}
#endif // IS_ENABLED(CONFIG_ZMK_PM_SOFT_OFF)