This commit is contained in:
2026-05-26 17:19:45 +02:00
parent 87cba0b419
commit 2d3ea34603
12 changed files with 239 additions and 17 deletions

View File

@@ -93,9 +93,23 @@ int main(void)
} else {
LOG_WRN("Battery info read failed: %d", batt_rc);
}
for (;;) {
k_sleep(K_SECONDS(5));
batt_rc = batt_mgmt_get_info(&batt_info);
if (batt_rc == 0) {
LOG_INF("Battery: %d mV, %u%%, level=%u, state=%s (%d)",
batt_info.voltage_mv,
batt_info.percent,
batt_info.level,
battery_state_to_str(batt_info.state),
batt_info.state);
} else {
LOG_WRN("Battery info read failed: %d", batt_rc);
}
}
#endif // CONFIG_BATT_MGMT
#endif // CONFIG_LOG
for (;;) {
int32_t rem_ms = k_sleep(K_FOREVER);
LOG_WRN("main woke unexpectedly (remaining=%d ms)", rem_ms);