Browse Source

seperate user_config.h to speed-up compile when modules disabled/enabled

funshine 9 years ago
parent
commit
bbef457e50
7 changed files with 42 additions and 36 deletions
  1. 1 0
      app/.gitignore
  2. 0 36
      app/include/user_config.h
  3. 25 0
      app/include/user_modules.h
  4. 12 0
      app/include/user_version.h
  5. 1 0
      app/lua/lua.c
  6. 2 0
      app/modules/linit.c
  7. 1 0
      app/modules/node.c

+ 1 - 0
app/.gitignore

@@ -1,2 +1,3 @@
 *.output*
+mapfile
 !.gitignore

+ 0 - 36
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)

+ 25 - 0
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__ */

+ 12 - 0
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__ */

+ 1 - 0
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
 

+ 2 - 0
app/lua/linit.c → 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

+ 1 - 0
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 )