user_config.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef __USER_CONFIG_H__
  2. #define __USER_CONFIG_H__
  3. // #define FLASH_512K
  4. // #define FLASH_1M
  5. // #define FLASH_2M
  6. // #define FLASH_4M
  7. // #define FLASH_8M
  8. // #define FLASH_16M
  9. #define FLASH_AUTOSIZE
  10. // This adds the asserts in LUA. It also adds some useful extras to the
  11. // node module. This is all silent in normal operation and so can be enabled
  12. // without any harm (except for the code size increase and slight slowdown)
  13. // Either here for a global change or in the DEFINES variable in the relevant
  14. // Makefile for ony one subdirectory. If you want to use the remote GDB to
  15. // handle breaks and failed assetions then enable DEVELOPMENT_USE GDB
  16. //#define DEVELOPMENT_TOOLS
  17. //#define DEVELOPMENT_USE_GDB
  18. #ifdef DEVELOPMENT_TOOLS
  19. #if defined(LUA_CROSS_COMPILER) || !defined(DEVELOPMENT_USE_GDB)
  20. extern void luaL_assertfail(const char *file, int line, const char *message);
  21. #define lua_assert(x) ((x) ? (void) 0 : luaL_assertfail(__FILE__, __LINE__, #x))
  22. #else
  23. extern void luaL_dbgbreak(void);
  24. #define lua_assert(x) ((x) ? (void) 0 : luaL_dbgbreak())
  25. #endif
  26. #endif
  27. // This enables lots of debug output and changes the serial bit rate. This
  28. // is normally only used by hardcore developers
  29. // #define DEVELOP_VERSION
  30. #ifdef DEVELOP_VERSION
  31. #define NODE_DEBUG
  32. #define COAP_DEBUG
  33. #endif /* DEVELOP_VERSION */
  34. #define BIT_RATE_DEFAULT BIT_RATE_115200
  35. // This enables automatic baud rate detection at startup
  36. #define BIT_RATE_AUTOBAUD
  37. #define NODE_ERROR
  38. #ifdef NODE_DEBUG
  39. #define NODE_DBG dbg_printf
  40. #else
  41. #define NODE_DBG
  42. #endif /* NODE_DEBUG */
  43. #ifdef NODE_ERROR
  44. #define NODE_ERR dbg_printf
  45. #else
  46. #define NODE_ERR
  47. #endif /* NODE_ERROR */
  48. #define GPIO_INTERRUPT_ENABLE
  49. #define GPIO_INTERRUPT_HOOK_ENABLE
  50. // #define GPIO_SAFE_NO_INTR_ENABLE
  51. #define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed))
  52. #define ICACHE_STORE_ATTR __attribute__((aligned(4)))
  53. #define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
  54. #ifdef GPIO_SAFE_NO_INTR_ENABLE
  55. #define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline))
  56. #else
  57. #define NO_INTR_CODE inline
  58. #endif
  59. // SSL buffer size used only for espconn-layer secure connections.
  60. // See https://github.com/nodemcu/nodemcu-firmware/issues/1457 for conversation details.
  61. #define SSL_BUFFER_SIZE 5120
  62. //#define CLIENT_SSL_ENABLE
  63. //#define MD2_ENABLE
  64. #define SHA2_ENABLE
  65. #define BUILD_SPIFFS
  66. #define SPIFFS_CACHE 1
  67. //#define BUILD_FATFS
  68. // maximum length of a filename
  69. #define FS_OBJ_NAME_LEN 31
  70. // maximum number of open files for SPIFFS
  71. #define SPIFFS_MAX_OPEN_FILES 4
  72. // Uncomment this next line for fastest startup
  73. // It reduces the format time dramatically
  74. // #define SPIFFS_MAX_FILESYSTEM_SIZE 32768
  75. //
  76. // You can force the spiffs file system to be at a fixed location
  77. // #define SPIFFS_FIXED_LOCATION 0x100000
  78. //
  79. // You can force the SPIFFS file system to end on the next !M boundary
  80. // (minus the 16k parameter space). THis is useful for certain OTA scenarios
  81. // #define SPIFFS_SIZE_1M_BOUNDARY
  82. // #define LUA_NUMBER_INTEGRAL
  83. #define READLINE_INTERVAL 80
  84. #define LUA_TASK_PRIO USER_TASK_PRIO_0
  85. #define LUA_PROCESS_LINE_SIG 2
  86. #define LUA_OPTIMIZE_DEBUG 2
  87. #define ENDUSER_SETUP_AP_SSID "SetupGadget"
  88. /*
  89. * A valid hostname only contains alphanumeric and hyphen(-) characters, with no hyphens at first or last char
  90. * if WIFI_STA_HOSTNAME not defined: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  91. * if WIFI_STA_HOSTNAME defined: hostname must only contain alphanumeric characters
  92. * if WIFI_STA_HOSTNAME_APPEND_MAC not defined: Hostname MUST be 32 chars or less
  93. * if WIFI_STA_HOSTNAME_APPEND_MAC defined: Hostname MUST be 26 chars or less, since last 3 octets of MAC address will be appended
  94. * if defined hostname is invalid: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  95. */
  96. //#define WIFI_STA_HOSTNAME "NodeMCU"
  97. //#define WIFI_STA_HOSTNAME_APPEND_MAC
  98. //#define WIFI_SMART_ENABLE
  99. #define WIFI_SDK_EVENT_MONITOR_ENABLE
  100. #define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE
  101. ////#define ENABLE_TIMER_SUSPEND
  102. //#define PMSLEEP_ENABLE
  103. #define STRBUF_DEFAULT_INCREMENT 32
  104. #endif /* __USER_CONFIG_H__ */