m5stack / M5Stack

M5Stack Arduino Library
MIT License
1.21k stars 429 forks source link

use esp32/rom/rtc.h instead of rom/rtc.h #248

Closed taxio closed 2 years ago

taxio commented 3 years ago

When including M5Stack.h, the following warning message is displayed.

In file included from /MY_PATH/Arduino/libraries/M5Stack/src/utility/Power.cpp:10:
/MY_PATH/Arduino/hardware/espressif/esp32/tools/sdk/esp32/include/esp32/include/rom/rtc.h:1:2: warning: #warning rom/rtc.h is deprecated, please use esp32/rom/rtc.h instead [-Wcpp]
 #warning rom/rtc.h is deprecated, please use esp32/rom/rtc.h instead
  ^~~~~~~

I checked and found that the change in https://github.com/espressif/esp-idf/commit/c1599842646961d448c308aaa8b89d99ed292e4f separates the components of rom.

The actual library code just includes esp32/rom/rtc.h.

https://github.com/espressif/esp-idf/blob/639e7ad494d93fc82159f9fe854041bc43a96d5f/components/esp32/include/rom/rtc.h#L1-L2

#warning rom/rtc.h is deprecated, please use esp32/rom/rtc.h instead
#include "esp32/rom/rtc.h"

So I followed the warning and used esp32/rom/rtc.h instead of rom/rtc.h.