From 62f48fe17079dab4dd4e12897cb128a9524caff8 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sun, 29 Jul 2018 12:43:42 +0200 Subject: [PATCH] unbreak firmware build without u8g2 submodule --- app/modules/u8g2.c | 8 ++++++++ app/platform/u8x8_nodemcu_hal.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/app/modules/u8g2.c b/app/modules/u8g2.c index 9bdf8496..b613b5ea 100644 --- a/app/modules/u8g2.c +++ b/app/modules/u8g2.c @@ -1,6 +1,12 @@ // Module for binding the u8g2 library // Note: This file is intended to be shared between esp8266 and esp32 platform +// Do not use the code from u8g2 submodule and skip the complete source here +// if the u8g2 module is not selected. +// Reason: The whole u8g2 submodule code tree might not even exist in this case. +#include "user_modules.h" +#if defined(LUA_USE_MODULES_U8G2) || defined(ESP_PLATFORM) + #include "module.h" #include "lauxlib.h" @@ -806,3 +812,5 @@ int luaopen_u8g2( lua_State *L ) { } NODEMCU_MODULE(U8G2, "u8g2", lu8g2_map, luaopen_u8g2); + +#endif /* defined(LUA_USE_MODULES_U8G2) || defined(ESP_PLATFORM) */ diff --git a/app/platform/u8x8_nodemcu_hal.c b/app/platform/u8x8_nodemcu_hal.c index fee13381..ab78bf36 100644 --- a/app/platform/u8x8_nodemcu_hal.c +++ b/app/platform/u8x8_nodemcu_hal.c @@ -1,4 +1,10 @@ +// Do not use the code from u8g2 submodule and skip the complete source here +// if the u8g2 module is not selected. +// Reason: The whole u8g2 submodule code tree might not even exist in this case. +#include "user_modules.h" +#ifdef LUA_USE_MODULES_U8G2 + #include #include "c_stdlib.h" @@ -281,3 +287,5 @@ uint8_t u8x8_byte_nodemcu_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void * return 1; } + +#endif /* LUA_USE_MODULES_U8G2 */