@@ -77,11 +77,11 @@ STATIC machine_pwm_config_t hard_configs[MP_ARRAY_SIZE(machine_hard_pwm_instance
7777
7878STATIC const machine_hard_pwm_obj_t machine_hard_pwm_obj [] = {
7979#if defined(NRF52_SERIES )
80- {{& machine_hard_pwm_type }, .p_pwm = & machine_hard_pwm_instances [0 ], .p_config = & hard_configs [0 ]},
81- {{& machine_hard_pwm_type }, .p_pwm = & machine_hard_pwm_instances [1 ], .p_config = & hard_configs [1 ]},
82- {{& machine_hard_pwm_type }, .p_pwm = & machine_hard_pwm_instances [2 ], .p_config = & hard_configs [2 ]},
80+ {{& machine_pwm_type }, .p_pwm = & machine_hard_pwm_instances [0 ], .p_config = & hard_configs [0 ]},
81+ {{& machine_pwm_type }, .p_pwm = & machine_hard_pwm_instances [1 ], .p_config = & hard_configs [1 ]},
82+ {{& machine_pwm_type }, .p_pwm = & machine_hard_pwm_instances [2 ], .p_config = & hard_configs [2 ]},
8383#if NRF52840
84- {{& machine_hard_pwm_type }, .p_pwm = & machine_hard_pwm_instances [3 ], .p_config = & hard_configs [3 ]},
84+ {{& machine_pwm_type }, .p_pwm = & machine_hard_pwm_instances [3 ], .p_config = & hard_configs [3 ]},
8585#endif
8686#endif
8787};
@@ -155,7 +155,7 @@ STATIC mp_obj_t machine_pwm_init(size_t n_args, const mp_obj_t *pos_args, mp_map
155155 mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
156156
157157 // dispatch to specific implementation
158- if (mp_obj_get_type (self ) == & machine_hard_pwm_type ) {
158+ if (mp_obj_get_type (self ) == & machine_pwm_type ) {
159159 machine_hard_pwm_init (self , args );
160160 }
161161
@@ -165,7 +165,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_pwm_init_obj, 1, machine_pwm_init);
165165
166166STATIC mp_obj_t machine_pwm_deinit (mp_obj_t self ) {
167167 // dispatch to specific implementation
168- if (mp_obj_get_type (self ) == & machine_hard_pwm_type ) {
168+ if (mp_obj_get_type (self ) == & machine_pwm_type ) {
169169 machine_hard_pwm_deinit (self );
170170 }
171171 return mp_const_none ;
@@ -182,7 +182,7 @@ STATIC mp_obj_t machine_pwm_freq(size_t n_args, const mp_obj_t *pos_args, mp_map
182182 mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
183183 mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
184184
185- if (mp_obj_get_type (self ) == & machine_hard_pwm_type ) {
185+ if (mp_obj_get_type (self ) == & machine_pwm_type ) {
186186 machine_hard_pwm_freq (self , args );
187187 } else {
188188 // soft pwm
@@ -340,7 +340,7 @@ STATIC mp_obj_t machine_hard_pwm_freq(mp_obj_t self_in, mp_arg_val_t *args) {
340340}
341341
342342MP_DEFINE_CONST_OBJ_TYPE (
343- machine_hard_pwm_type ,
343+ machine_pwm_type ,
344344 MP_QSTR_PWM ,
345345 MP_TYPE_FLAG_NONE ,
346346 make_new , machine_pwm_make_new ,
0 commit comments