support ESP32-S2 CPUs

Note: these don't have Bluetooth and only a single physical core.
This commit is contained in:
Thomas Göttgens
2022-12-14 13:32:26 +01:00
parent 627b21f3f2
commit bb24b86018
4 changed files with 63 additions and 7 deletions

View File

@@ -3,7 +3,9 @@
#include "esp_task_wdt.h"
#include "main.h"
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
#include "nimble/NimbleBluetooth.h"
#endif
#include "BleOta.h"
#include "mesh/http/WiFiAPClient.h"
@@ -16,13 +18,9 @@
#include <nvs_flash.h>
#include "soc/rtc.h"
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
NimbleBluetooth *nimbleBluetooth;
void getMacAddr(uint8_t *dmac)
{
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
}
void setBluetoothEnable(bool on) {
if (!isWifiAvailable() && config.bluetooth.enabled == true) {
@@ -36,6 +34,15 @@ void setBluetoothEnable(bool on) {
}
}
}
#else
void setBluetoothEnable(bool on) { }
void updateBatteryLevel(uint8_t level) { }
#endif
void getMacAddr(uint8_t *dmac)
{
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
}
#ifdef HAS_32768HZ
#define CALIBRATE_ONE(cali_clk) calibrate_one(cali_clk, #cali_clk)