2014-12-22 12:35:05 +01:00
|
|
|
#ifndef __USER_CONFIG_H__
|
|
|
|
#define __USER_CONFIG_H__
|
|
|
|
|
2014-12-30 19:47:44 +01:00
|
|
|
// #define FLASH_512K
|
2014-12-22 12:35:05 +01:00
|
|
|
// #define FLASH_1M
|
|
|
|
// #define FLASH_2M
|
|
|
|
// #define FLASH_4M
|
2015-02-11 14:01:57 +01:00
|
|
|
// #define FLASH_8M
|
|
|
|
// #define FLASH_16M
|
2014-12-30 19:47:44 +01:00
|
|
|
#define FLASH_AUTOSIZE
|
2015-03-15 18:05:06 +01:00
|
|
|
#define FLASH_SAFE_API
|
2014-12-22 12:35:05 +01:00
|
|
|
|
2016-03-20 17:54:16 +01:00
|
|
|
// This adds the asserts in LUA. It also adds some useful extras to the
|
|
|
|
// node module. This is all silent in normal operation and so can be enabled
|
|
|
|
// without any harm (except for the code size increase and slight slowdown)
|
|
|
|
//#define DEVELOPMENT_TOOLS
|
|
|
|
|
|
|
|
#ifdef DEVELOPMENT_TOOLS
|
|
|
|
extern void luaL_assertfail(const char *file, int line, const char *message);
|
|
|
|
#define lua_assert(x) ((x) ? (void) 0 : luaL_assertfail(__FILE__, __LINE__, #x))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// This enables lots of debug output and changes the serial bit rate. This
|
|
|
|
// is normally only used by hardcore developers
|
2015-11-12 02:57:07 +01:00
|
|
|
// #define DEVELOP_VERSION
|
2015-02-04 18:42:14 +01:00
|
|
|
#ifdef DEVELOP_VERSION
|
2014-12-22 12:35:05 +01:00
|
|
|
#define NODE_DEBUG
|
2015-02-04 18:32:57 +01:00
|
|
|
#define COAP_DEBUG
|
2015-10-30 04:25:02 +01:00
|
|
|
#endif /* DEVELOP_VERSION */
|
|
|
|
|
2016-04-17 23:44:18 +02:00
|
|
|
#define BIT_RATE_DEFAULT BIT_RATE_115200
|
|
|
|
|
|
|
|
// This enables automatic baud rate detection at startup
|
|
|
|
#define BIT_RATE_AUTOBAUD
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
#define NODE_ERROR
|
|
|
|
|
|
|
|
#ifdef NODE_DEBUG
|
|
|
|
#define NODE_DBG c_printf
|
|
|
|
#else
|
|
|
|
#define NODE_DBG
|
|
|
|
#endif /* NODE_DEBUG */
|
|
|
|
|
|
|
|
#ifdef NODE_ERROR
|
|
|
|
#define NODE_ERR c_printf
|
|
|
|
#else
|
|
|
|
#define NODE_ERR
|
|
|
|
#endif /* NODE_ERROR */
|
|
|
|
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
#define GPIO_INTERRUPT_ENABLE
|
2016-02-28 20:48:41 +01:00
|
|
|
#define GPIO_INTERRUPT_HOOK_ENABLE
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
// #define GPIO_SAFE_NO_INTR_ENABLE
|
|
|
|
|
2015-01-05 03:09:51 +01:00
|
|
|
#define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed))
|
|
|
|
#define ICACHE_STORE_ATTR __attribute__((aligned(4)))
|
|
|
|
#define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
#ifdef GPIO_SAFE_NO_INTR_ENABLE
|
|
|
|
#define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline))
|
|
|
|
#else
|
|
|
|
#define NO_INTR_CODE inline
|
|
|
|
#endif
|
2015-01-01 15:22:05 +01:00
|
|
|
|
2016-09-04 22:45:46 +02:00
|
|
|
// SSL buffer size used only for espconn-layer secure connections.
|
|
|
|
// See https://github.com/nodemcu/nodemcu-firmware/issues/1457 for conversation details.
|
|
|
|
#define SSL_BUFFER_SIZE 5120
|
|
|
|
|
2016-03-01 23:15:03 +01:00
|
|
|
//#define CLIENT_SSL_ENABLE
|
2015-06-05 04:12:24 +02:00
|
|
|
//#define MD2_ENABLE
|
2015-06-03 03:11:23 +02:00
|
|
|
#define SHA2_ENABLE
|
2014-12-22 12:35:05 +01:00
|
|
|
|
2016-09-05 20:17:13 +02:00
|
|
|
#define BUILD_SPIFFS
|
2015-07-31 08:29:29 +02:00
|
|
|
#define SPIFFS_CACHE 1
|
|
|
|
|
2016-09-05 20:17:13 +02:00
|
|
|
//#define BUILD_FATFS
|
|
|
|
|
|
|
|
// maximum length of a filename
|
|
|
|
#define FS_OBJ_NAME_LEN 31
|
|
|
|
|
2016-06-05 23:10:58 +02:00
|
|
|
// Uncomment this next line for fastest startup
|
|
|
|
// It reduces the format time dramatically
|
|
|
|
// #define SPIFFS_MAX_FILESYSTEM_SIZE 32768
|
|
|
|
//
|
|
|
|
// You can force the spiffs file system to be at a fixed location
|
|
|
|
// #define SPIFFS_FIXED_LOCATION 0x100000
|
|
|
|
//
|
|
|
|
// You can force the SPIFFS file system to end on the next !M boundary
|
|
|
|
// (minus the 16k parameter space). THis is useful for certain OTA scenarios
|
|
|
|
// #define SPIFFS_SIZE_1M_BOUNDARY
|
|
|
|
|
2015-01-26 15:25:04 +01:00
|
|
|
// #define LUA_NUMBER_INTEGRAL
|
2014-12-22 12:35:05 +01:00
|
|
|
|
2015-11-09 02:03:29 +01:00
|
|
|
#define READLINE_INTERVAL 80
|
2015-10-08 05:14:51 +02:00
|
|
|
#define LUA_TASK_PRIO USER_TASK_PRIO_0
|
|
|
|
#define LUA_PROCESS_LINE_SIG 2
|
2015-11-09 00:46:08 +01:00
|
|
|
#define LUA_OPTIMIZE_DEBUG 2
|
2015-02-12 04:05:28 +01:00
|
|
|
|
2015-09-30 19:24:18 +02:00
|
|
|
#define ENDUSER_SETUP_AP_SSID "SetupGadget"
|
|
|
|
|
2015-12-26 15:11:11 +01:00
|
|
|
/*
|
|
|
|
* A valid hostname only contains alphanumeric and hyphen(-) characters, with no hyphens at first or last char
|
|
|
|
* if WIFI_STA_HOSTNAME not defined: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
|
|
|
|
* if WIFI_STA_HOSTNAME defined: hostname must only contain alphanumeric characters
|
|
|
|
* if WIFI_STA_HOSTNAME_APPEND_MAC not defined: Hostname MUST be 32 chars or less
|
|
|
|
* if WIFI_STA_HOSTNAME_APPEND_MAC defined: Hostname MUST be 26 chars or less, since last 3 octets of MAC address will be appended
|
|
|
|
* if defined hostname is invalid: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
|
|
|
|
*/
|
|
|
|
//#define WIFI_STA_HOSTNAME "NodeMCU"
|
|
|
|
//#define WIFI_STA_HOSTNAME_APPEND_MAC
|
|
|
|
|
2016-03-01 21:32:24 +01:00
|
|
|
//#define WIFI_SMART_ENABLE
|
2016-02-26 17:37:06 +01:00
|
|
|
|
2015-12-28 08:13:02 +01:00
|
|
|
#define WIFI_STATION_STATUS_MONITOR_ENABLE
|
|
|
|
#define WIFI_SDK_EVENT_MONITOR_ENABLE
|
|
|
|
#define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE
|
|
|
|
|
2015-07-29 10:49:18 +02:00
|
|
|
#define STRBUF_DEFAULT_INCREMENT 32
|
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
#endif /* __USER_CONFIG_H__ */
|