mirror of
https://github.com/esphome/esphome.git
synced 2025-01-15 20:21:36 +01:00
Include esp_mac.h and C++20 str_startswith/str_ends (#7999)
This commit is contained in:
parent
3fa67fad32
commit
df50e57409
@ -45,7 +45,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef USE_ESP32
|
#ifdef USE_ESP32
|
||||||
#include "esp32/rom/crc.h"
|
#include "esp32/rom/crc.h"
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2)
|
||||||
|
#include "esp_mac.h"
|
||||||
|
#endif
|
||||||
#include "esp_efuse.h"
|
#include "esp_efuse.h"
|
||||||
#include "esp_efuse_table.h"
|
#include "esp_efuse_table.h"
|
||||||
#endif
|
#endif
|
||||||
@ -261,7 +263,7 @@ bool random_bytes(uint8_t *data, size_t len) {
|
|||||||
bool str_equals_case_insensitive(const std::string &a, const std::string &b) {
|
bool str_equals_case_insensitive(const std::string &a, const std::string &b) {
|
||||||
return strcasecmp(a.c_str(), b.c_str()) == 0;
|
return strcasecmp(a.c_str(), b.c_str()) == 0;
|
||||||
}
|
}
|
||||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
#if __cplusplus >= 202002L
|
||||||
bool str_startswith(const std::string &str, const std::string &start) { return str.starts_with(start); }
|
bool str_startswith(const std::string &str, const std::string &start) { return str.starts_with(start); }
|
||||||
bool str_endswith(const std::string &str, const std::string &end) { return str.ends_with(end); }
|
bool str_endswith(const std::string &str, const std::string &end) { return str.ends_with(end); }
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user