Skip to content

Commit ae177ea

Browse files
committed
pbio/battery: Update docstrings.
1 parent eeee4be commit ae177ea

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/pbio/src/battery.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ static int32_t battery_voltage_avg_scaled;
2121
// to reduce rounding errors in the moving average.
2222
#define SCALE (1024)
2323

24-
// Initializes average to first measurement.
24+
/**
25+
* Initializes battery voltage state to first measurement.
26+
*
27+
* @return Error code.
28+
*/
2529
pbio_error_t pbio_battery_init(void) {
2630

2731
// Get battery voltage.
@@ -37,7 +41,11 @@ pbio_error_t pbio_battery_init(void) {
3741
return PBIO_SUCCESS;
3842
}
3943

40-
// Updates the average voltage.
44+
/**
45+
* Updates the average voltage using a new measurement.
46+
*
47+
* @return Error code.
48+
*/
4149
pbio_error_t pbio_battery_update(void) {
4250

4351
// Get battery voltage.
@@ -53,7 +61,11 @@ pbio_error_t pbio_battery_update(void) {
5361
return PBIO_SUCCESS;
5462
}
5563

56-
// Gets the moving average value.
64+
/**
65+
* Gets the moving average battery voltage.
66+
*
67+
* @return The voltage in mV.
68+
*/
5769
int32_t pbio_battery_get_average_voltage(void) {
5870
return battery_voltage_avg_scaled / SCALE;
5971
}

0 commit comments

Comments
 (0)