diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-08-30 00:35:11 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-08-30 00:35:11 +0100 |
| commit | ecc88e949ca5e307d22da4605a40d39ea2df9e3b (patch) | |
| tree | a2399541ebd9f2e8b2141805dc39473891be6456 /stmhal/servo.c | |
| parent | 4d3fc4632681576eed8235f8b90b49a032c80218 (diff) | |
Change some parts of the core API to use mp_uint_t instead of uint/int.
Addressing issue #50, still some way to go yet.
Diffstat (limited to 'stmhal/servo.c')
| -rw-r--r-- | stmhal/servo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/stmhal/servo.c b/stmhal/servo.c index 8cd0a4ef7..60ba217a9 100644 --- a/stmhal/servo.c +++ b/stmhal/servo.c @@ -189,7 +189,7 @@ STATIC void pyb_servo_print(void (*print)(void *env, const char *fmt, ...), void /// \classmethod \constructor(id) /// Create a servo object. `id` is 1-4. -STATIC mp_obj_t pyb_servo_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) { +STATIC mp_obj_t pyb_servo_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { // check arguments mp_arg_check_num(n_args, n_kw, 1, 1, false); @@ -212,7 +212,7 @@ STATIC mp_obj_t pyb_servo_make_new(mp_obj_t type_in, uint n_args, uint n_kw, con /// \method pulse_width([value]) /// Get or set the pulse width in milliseconds. -STATIC mp_obj_t pyb_servo_pulse_width(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t pyb_servo_pulse_width(mp_uint_t n_args, const mp_obj_t *args) { pyb_servo_obj_t *self = args[0]; if (n_args == 1) { // get pulse width, in us @@ -230,7 +230,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_servo_pulse_width_obj, 1, 2, pyb_ /// \method calibration([pulse_min, pulse_max, pulse_centre, [pulse_angle_90, pulse_speed_100]]) /// Get or set the calibration of the servo timing. // TODO should accept 1 arg, a 5-tuple of values to set -STATIC mp_obj_t pyb_servo_calibration(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t pyb_servo_calibration(mp_uint_t n_args, const mp_obj_t *args) { pyb_servo_obj_t *self = args[0]; if (n_args == 1) { // get calibration values @@ -265,7 +265,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_servo_calibration_obj, 1, 6, pyb_ /// /// - `angle` is the angle to move to in degrees. /// - `time` is the number of milliseconds to take to get to the specified angle. -STATIC mp_obj_t pyb_servo_angle(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t pyb_servo_angle(mp_uint_t n_args, const mp_obj_t *args) { pyb_servo_obj_t *self = args[0]; if (n_args == 1) { // get angle @@ -295,7 +295,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_servo_angle_obj, 1, 3, pyb_servo_ /// /// - `speed` is the speed to move to change to, between -100 and 100. /// - `time` is the number of milliseconds to take to get to the specified speed. -STATIC mp_obj_t pyb_servo_speed(uint n_args, const mp_obj_t *args) { +STATIC mp_obj_t pyb_servo_speed(mp_uint_t n_args, const mp_obj_t *args) { pyb_servo_obj_t *self = args[0]; if (n_args == 1) { // get speed |
