@@ -471,10 +471,10 @@ typedef struct {
471
471
STATIC mp_obj_t pb_xbox_rumble (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
472
472
PB_PARSE_ARGS_METHOD (n_args , pos_args , kw_args ,
473
473
pb_type_xbox_obj_t , self ,
474
- PB_ARG_REQUIRED (power ),
475
- PB_ARG_REQUIRED (duration ),
476
- PB_ARG_REQUIRED (delay ),
477
- PB_ARG_REQUIRED (count )
474
+ PB_ARG_DEFAULT_INT (power , 100 ),
475
+ PB_ARG_DEFAULT_INT (duration , 200 ),
476
+ PB_ARG_DEFAULT_INT (delay , 100 ),
477
+ PB_ARG_DEFAULT_INT (count , 1 )
478
478
);
479
479
480
480
(void )self ;
@@ -488,6 +488,11 @@ STATIC mp_obj_t pb_xbox_rumble(size_t n_args, const mp_obj_t *pos_args, mp_map_t
488
488
// Number of rumbles, capped at 100.
489
489
mp_int_t count = pb_obj_get_pct (count_in );
490
490
491
+ // Don't prefix delay if there is only one rumble.
492
+ if (count == 1 ) {
493
+ delay = 0 ;
494
+ }
495
+
491
496
// User order is left, right, left trigger, right trigger.
492
497
int8_t intensity [4 ];
493
498
pb_obj_get_pct_or_array (power_in , 4 , intensity );
0 commit comments