File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
ports/raspberrypi/common-hal/pwmio Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -123,12 +123,6 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
123
123
uint16_t duty ,
124
124
uint32_t frequency ,
125
125
bool variable_frequency ) {
126
- self -> pin = pin ;
127
- self -> variable_frequency = variable_frequency ;
128
- self -> duty_cycle = duty ;
129
-
130
- claim_pin (pin );
131
-
132
126
if (frequency == 0 || frequency > (common_hal_mcu_processor_get_frequency () / 2 )) {
133
127
return PWMOUT_INVALID_FREQUENCY ;
134
128
}
@@ -141,6 +135,11 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
141
135
return r ;
142
136
}
143
137
138
+ claim_pin (pin );
139
+
140
+ self -> pin = pin ;
141
+ self -> variable_frequency = variable_frequency ;
142
+ self -> duty_cycle = duty ;
144
143
self -> slice = slice ;
145
144
self -> ab_channel = ab_channel ;
146
145
You can’t perform that action at this time.
0 commit comments