浏览代码

Made it work on Gustavs PC

Thomas Chef 2 周之前
父节点
当前提交
044e1d446a
共有 4 个文件被更改,包括 11 次插入4 次删除
  1. 2 4
      main/CMakeLists.txt
  2. 1 0
      main/main.c
  3. 4 0
      main/mqtt.c
  4. 4 0
      main/wifi.c

+ 2 - 4
main/CMakeLists.txt

@@ -2,7 +2,5 @@
 #                    INCLUDE_DIRS "."
 #                    )
 
-set(COMPONENT_SRCDIRS ".")
-set(COMPONENT_ADD_INCLUDEDIRS ".")
-
-register_component()
+idf_component_register(SRCS "main.c" "mqtt.c" "readTemps.c" "wifi.c"
+                       INCLUDE_DIRS ".")

+ 1 - 0
main/main.c

@@ -9,6 +9,7 @@
 #include "wifi.h"
 #include "mqtt.h"
 #include "readTemps.h"
+#include "esp_chip_info.h"
 
 esp_chip_info_t chip_info;
 

+ 4 - 0
main/mqtt.c

@@ -12,7 +12,11 @@
 #include <stddef.h>
 #include <string.h>
 #include "esp_wifi.h"
+#if ESP_IDF_VERSION_MAJOR >= 5
+#include "esp_chip_info.h"
+#else
 #include "esp_system.h"
+#endif
 #include "nvs_flash.h"
 #include "esp_event.h"
 #include "esp_netif.h"

+ 4 - 0
main/wifi.c

@@ -12,7 +12,11 @@
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 #include "freertos/event_groups.h"
+#if ESP_IDF_VERSION_MAJOR >= 5
+#include "esp_chip_info.h"
+#else
 #include "esp_system.h"
+#endif
 #include "esp_log.h"
 #include "driver/gpio.h"