Seeed-Solution / SenseCAP_Indicator_ESP32

SenseCAP Indicator SDK.
https://wiki.seeedstudio.com/SenseCAP_Indicator_How_To_Flash_The_Default_Firmware/#ESP-IDF
Apache License 2.0
32 stars 22 forks source link

indicator_ha: fix time_t compile error #47

Closed jardous closed 4 months ago

jardous commented 4 months ago

Fix compile error:

In file included from SenseCAP_Indicator_ESP32/examples/indicator_ha/main/model/indicator_city.h:5, from SenseCAP_Indicator_ESP32/examples/indicator_ha/main/model/indicator_city.c:1: SenseCAP_Indicator_ESP32/examples/indicator_ha/main/view_data.h:72:5: error: unknown type name 'time_t' 72 | time_t time; // use when auto_update is true | ^~ SenseCAP_Indicator_ESP32/examples/indicator_ha/main/view_data.h:84:5: error: unknown type name 'time_t' 84 | time_t timestamp; | ^~ SenseCAP_Indicator_ESP32/examples/indicator_ha/main/view_data.h:92:5: error: unknown type name 'time_t' 92 | time_t timestamp; | ^~ ninja: build stopped: subcommand failed. ninja failed with exit code 1, output of the command is in the SenseCAP_Indicator_ESP32/examples/indicator_ha/build/log/idf_py_stderr_output_329923 and SenseCAP_Indicator_ESP32/examples/indicator_ha/build/log/idf_py_stdout_output_329923

Love4yzp commented 4 months ago

yes, IDF 5.0 does not require it, but since it now uses IDF v5.1, it is necessary to include the header file "time.h".