From f90fe30a0f93ce942e89bb1016b42f0b2139256a Mon Sep 17 00:00:00 2001 From: Rene Date: Wed, 4 Sep 2024 21:14:18 +0200 Subject: [PATCH] Minor fix: add != NULL --- src/esp32_smartdisplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esp32_smartdisplay.c b/src/esp32_smartdisplay.c index ccf1809..66aa05d 100644 --- a/src/esp32_smartdisplay.c +++ b/src/esp32_smartdisplay.c @@ -94,11 +94,11 @@ void smartdisplay_lcd_set_brightness_cb(smartdisplay_lcd_adaptive_brightness_cb_ log_v("adaptive_brightness_cb:0x%08x, interval:%u", cb, interval); // Delete current timer if any - if (update_brightness_timer) + if (update_brightness_timer != NULL) lv_timer_del(update_brightness_timer); // Use callback for intensity or 50% default - if (cb && interval > 0) + if (cb != NULL && interval > 0) update_brightness_timer = lv_timer_create(adaptive_brightness, interval, cb); else smartdisplay_lcd_set_backlight(0.5f);