user_config.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #ifndef __USER_CONFIG_H__
  2. #define __USER_CONFIG_H__
  3. // #define DEVKIT_VERSION_0_9 1 // define this only if you use NodeMCU devkit v0.9
  4. // #define FLASH_512K
  5. // #define FLASH_1M
  6. // #define FLASH_2M
  7. // #define FLASH_4M
  8. // #define FLASH_8M
  9. // #define FLASH_16M
  10. #define FLASH_AUTOSIZE
  11. #define FLASH_SAFE_API
  12. // This adds the asserts in LUA. It also adds some useful extras to the
  13. // node module. This is all silent in normal operation and so can be enabled
  14. // without any harm (except for the code size increase and slight slowdown)
  15. //#define DEVELOPMENT_TOOLS
  16. #ifdef DEVELOPMENT_TOOLS
  17. extern void luaL_assertfail(const char *file, int line, const char *message);
  18. #define lua_assert(x) ((x) ? (void) 0 : luaL_assertfail(__FILE__, __LINE__, #x))
  19. #endif
  20. // This enables lots of debug output and changes the serial bit rate. This
  21. // is normally only used by hardcore developers
  22. // #define DEVELOP_VERSION
  23. #ifdef DEVELOP_VERSION
  24. #define NODE_DEBUG
  25. #define COAP_DEBUG
  26. #endif /* DEVELOP_VERSION */
  27. #define BIT_RATE_DEFAULT BIT_RATE_115200
  28. // This enables automatic baud rate detection at startup
  29. #define BIT_RATE_AUTOBAUD
  30. #define NODE_ERROR
  31. #ifdef NODE_DEBUG
  32. #define NODE_DBG c_printf
  33. #else
  34. #define NODE_DBG
  35. #endif /* NODE_DEBUG */
  36. #ifdef NODE_ERROR
  37. #define NODE_ERR c_printf
  38. #else
  39. #define NODE_ERR
  40. #endif /* NODE_ERROR */
  41. #define GPIO_INTERRUPT_ENABLE
  42. #define GPIO_INTERRUPT_HOOK_ENABLE
  43. // #define GPIO_SAFE_NO_INTR_ENABLE
  44. #define ICACHE_STORE_TYPEDEF_ATTR __attribute__((aligned(4),packed))
  45. #define ICACHE_STORE_ATTR __attribute__((aligned(4)))
  46. #define ICACHE_RAM_ATTR __attribute__((section(".iram0.text")))
  47. #ifdef GPIO_SAFE_NO_INTR_ENABLE
  48. #define NO_INTR_CODE ICACHE_RAM_ATTR __attribute__ ((noinline))
  49. #else
  50. #define NO_INTR_CODE inline
  51. #endif
  52. //#define CLIENT_SSL_ENABLE
  53. //#define MD2_ENABLE
  54. #define SHA2_ENABLE
  55. #define BUILD_SPIFFS 1
  56. #define SPIFFS_CACHE 1
  57. // Uncomment this next line for fastest startup
  58. // It reduces the format time dramatically
  59. // #define SPIFFS_MAX_FILESYSTEM_SIZE 32768
  60. //
  61. // You can force the spiffs file system to be at a fixed location
  62. // #define SPIFFS_FIXED_LOCATION 0x100000
  63. //
  64. // You can force the SPIFFS file system to end on the next !M boundary
  65. // (minus the 16k parameter space). THis is useful for certain OTA scenarios
  66. // #define SPIFFS_SIZE_1M_BOUNDARY
  67. // #define LUA_NUMBER_INTEGRAL
  68. #define READLINE_INTERVAL 80
  69. #define LUA_TASK_PRIO USER_TASK_PRIO_0
  70. #define LUA_PROCESS_LINE_SIG 2
  71. #define LUA_OPTIMIZE_DEBUG 2
  72. #ifdef DEVKIT_VERSION_0_9
  73. #define KEYLED_INTERVAL 80
  74. #define KEY_SHORT_MS 200
  75. #define KEY_LONG_MS 3000
  76. #define KEY_SHORT_COUNT (KEY_SHORT_MS / READLINE_INTERVAL)
  77. #define KEY_LONG_COUNT (KEY_LONG_MS / READLINE_INTERVAL)
  78. #define LED_HIGH_COUNT_DEFAULT 10
  79. #define LED_LOW_COUNT_DEFAULT 0
  80. #endif
  81. #define ENDUSER_SETUP_AP_SSID "SetupGadget"
  82. /*
  83. * A valid hostname only contains alphanumeric and hyphen(-) characters, with no hyphens at first or last char
  84. * if WIFI_STA_HOSTNAME not defined: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  85. * if WIFI_STA_HOSTNAME defined: hostname must only contain alphanumeric characters
  86. * if WIFI_STA_HOSTNAME_APPEND_MAC not defined: Hostname MUST be 32 chars or less
  87. * if WIFI_STA_HOSTNAME_APPEND_MAC defined: Hostname MUST be 26 chars or less, since last 3 octets of MAC address will be appended
  88. * if defined hostname is invalid: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  89. */
  90. //#define WIFI_STA_HOSTNAME "NodeMCU"
  91. //#define WIFI_STA_HOSTNAME_APPEND_MAC
  92. //#define WIFI_SMART_ENABLE
  93. #define WIFI_STATION_STATUS_MONITOR_ENABLE
  94. #define WIFI_SDK_EVENT_MONITOR_ENABLE
  95. #define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE
  96. #define STRBUF_DEFAULT_INCREMENT 32
  97. #endif /* __USER_CONFIG_H__ */