esp32-dfu: fix esp_mac_read include

with ESP-IDF v5.0, esp_read_mac used by this DFU to set the serial, is not included in esp_system.h anymore.
the fix is mentioned in the hint:

HINT:esp_mac.h header file is not included by esp_system.h anymore. It shall then be manually included with #include "esp_mac.h"HINT: Please check that the function name is correct. Also it is possible that you've forgot to import esp_read_mac library(s) in header file or add the necessary REQURIES component. Try to add missing libraries to your project header file or check idf_component_register(REQUIRES ...) section in your component CmakeList.txt file. For more information run 'idf.py docs -sp api-guides/build-system.html'.

this fix explicitly includes esp_mac.h
This commit is contained in:
King Kévin 2023-01-06 00:08:23 +01:00
parent 9fabddc6c8
commit 9fe31b2162
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@
#include "tusb.h"
#include "class/dfu/dfu_device.h"
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
#include "esp_mac.h"
#endif
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.