Skip to content

Commit

Permalink
drivers/lcd: assert controller-specific init function
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Sep 6, 2023
1 parent 253d286 commit d767ed4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/lcd/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,9 @@ int lcd_init(lcd_t *dev, const lcd_params_t *params)
}
ztimer_sleep(ZTIMER_MSEC, 120);

if (dev->driver->init) {
return dev->driver->init(dev, params);
}
else {
return -ENOTSUP;
}
/* controller-specific init function has to be defined */
assert(dev->driver->init);
return dev->driver->init(dev, params);
}

void lcd_write_cmd(const lcd_t *dev, uint8_t cmd, const uint8_t *data,
Expand Down

0 comments on commit d767ed4

Please sign in to comment.