set(SOURCES "wifidevnum_config.c"
            "mqttconf/mqttconf_commun.c"
            #"led/gpio_led.c"
            "boards/serial/serial.c"
            "boards/gpiotrol/gpiocontrol.c"
            "boards/gpiotrol/betteryread.c"
            #"boards/common/board_common.c" # 统一入口文件
            "ota.c"
            "main.c")

set(INCLUDE_DIRS "." 
            "mqttconf" 
            "boards/serial"
            "boards/gpiotrol"
            #"boards/common"
            )


idf_component_register(SRCS ${SOURCES}
                    INCLUDE_DIRS ${INCLUDE_DIRS}
                    REQUIRES 
                        driver 
                        esp_https_ota 
                        app_update 
                        nvs_flash 
                        esp_https_ota
                        esp_http_client
                        esp_http_server
                        spiffs
                        esp-tls        # <--- 替换掉刚才报错的 esp_crt_bundle
                        esp_netif
                        esp_event
                        esp_wifi
                        esp_adc
                        mqtt
                        json 
                    )

spiffs_create_partition_image(storage ../www FLASH_IN_PROJECT)


