@@ -157,7 +157,7 @@ STATIC mp_obj_t await_or_wait(common_Motor_obj_t *self) {
157157 common_Motor_test_completion ,
158158 pb_type_awaitable_return_none ,
159159 common_Motor_cancel ,
160- PB_TYPE_AWAITABLE_CANCEL_LINKED );
160+ PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
161161}
162162
163163// pybricks._common.Motor.angle
@@ -184,7 +184,7 @@ STATIC mp_obj_t common_Motor_reset_angle(size_t n_args, const mp_obj_t *pos_args
184184
185185 // Set the new angle
186186 pb_assert (pbio_servo_reset_angle (self -> srv , reset_angle , reset_to_abs ));
187- pb_type_awaitable_cancel_all ( MP_OBJ_FROM_PTR ( self ), self -> awaitables , PB_TYPE_AWAITABLE_CANCEL_LINKED );
187+ pb_type_awaitable_update_all ( self -> awaitables , PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
188188 return mp_const_none ;
189189}
190190STATIC MP_DEFINE_CONST_FUN_OBJ_KW (common_Motor_reset_angle_obj , 1 , common_Motor_reset_angle );
@@ -209,7 +209,7 @@ STATIC mp_obj_t common_Motor_run(size_t n_args, const mp_obj_t *pos_args, mp_map
209209
210210 mp_int_t speed = pb_obj_get_int (speed_in );
211211 pb_assert (pbio_servo_run_forever (self -> srv , speed ));
212- pb_type_awaitable_cancel_all ( MP_OBJ_FROM_PTR ( self ), self -> awaitables , PB_TYPE_AWAITABLE_CANCEL_LINKED );
212+ pb_type_awaitable_update_all ( self -> awaitables , PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
213213 return mp_const_none ;
214214}
215215STATIC MP_DEFINE_CONST_FUN_OBJ_KW (common_Motor_run_obj , 1 , common_Motor_run );
@@ -218,7 +218,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(common_Motor_run_obj, 1, common_Motor_run);
218218STATIC mp_obj_t common_Motor_hold (mp_obj_t self_in ) {
219219 common_Motor_obj_t * self = MP_OBJ_TO_PTR (self_in );
220220 pb_assert (pbio_servo_stop (self -> srv , PBIO_CONTROL_ON_COMPLETION_HOLD ));
221- pb_type_awaitable_cancel_all ( self_in , self -> awaitables , PB_TYPE_AWAITABLE_CANCEL_LINKED );
221+ pb_type_awaitable_update_all ( self -> awaitables , PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
222222 return mp_const_none ;
223223}
224224MP_DEFINE_CONST_FUN_OBJ_1 (common_Motor_hold_obj , common_Motor_hold );
@@ -291,7 +291,7 @@ STATIC mp_obj_t common_Motor_run_until_stalled(size_t n_args, const mp_obj_t *po
291291 common_Motor_test_completion ,
292292 common_Motor_stall_return_value ,
293293 common_Motor_cancel ,
294- PB_TYPE_AWAITABLE_CANCEL_LINKED );
294+ PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
295295}
296296STATIC MP_DEFINE_CONST_FUN_OBJ_KW (common_Motor_run_until_stalled_obj , 1 , common_Motor_run_until_stalled );
297297
@@ -353,7 +353,7 @@ STATIC mp_obj_t common_Motor_track_target(size_t n_args, const mp_obj_t *pos_arg
353353
354354 mp_int_t target_angle = pb_obj_get_int (target_angle_in );
355355 pb_assert (pbio_servo_track_target (self -> srv , target_angle ));
356- pb_type_awaitable_cancel_all ( MP_OBJ_FROM_PTR ( self ), self -> awaitables , PB_TYPE_AWAITABLE_CANCEL_LINKED );
356+ pb_type_awaitable_update_all ( self -> awaitables , PB_TYPE_AWAITABLE_OPT_CANCEL_ALL );
357357 return mp_const_none ;
358358}
359359STATIC MP_DEFINE_CONST_FUN_OBJ_KW (common_Motor_track_target_obj , 1 , common_Motor_track_target );
0 commit comments