user_config.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. //#define DEVELOPMENT_TOOLS
  14. #ifdef DEVELOPMENT_TOOLS
  15. extern void luaL_assertfail(const char *file, int line, const char *message);
  16. #define lua_assert(x) ((x) ? (void) 0 : luaL_assertfail(__FILE__, __LINE__, #x))
  17. #endif
  18. // This enables lots of debug output and changes the serial bit rate. This
  19. // is normally only used by hardcore developers
  20. // #define DEVELOP_VERSION
  21. #ifdef DEVELOP_VERSION
  22. #define NODE_DEBUG
  23. #define COAP_DEBUG
  24. #endif /* DEVELOP_VERSION */
  25. #define BIT_RATE_DEFAULT BIT_RATE_115200
  26. // This enables automatic baud rate detection at startup
  27. #define BIT_RATE_AUTOBAUD
  28. #define NODE_ERROR
  29. #ifdef NODE_DEBUG
  30. #define NODE_DBG dbg_printf
  31. #else
  32. #define NODE_DBG
  33. #endif /* NODE_DEBUG */
  34. #ifdef NODE_ERROR
  35. #define NODE_ERR dbg_printf
  36. #else
  37. #define NODE_ERR
  38. #endif /* NODE_ERROR */
  39. #define GPIO_INTERRUPT_ENABLE
  40. #define GPIO_INTERRUPT_HOOK_ENABLE
  41. // #define GPIO_SAFE_NO_INTR_ENABLE
  42. #define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed))
  43. #define ICACHE_STORE_ATTR __attribute__((aligned(4)))
  44. #define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
  45. #ifdef GPIO_SAFE_NO_INTR_ENABLE
  46. #define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline))
  47. #else
  48. #define NO_INTR_CODE inline
  49. #endif
  50. // SSL buffer size used only for espconn-layer secure connections.
  51. // See https://github.com/nodemcu/nodemcu-firmware/issues/1457 for conversation details.
  52. #define SSL_BUFFER_SIZE 5120
  53. //#define CLIENT_SSL_ENABLE
  54. //#define MD2_ENABLE
  55. #define SHA2_ENABLE
  56. #define BUILD_SPIFFS
  57. #define SPIFFS_CACHE 1
  58. //#define BUILD_FATFS
  59. // maximum length of a filename
  60. #define FS_OBJ_NAME_LEN 31
  61. // maximum number of open files for SPIFFS
  62. #define SPIFFS_MAX_OPEN_FILES 4
  63. // Uncomment this next line for fastest startup
  64. // It reduces the format time dramatically
  65. // #define SPIFFS_MAX_FILESYSTEM_SIZE 32768
  66. //
  67. // You can force the spiffs file system to be at a fixed location
  68. // #define SPIFFS_FIXED_LOCATION 0x100000
  69. //
  70. // You can force the SPIFFS file system to end on the next !M boundary
  71. // (minus the 16k parameter space). THis is useful for certain OTA scenarios
  72. // #define SPIFFS_SIZE_1M_BOUNDARY
  73. // #define LUA_NUMBER_INTEGRAL
  74. #define READLINE_INTERVAL 80
  75. #define LUA_TASK_PRIO USER_TASK_PRIO_0
  76. #define LUA_PROCESS_LINE_SIG 2
  77. #define LUA_OPTIMIZE_DEBUG 2
  78. #define ENDUSER_SETUP_AP_SSID "SetupGadget"
  79. /*
  80. * A valid hostname only contains alphanumeric and hyphen(-) characters, with no hyphens at first or last char
  81. * if WIFI_STA_HOSTNAME not defined: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  82. * if WIFI_STA_HOSTNAME defined: hostname must only contain alphanumeric characters
  83. * if WIFI_STA_HOSTNAME_APPEND_MAC not defined: Hostname MUST be 32 chars or less
  84. * if WIFI_STA_HOSTNAME_APPEND_MAC defined: Hostname MUST be 26 chars or less, since last 3 octets of MAC address will be appended
  85. * if defined hostname is invalid: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  86. */
  87. //#define WIFI_STA_HOSTNAME "NodeMCU"
  88. //#define WIFI_STA_HOSTNAME_APPEND_MAC
  89. //#define WIFI_SMART_ENABLE
  90. #define WIFI_STATION_STATUS_MONITOR_ENABLE
  91. #define WIFI_SDK_EVENT_MONITOR_ENABLE
  92. #define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE
  93. #define ENABLE_TIMER_SUSPEND
  94. #define PMSLEEP_ENABLE
  95. #define STRBUF_DEFAULT_INCREMENT 32
  96. #endif /* __USER_CONFIG_H__ */