Skip to content

Commit

Permalink
fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
noahp committed Feb 3, 2024
1 parent f103963 commit 95c8284
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/debug_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ int memfault_platform_get_stateofcharge(sMfltPlatformBatterySoc *soc)
err = adp536x_fg_soc(&percentage);
if (err) {
LOG_ERR("Failed to get battery level: %d", err);
return err;
return -1;
}

const int discharging = prv_adp536x_is_discharging();
Expand Down Expand Up @@ -458,12 +458,12 @@ void memfault_metrics_heartbeat_collect_data(void)

uint16_t millivolts;
err = adp536x_fg_volts(&millivolts);
if (err) {
if (err == 0) {
memfault_metrics_heartbeat_set_unsigned(MEMFAULT_METRICS_KEY(battery_voltage_mv),
millivolts);
} else {
LOG_ERR("Failed to get battery voltage: %d", err);
return;
}
memfault_metrics_heartbeat_set_unsigned(MEMFAULT_METRICS_KEY(battery_voltage_mv),
millivolts);

/* Standard NCS metrics */
memfault_ncs_metrics_collect_data();
Expand Down

0 comments on commit 95c8284

Please sign in to comment.