feat: 添加编译时模块开关配置
通过 sdkconfig.defaults 选择性启用/禁用模块,减少固件体积: 新增模块开关: - CONFIG_MIMI_CHAN_TELEGRAM (默认 n) - CONFIG_MIMI_CHAN_FEISHU (默认 y) - CONFIG_MIMI_TOOL_WEB_SEARCH (默认 y) - CONFIG_MIMI_TOOL_GPIO (默认 n) - CONFIG_MIMI_WS_SERVER (默认 y) - CONFIG_MIMI_WIFI_ONBOARD (默认 y) - CONFIG_MIMI_OTA (默认 n) 技术实现: - CMakeLists.txt 条件编译源文件 - 头文件使用 static inline stub - CLI 命令和工具注册也支持条件编译 消除 Telegram 未配置时的 5 秒轮询警告日志
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* Perform OTA firmware update from a URL.
|
||||
* Downloads the firmware binary and applies it. Reboots on success.
|
||||
*
|
||||
* @param url HTTPS URL to the firmware .bin file
|
||||
* @return ESP_OK on success (device will reboot), error code otherwise
|
||||
*/
|
||||
#ifdef CONFIG_MIMI_OTA
|
||||
esp_err_t ota_update_from_url(const char *url);
|
||||
#else
|
||||
static inline esp_err_t ota_update_from_url(const char *url) {
|
||||
(void)url;
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user