From 14727e01246f6575f0c1c834ace899523250250c Mon Sep 17 00:00:00 2001 From: arne Date: Sun, 5 Oct 2025 12:20:09 +0200 Subject: [PATCH] Prevent lua error when running `paper.init()` multiple times --- main/paper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/paper.c b/main/paper.c index e2c6c3f..8ab94f3 100644 --- a/main/paper.c +++ b/main/paper.c @@ -9,6 +9,9 @@ EpdiyHighlevelState hl; uint8_t* fb; static int init (lua_State *L) { + // prevent repeated initialization + if (fb != NULL) return 0; + epd_init(&epd_board_lilygo_t5_47, &ED047TC1, EPD_LUT_64K); // epd_set_vcom(1560); hl = epd_hl_init(WAVEFORM);