Skip to content

Commit 5a491de

Browse files
committed
pbio/src/integrator: fix parameter direction
`[in,out]` would mean than the when the function returns, `*itg` could point to a different instance from the one that was passed in (only possible if passed as `**itg`). So this is an `[in]` parameter. The fact that `*itg` does not have a `const` qualifier tells us that the instance state could be modified.
1 parent 42a1a06 commit 5a491de

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/pbio/src/integrator.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* Pauses the speed integrator at the current position error.
1717
*
18-
* @param [inout] itg Speed integrator instance.
18+
* @param [in] itg Speed integrator instance.
1919
* @param [in] time_now The wall time (ticks).
2020
* @param [in] position_error Current position error (control units).
2121
*/
@@ -39,7 +39,7 @@ void pbio_speed_integrator_pause(pbio_speed_integrator_t *itg, uint32_t time_now
3939
/**
4040
* Resumes the speed integrator from the current position error.
4141
*
42-
* @param [inout] itg Speed integrator instance.
42+
* @param [in] itg Speed integrator instance.
4343
* @param [in] position_error Current position error (control units).
4444
*/
4545
void pbio_speed_integrator_resume(pbio_speed_integrator_t *itg, int32_t position_error) {
@@ -60,7 +60,7 @@ void pbio_speed_integrator_resume(pbio_speed_integrator_t *itg, int32_t position
6060
/**
6161
* Resets the speed integrator state.
6262
*
63-
* @param [inout] itg Speed integrator instance.
63+
* @param [in] itg Speed integrator instance.
6464
* @param [in] settings Control settings instance from which to read stall settings.
6565
*/
6666
void pbio_speed_integrator_reset(pbio_speed_integrator_t *itg, pbio_control_settings_t *settings) {
@@ -150,7 +150,7 @@ uint32_t pbio_position_integrator_get_ref_time(pbio_position_integrator_t *itg,
150150
/**
151151
* Pauses the position integrator at the current time.
152152
*
153-
* @param [inout] itg Speed integrator instance.
153+
* @param [in] itg Speed integrator instance.
154154
* @param [in] time_now The wall time (ticks).
155155
*/
156156
void pbio_position_integrator_pause(pbio_position_integrator_t *itg, uint32_t time_now) {
@@ -168,7 +168,7 @@ void pbio_position_integrator_pause(pbio_position_integrator_t *itg, uint32_t ti
168168
/**
169169
* Tests if the position integrator is paused.
170170
*
171-
* @param [inout] itg Speed integrator instance.
171+
* @param [in] itg Speed integrator instance.
172172
* @return True if integration is paused, false if not.
173173
*/
174174
bool pbio_position_integrator_is_paused(pbio_position_integrator_t *itg) {
@@ -178,7 +178,7 @@ bool pbio_position_integrator_is_paused(pbio_position_integrator_t *itg) {
178178
/**
179179
* Resumes the position integrator at the current time.
180180
*
181-
* @param [inout] itg Speed integrator instance.
181+
* @param [in] itg Speed integrator instance.
182182
* @param [in] time_now The wall time (ticks).
183183
*/
184184
void pbio_position_integrator_resume(pbio_position_integrator_t *itg, uint32_t time_now) {
@@ -198,7 +198,7 @@ void pbio_position_integrator_resume(pbio_position_integrator_t *itg, uint32_t t
198198
/**
199199
* Resets the position integrator state.
200200
*
201-
* @param [inout] itg Speed integrator instance.
201+
* @param [in] itg Speed integrator instance.
202202
* @param [in] settings Control settings instance from which to read stall settings.
203203
* @param [in] time_now The wall time (ticks).
204204
*/

lib/pbio/src/servo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static pbio_error_t pbio_servo_stop_from_dcmotor(void *servo, bool clear_parent)
214214
/**
215215
* Loads all parameters of a servo to make it ready for use.
216216
*
217-
* @param [inout] srv The servo instance.
217+
* @param [in] srv The servo instance.
218218
* @param [in] gear_ratio Ratio that converts control units (mdeg) to user-defined output units (e.g. deg).
219219
* @param [in] precision_profile Position tolerance around target in degrees. Set to 0 to load default profile for this motor.
220220
* @return Error code.

0 commit comments

Comments
 (0)