Skip to content

Commit

Permalink
Update machine_pwm.c
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorNehrutsa committed Dec 20, 2024
1 parent d85a120 commit fba7b3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ports/esp32/machine_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#include "py/mpprint.h"

#define debug_printf(...) mp_printf(&mp_plat_print, __VA_ARGS__); mp_printf(&mp_plat_print, ", LINE=%d\n", __LINE__);
#define debug_printf(...) // mp_printf(&mp_plat_print, __VA_ARGS__); mp_printf(&mp_plat_print, ", LINE=%d\n", __LINE__);
/*
Set in micropython/ports/esp32/mpconfigport.h
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL + 1)
Expand Down Expand Up @@ -247,7 +247,7 @@ static void apply_duty(machine_pwm_obj_t *self) {
}
self->channel_duty = duty >> (UI_RES_16_BIT - timers[self->mode][self->timer].duty_resolution);

if ((chans[self->mode][self->channel].pin == -1) || (self->channel_duty == max_timer_duty)) {
if ((chans[self->mode][self->channel].pin == -1) || (self->channel_duty == 0) || (self->channel_duty == max_timer_duty)) {
// New PWM assignment
ledc_channel_config_t cfg = {
.channel = self->channel,
Expand Down

0 comments on commit fba7b3b

Please sign in to comment.