mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-25 07:08:30 +02:00
Initial Support for RP2040 platform (#3284)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include "esp_system.h"
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/portmacro.h>
|
||||
#elif defined(USE_RP2040) && defined(USE_WIFI)
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_ESP32_IGNORE_EFUSE_MAC_CRC
|
||||
@@ -91,6 +93,8 @@ uint32_t random_uint32() {
|
||||
return esp_random();
|
||||
#elif defined(USE_ESP8266)
|
||||
return os_random();
|
||||
#elif defined(USE_RP2040)
|
||||
return ((uint32_t) rand()) << 16 + ((uint32_t) rand());
|
||||
#else
|
||||
#error "No random source available for this configuration."
|
||||
#endif
|
||||
@@ -102,6 +106,8 @@ bool random_bytes(uint8_t *data, size_t len) {
|
||||
return true;
|
||||
#elif defined(USE_ESP8266)
|
||||
return os_get_random(data, len) == 0;
|
||||
#elif defined(USE_RP2040)
|
||||
return false;
|
||||
#else
|
||||
#error "No random source available for this configuration."
|
||||
#endif
|
||||
@@ -409,6 +415,8 @@ void get_mac_address_raw(uint8_t *mac) {
|
||||
#endif
|
||||
#elif defined(USE_ESP8266)
|
||||
wifi_get_macaddr(STATION_IF, mac);
|
||||
#elif defined(USE_RP2040) && defined(USE_WIFI)
|
||||
WiFi.macAddress(mac);
|
||||
#endif
|
||||
}
|
||||
std::string get_mac_address() {
|
||||
|
||||
Reference in New Issue
Block a user