Skip to content

Commit bc17a07

Browse files
committed
pbio/dcmotor: Move type-id dependent values to settings file.
This is just like the servo settings, so move it there.
1 parent c9cdb30 commit bc17a07

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/pbio/src/dcmotor.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,6 @@ void pbio_dcmotor_get_state(pbio_dcmotor_t *dcmotor, pbio_dcmotor_actuation_t *a
140140
*voltage_now = dcmotor->voltage_now;
141141
}
142142

143-
/**
144-
* Gets the maximum allowed voltage for a motor.
145-
*
146-
* @param [in] id Device type id.
147-
* @return Maximum voltage (mV) for the given motor type.
148-
*/
149-
int32_t pbio_dcmotor_get_max_voltage(pbio_iodev_type_id_t id) {
150-
if (id == PBIO_IODEV_TYPE_ID_SPIKE_S_MOTOR) {
151-
return 6000;
152-
}
153-
return 9000;
154-
}
155-
156143
/**
157144
* Coasts the dc motor.
158145
*

lib/pbio/src/motor/servo_settings.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@ static const pbio_observer_model_t model_ev3_m = {
212212

213213
#endif // PBIO_CONFIG_SERVO_EV3_NXT
214214

215+
/**
216+
* Gets the maximum allowed voltage for a dc motor.
217+
*
218+
* @param [in] id Device type id.
219+
* @return Maximum voltage (mV) for the given motor type.
220+
*/
221+
int32_t pbio_dcmotor_get_max_voltage(pbio_iodev_type_id_t id) {
222+
if (id == PBIO_IODEV_TYPE_ID_SPIKE_S_MOTOR) {
223+
return 6000;
224+
}
225+
return 9000;
226+
}
227+
215228
#define DEG_TO_MDEG(deg) ((deg) * 1000)
216229

217230
/**

0 commit comments

Comments
 (0)