user_config.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. // #define LUA_NUMBER_INTEGRAL
  58. #define READLINE_INTERVAL 80
  59. #define LUA_TASK_PRIO USER_TASK_PRIO_0
  60. #define LUA_PROCESS_LINE_SIG 2
  61. #define LUA_OPTIMIZE_DEBUG 2
  62. #ifdef DEVKIT_VERSION_0_9
  63. #define KEYLED_INTERVAL 80
  64. #define KEY_SHORT_MS 200
  65. #define KEY_LONG_MS 3000
  66. #define KEY_SHORT_COUNT (KEY_SHORT_MS / READLINE_INTERVAL)
  67. #define KEY_LONG_COUNT (KEY_LONG_MS / READLINE_INTERVAL)
  68. #define LED_HIGH_COUNT_DEFAULT 10
  69. #define LED_LOW_COUNT_DEFAULT 0
  70. #endif
  71. #define ENDUSER_SETUP_AP_SSID "SetupGadget"
  72. /*
  73. * A valid hostname only contains alphanumeric and hyphen(-) characters, with no hyphens at first or last char
  74. * if WIFI_STA_HOSTNAME not defined: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  75. * if WIFI_STA_HOSTNAME defined: hostname must only contain alphanumeric characters
  76. * if WIFI_STA_HOSTNAME_APPEND_MAC not defined: Hostname MUST be 32 chars or less
  77. * if WIFI_STA_HOSTNAME_APPEND_MAC defined: Hostname MUST be 26 chars or less, since last 3 octets of MAC address will be appended
  78. * if defined hostname is invalid: hostname will default to NODE-xxxxxx (xxxxxx being last 3 octets of MAC address)
  79. */
  80. //#define WIFI_STA_HOSTNAME "NodeMCU"
  81. //#define WIFI_STA_HOSTNAME_APPEND_MAC
  82. //#define WIFI_SMART_ENABLE
  83. #define WIFI_STATION_STATUS_MONITOR_ENABLE
  84. #define WIFI_SDK_EVENT_MONITOR_ENABLE
  85. #define WIFI_EVENT_MONITOR_DISCONNECT_REASON_LIST_ENABLE
  86. #define STRBUF_DEFAULT_INCREMENT 32
  87. #endif /* __USER_CONFIG_H__ */