File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
ports/espressif/common-hal/pwmio Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 32
32
33
33
#define INDEX_EMPTY 0xFF
34
34
35
- STATIC bool not_first_reset = false;
36
35
STATIC uint32_t reserved_timer_freq [LEDC_TIMER_MAX ];
37
36
STATIC bool varfreq_timers [LEDC_TIMER_MAX ];
38
- STATIC uint8_t reserved_channels [LEDC_CHANNEL_MAX ];
37
+ STATIC uint8_t reserved_channels [LEDC_CHANNEL_MAX ] = { [ 0 ... LEDC_CHANNEL_MAX - 1 ] = INDEX_EMPTY } ;
39
38
STATIC bool never_reset_tim [LEDC_TIMER_MAX ];
40
39
STATIC bool never_reset_chan [LEDC_CHANNEL_MAX ];
41
40
@@ -56,7 +55,7 @@ STATIC uint32_t calculate_duty_cycle(uint32_t frequency) {
56
55
57
56
void pwmout_reset (void ) {
58
57
for (size_t i = 0 ; i < LEDC_CHANNEL_MAX ; i ++ ) {
59
- if (reserved_channels [i ] != INDEX_EMPTY && not_first_reset ) {
58
+ if (reserved_channels [i ] != INDEX_EMPTY ) {
60
59
ledc_stop (LEDC_LOW_SPEED_MODE , i , 0 );
61
60
}
62
61
if (!never_reset_chan [i ]) {
@@ -72,7 +71,6 @@ void pwmout_reset(void) {
72
71
varfreq_timers [i ] = false;
73
72
}
74
73
}
75
- not_first_reset = true;
76
74
}
77
75
78
76
pwmout_result_t common_hal_pwmio_pwmout_construct (pwmio_pwmout_obj_t * self ,
You can’t perform that action at this time.
0 commit comments