samples: boards: reel_board: mesh_badge: initialize epd at compile time

Initialize epd device at compile time, so we can constify epd device
pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-08-17 13:37:36 +02:00 committed by Carles Cufí
commit 7fc33f9d47

View file

@ -49,7 +49,7 @@ struct font_info {
#define STAT_COUNT 128
static const struct device *epd_dev;
static const struct device *const epd_dev = DEVICE_DT_GET_ONE(solomon_ssd16xxfb);
static bool pressed;
static uint8_t screen_id = SCREEN_MAIN;
static struct k_work_delayable epd_work;
@ -580,7 +580,6 @@ void board_refresh_display(void)
int board_init(void)
{
epd_dev = DEVICE_DT_GET_ONE(solomon_ssd16xxfb);
if (!device_is_ready(epd_dev)) {
printk("%s: device not ready.\n", epd_dev->name);
return -ENODEV;