extmod/modrobotics: rename start back to drive
This is done for two reasons.
This command is typically used in a loop for e.g. line following. In this context, start does not make sense.
There are going to be two additional 'start'-like methods, so we can't use this generic name.
@@ -62,8 +62,8 @@ STATIC mp_obj_t robotics_DriveBase_make_new(const mp_obj_type_t *type, size_t n_
return MP_OBJ_FROM_PTR(self);
}
-// pybricks.robotics.DriveBase.start
-STATIC mp_obj_t robotics_DriveBase_start(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
+// pybricks.robotics.DriveBase.drive
+STATIC mp_obj_t robotics_DriveBase_drive(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
PB_PARSE_ARGS_METHOD(n_args, pos_args, kw_args,
robotics_DriveBase_obj_t, self,
PB_ARG_REQUIRED(speed),
@@ -78,7 +78,7 @@ STATIC mp_obj_t robotics_DriveBase_start(size_t n_args, const mp_obj_t *pos_args
return mp_const_none;
}
-STATIC MP_DEFINE_CONST_FUN_OBJ_KW(robotics_DriveBase_start_obj, 0, robotics_DriveBase_start);
+STATIC MP_DEFINE_CONST_FUN_OBJ_KW(robotics_DriveBase_drive_obj, 0, robotics_DriveBase_drive);
// pybricks.robotics.DriveBase.stop
STATIC mp_obj_t robotics_DriveBase_stop(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
@@ -98,7 +98,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(robotics_DriveBase_stop_obj, 0, robotics_Drive
STATIC const mp_rom_map_elem_t robotics_DriveBase_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_left), MP_ROM_ATTRIBUTE_OFFSET(robotics_DriveBase_obj_t, left) },
{ MP_ROM_QSTR(MP_QSTR_right), MP_ROM_ATTRIBUTE_OFFSET(robotics_DriveBase_obj_t, right) },
- { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&robotics_DriveBase_start_obj) },
+ { MP_ROM_QSTR(MP_QSTR_drive), MP_ROM_PTR(&robotics_DriveBase_drive_obj) },
{ MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&robotics_DriveBase_stop_obj) },
{ MP_ROM_QSTR(MP_QSTR_log), MP_ROM_ATTRIBUTE_OFFSET(robotics_DriveBase_obj_t, logger) },
};
