Skip to content

Commit 6d988c6

Browse files
committed
esp32/machine_pwm.c: Use #if FADE.
Signed-off-by: Ihor Nehrutsa <[email protected]>
1 parent 4fa837b commit 6d988c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ports/esp32/machine_pwm.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
#define debug_printf(...) // mp_printf(&mp_plat_print, __VA_ARGS__); mp_printf(&mp_plat_print, " | %d at %s\n", __LINE__, __FILE__);
4444

45-
#define FADE
45+
#define FADE 1
4646

4747
// 10-bit user interface resolution compatible with esp8266 PWM.duty()
4848
#define UI_RES_10_BIT (10)
@@ -254,7 +254,7 @@ static void apply_duty(machine_pwm_obj_t *self) {
254254
}
255255
reconfigure_pin(self);
256256
} else {
257-
#ifdef FADE
257+
#if FADE
258258
check_esp_err(ledc_set_duty_and_update(self->mode, self->channel, self->channel_duty, 0));
259259
#else
260260
check_esp_err(ledc_set_duty(self->mode, self->channel, self->channel_duty));
@@ -658,7 +658,7 @@ static mp_obj_t mp_machine_pwm_make_new(const mp_obj_type_t *type,
658658
// start the PWM subsystem if it's not already running
659659
if (!pwm_inited) {
660660
pwm_init();
661-
#ifdef FADE
661+
#if FADE
662662
ledc_fade_func_install(0);
663663
#endif
664664
pwm_inited = true;

0 commit comments

Comments
 (0)