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

This commit is contained in:
funshine 2015-03-06 11:59:04 +08:00
parent c309ae4ce8
commit bbef457e50
7 changed files with 42 additions and 36 deletions

1
app/.gitignore vendored
View File

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

View File

@ -1,14 +1,6 @@
#ifndef __USER_CONFIG_H__ #ifndef __USER_CONFIG_H__
#define __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 DEVKIT_VERSION_0_9 1 // define this only if you use NodeMCU devkit v0.9
// #define FLASH_512K // #define FLASH_512K
@ -51,33 +43,6 @@
// #define BUILD_WOFS 1 // #define BUILD_WOFS 1
#define BUILD_SPIFFS 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_NUMBER_INTEGRAL
#define LUA_OPTRAM #define LUA_OPTRAM
@ -99,7 +64,6 @@
#define LED_LOW_COUNT_DEFAULT 0 #define LED_LOW_COUNT_DEFAULT 0
#endif #endif
// Configure U8glib fonts // Configure U8glib fonts
// add a U8G_FONT_TABLE_ENTRY for each font you want to compile into the image // add a U8G_FONT_TABLE_ENTRY for each font you want to compile into the image
#define U8G_FONT_TABLE_ENTRY(font) #define U8G_FONT_TABLE_ENTRY(font)

View File

@ -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__ */

View File

@ -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__ */

View File

@ -10,6 +10,7 @@
#include "c_stdlib.h" #include "c_stdlib.h"
#include "c_string.h" #include "c_string.h"
#include "flash_fs.h" #include "flash_fs.h"
#include "user_version.h"
#define lua_c #define lua_c

View File

@ -15,6 +15,8 @@
#include "lrotable.h" #include "lrotable.h"
#include "luaconf.h" #include "luaconf.h"
#include "user_modules.h"
#if defined(LUA_USE_MODULES) #if defined(LUA_USE_MODULES)
#include "modules.h" #include "modules.h"
#endif #endif

View File

@ -23,6 +23,7 @@
#include "user_interface.h" #include "user_interface.h"
#include "flash_api.h" #include "flash_api.h"
#include "flash_fs.h" #include "flash_fs.h"
#include "user_version.h"
// Lua: restart() // Lua: restart()
static int node_restart( lua_State* L ) static int node_restart( lua_State* L )