File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff 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+ */
2529pbio_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+ */
4149pbio_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+ */
5769int32_t pbio_battery_get_average_voltage (void ) {
5870 return battery_voltage_avg_scaled / SCALE ;
5971}
You can’t perform that action at this time.
0 commit comments