diff --git a/app/.gitignore b/app/.gitignore index 2e2287fd..c6d8ed75 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,2 +1,3 @@ *.output* +mapfile !.gitignore diff --git a/app/include/user_config.h b/app/include/user_config.h index f3f36494..818a84c5 100644 --- a/app/include/user_config.h +++ b/app/include/user_config.h @@ -1,14 +1,6 @@ #ifndef __USER_CONFIG_H__ #define __USER_CONFIG_H__ -#define NODE_VERSION_MAJOR 0U -#define NODE_VERSION_MINOR 9U -#define NODE_VERSION_REVISION 5U -#define NODE_VERSION_INTERNAL 0U - -#define NODE_VERSION "NodeMCU 0.9.5" -#define BUILD_DATE "build 20150214" - // #define DEVKIT_VERSION_0_9 1 // define this only if you use NodeMCU devkit v0.9 // #define FLASH_512K @@ -51,33 +43,6 @@ // #define BUILD_WOFS 1 #define BUILD_SPIFFS 1 -#define LUA_USE_MODULES - -#ifdef LUA_USE_MODULES -#define LUA_USE_MODULES_NODE -#define LUA_USE_MODULES_FILE -#define LUA_USE_MODULES_GPIO -#define LUA_USE_MODULES_WIFI -#define LUA_USE_MODULES_NET -#define LUA_USE_MODULES_PWM -#define LUA_USE_MODULES_I2C -#define LUA_USE_MODULES_SPI -#define LUA_USE_MODULES_TMR -#define LUA_USE_MODULES_ADC -#define LUA_USE_MODULES_UART -#define LUA_USE_MODULES_OW -#define LUA_USE_MODULES_BIT -#define LUA_USE_MODULES_U8G -#define LUA_USE_MODULES_MQTT -#define LUA_USE_MODULES_WS2812 // TODO: put this device specific module to device driver section. -#endif /* LUA_USE_MODULES */ - -// TODO: put device specific module to device driver section. -#ifdef LUA_USE_DEVICE_DRIVER -#define LUA_USE_DEVICE_WS2812 -#endif /* LUA_USE_DEVICE_DRIVER */ - - // #define LUA_NUMBER_INTEGRAL #define LUA_OPTRAM @@ -99,7 +64,6 @@ #define LED_LOW_COUNT_DEFAULT 0 #endif - // Configure U8glib fonts // add a U8G_FONT_TABLE_ENTRY for each font you want to compile into the image #define U8G_FONT_TABLE_ENTRY(font) diff --git a/app/include/user_modules.h b/app/include/user_modules.h new file mode 100644 index 00000000..7c71b11b --- /dev/null +++ b/app/include/user_modules.h @@ -0,0 +1,25 @@ +#ifndef __USER_MODULES_H__ +#define __USER_MODULES_H__ + +#define LUA_USE_MODULES + +#ifdef LUA_USE_MODULES +#define LUA_USE_MODULES_NODE +#define LUA_USE_MODULES_FILE +#define LUA_USE_MODULES_GPIO +#define LUA_USE_MODULES_WIFI +#define LUA_USE_MODULES_NET +#define LUA_USE_MODULES_PWM +#define LUA_USE_MODULES_I2C +#define LUA_USE_MODULES_SPI +#define LUA_USE_MODULES_TMR +#define LUA_USE_MODULES_ADC +#define LUA_USE_MODULES_UART +#define LUA_USE_MODULES_OW +#define LUA_USE_MODULES_BIT +#define LUA_USE_MODULES_U8G +#define LUA_USE_MODULES_MQTT +#define LUA_USE_MODULES_WS2812 +#endif /* LUA_USE_MODULES */ + +#endif /* __USER_MODULES_H__ */ diff --git a/app/include/user_version.h b/app/include/user_version.h new file mode 100644 index 00000000..c1144958 --- /dev/null +++ b/app/include/user_version.h @@ -0,0 +1,12 @@ +#ifndef __USER_VERSION_H__ +#define __USER_VERSION_H__ + +#define NODE_VERSION_MAJOR 0U +#define NODE_VERSION_MINOR 9U +#define NODE_VERSION_REVISION 5U +#define NODE_VERSION_INTERNAL 0U + +#define NODE_VERSION "NodeMCU 0.9.5" +#define BUILD_DATE "build 20150306" + +#endif /* __USER_VERSION_H__ */ diff --git a/app/lua/lua.c b/app/lua/lua.c index 27bb3b4b..d7d14f40 100644 --- a/app/lua/lua.c +++ b/app/lua/lua.c @@ -10,6 +10,7 @@ #include "c_stdlib.h" #include "c_string.h" #include "flash_fs.h" +#include "user_version.h" #define lua_c diff --git a/app/lua/linit.c b/app/modules/linit.c similarity index 98% rename from app/lua/linit.c rename to app/modules/linit.c index 872321ef..a182a853 100644 --- a/app/lua/linit.c +++ b/app/modules/linit.c @@ -15,6 +15,8 @@ #include "lrotable.h" #include "luaconf.h" +#include "user_modules.h" + #if defined(LUA_USE_MODULES) #include "modules.h" #endif diff --git a/app/modules/node.c b/app/modules/node.c index 90dd0d96..0384d798 100644 --- a/app/modules/node.c +++ b/app/modules/node.c @@ -23,6 +23,7 @@ #include "user_interface.h" #include "flash_api.h" #include "flash_fs.h" +#include "user_version.h" // Lua: restart() static int node_restart( lua_State* L )