3.6 KiB
Configuration
Project options
[env:my_board]
# custom firmware name, present in UF2 output files
# - default: project directory name
custom_fw_name = my_firmware
# custom firmware version
# - default: current date in yy.mm.dd format
custom_fw_version = 1.2.0
LibreTuya options
!!! note See LibreTuyaConfig.h for most options and their defaults.
All options are configurable via C++ defines in PlatformIO project file. For example:
[env:my_board]
build_flags =
-D LT_LOGLEVEL=LT_LEVEL_DEBUG
!!! hint Values in parentheses represent the defaults for the config options.
Logger
LT_LOGGER(1) - enable/disable LibreTuya logger globally. Enabled by default.LT_LOGLEVEL- global LT loglevel:LT_LEVEL_TRACE(same as LT_LEVEL_VERBOSE)LT_LEVEL_DEBUGLT_LEVEL_INFO- defaultLT_LEVEL_WARNLT_LEVEL_ERRORLT_LEVEL_FATAL
LT_LOGGER_TIMESTAMP(1) - print program runtime in printk-like formatLT_LOGGER_CALLER(1) - print calling method nameLT_LOGGER_TASK(1) - print calling FreeRTOS task (if available)LT_LOGGER_COLOR(0) - output ANSI terminal colorsLT_PRINTF_BROKEN(0) - whether printf outputs "0." for floats with value 0LT_LOG_HEAP(0) - print free heap size usingLT_HEAP_I()LT_LOG_ERRNO(0) - print and clear errno value (if set) usingLT_ERRNO()
Debug logging
The following options enable library-specific debugging messages. They are only effective if LT_LOGLEVEL is set below INFO. All of them are disabled by default.
Families should generally call i.e. WiFiClient debugging for client-related code, even if the WiFiClient.cpp file is physically absent.
LT_DEBUG_WIFI- WiFiLT_DEBUG_WIFI_CLIENT- WiFiClientLT_DEBUG_WIFI_SERVER- WiFiServerLT_DEBUG_WIFI_STA- WiFiSTALT_DEBUG_WIFI_AP- WiFiAPLT_DEBUG_SSL- WiFiClientSecure
Serial output
Options for controlling default UART log output.
LT_UART_DEFAULT_PORT(unset) - default output port for all messages (SDK, LT logger, Serial class); can be 0, 1 or 2LT_UART_DEFAULT_LOGGER(unset) - override default output port for LT logger onlyLT_UART_DEFAULT_SERIAL(unset) - override default output port forSerialclass (without a number)LT_UART_SILENT_ENABLED(1) - enable auto-silencing of SDK "loggers"; this makes the serial output much more readable, but can hide some error messagesLT_UART_SILENT_ALL(0) - disable all SDK output (LT output and logger still work)
!!! info Values 0, 1 and 2 correspond to physical UART port numbers (refer to board pinout for the available ports).
Serial class instances (`Serial0`, `Serial1`, `Serial2`) use the respective port numbers for printing.
If `LT_UART_DEFAULT_LOGGER` is not set, it is chosen by the family code - whichever port is most appropriate (i.e. LOG_UART (2) on Realtek, RX2/TX2 on Beken).
Family feature config
These options are selectively set by all families, as part of the build process. They are used for enabling LT core API parts, if the family has support for it.
The LT_ARD_* options are only used with Arduino frameworks.
The meaning of most flags is as follows:
LT_HAS_LWIP- LwIP in SDK (any version)LT_HAS_LWIP2- LwIP v2.0.0 or newerLT_HAS_FREERTOS- FreeRTOS supported and usedLT_HAS_MBEDTLS- mbedTLS in SDKLT_ARD_HAS_MD5- MD5 library implemented,MD5Impl.havailableLT_ARD_HAS_WIFI- WiFi library implemented,WiFiData.havailableLT_HEAP_FUNC- function name used to get available heap size (forLT_HEAP_I())