Skip to content

Commit

Permalink
Minor fix: add != NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rzeldent committed Sep 4, 2024
1 parent 561c6b7 commit f90fe30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/esp32_smartdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f90fe30

Please sign in to comment.