Initial Support for RP2040 platform (#3284)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Jesse Hills
2022-10-20 16:50:39 +13:00
committed by GitHub
parent e87edcc77a
commit 6153bcc6ad
49 changed files with 1270 additions and 61 deletions
+8
View File
@@ -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() {