We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7ef942 commit 0f5c633Copy full SHA for 0f5c633
samples/boards/nordic/system_off/src/main.c
@@ -87,6 +87,19 @@ int main(void)
87
retained_update();
88
}
89
90
+ /* Wait until all logs are printed into console */
91
+ if (IS_ENABLED(CONFIG_PM_DEVICE) && IS_ENABLED(CONFIG_SERIAL)) {
92
+ static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
93
+ int err;
94
+ enum pm_device_state state;
95
+
96
+ if (dev) {
97
+ do {
98
+ err = pm_device_state_get(dev, &state);
99
+ } while ((err == 0) && (state == PM_DEVICE_STATE_ACTIVE));
100
+ }
101
102
103
sys_poweroff();
104
105
return 0;
0 commit comments