Implement support for ESP32 C6 and P4 SOCs (#421)
- Implement generic ESP32 devices - Updated GitHub Actions to first build the SDKs. These are now based on the generic device implementations and the build act as a filter before compiling the dozens of other devices. It should save on resources when boards fail to compile. - Adapted code to C6 and P4 differences, heavily borrowed from from https://github.com/ByteWelder/Tactility/pull/394 written by @marciogranzotto, with some changes of my own - Updated `device.py` to make the `[display]` section optional
This commit is contained in:
committed by
GitHub
parent
fec8033fd7
commit
b565d56029
@@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#pragma once
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "Tactility/MessageQueue.h"
|
||||
#include "Tactility/service/Service.h"
|
||||
#include "Tactility/service/espnow/EspNow.h"
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <Tactility/service/Service.h>
|
||||
#include <Tactility/service/espnow/EspNow.h>
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
|
||||
@@ -13,8 +17,6 @@ namespace tt::service::espnow {
|
||||
|
||||
class EspNowService final : public Service {
|
||||
|
||||
private:
|
||||
|
||||
struct ReceiverSubscriptionData {
|
||||
ReceiverSubscription id;
|
||||
std::function<void(const esp_now_recv_info_t* receiveInfo, const uint8_t* data, int length)> onReceive;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include "Tactility/service/espnow/EspNow.h"
|
||||
|
||||
namespace tt::service::espnow {
|
||||
@@ -9,3 +15,5 @@ bool initWifi(const EspNowConfig& config);
|
||||
bool deinitWifi();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,3 +1,7 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/TactilityConfig.h>
|
||||
|
||||
@@ -38,6 +42,8 @@ namespace service {
|
||||
namespace sdcard { extern const ServiceManifest manifest; }
|
||||
#ifdef ESP_PLATFORM
|
||||
namespace development { extern const ServiceManifest manifest; }
|
||||
#endif
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
namespace espnow { extern const ServiceManifest manifest; }
|
||||
#endif
|
||||
// Secondary (UI)
|
||||
@@ -64,7 +70,9 @@ namespace app {
|
||||
namespace applist { extern const AppManifest manifest; }
|
||||
namespace appsettings { extern const AppManifest manifest; }
|
||||
namespace boot { extern const AppManifest manifest; }
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
namespace chat { extern const AppManifest manifest; }
|
||||
#endif
|
||||
namespace development { extern const AppManifest manifest; }
|
||||
namespace display { extern const AppManifest manifest; }
|
||||
namespace files { extern const AppManifest manifest; }
|
||||
@@ -135,8 +143,11 @@ static void registerInternalApps() {
|
||||
addAppManifest(app::screenshot::manifest);
|
||||
#endif
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
addAppManifest(app::chat::manifest);
|
||||
#endif
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
addAppManifest(app::crashdiagnostics::manifest);
|
||||
addAppManifest(app::development::manifest);
|
||||
#endif
|
||||
@@ -231,6 +242,9 @@ static void registerAndStartPrimaryServices() {
|
||||
addService(service::wifi::manifest);
|
||||
#ifdef ESP_PLATFORM
|
||||
addService(service::development::manifest);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
addService(service::espnow::manifest);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
@@ -1,20 +1,29 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "Tactility/app/crashdiagnostics/QrUrl.h"
|
||||
|
||||
#include <Tactility/app/crashdiagnostics/QrUrl.h>
|
||||
#include <Tactility/kernel/PanicHandler.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#if CONFIG_IDF_TARGET_ARCH_XTENSA
|
||||
#include <esp_cpu_utils.h>
|
||||
#else
|
||||
#include <esp_cpu.h>
|
||||
#endif
|
||||
|
||||
#include <sdkconfig.h>
|
||||
|
||||
std::string getUrlFromCrashData() {
|
||||
auto crash_data = getRtcCrashData();
|
||||
auto* stack_buffer = (uint32_t*) malloc(crash_data.callstackLength * 2 * sizeof(uint32_t));
|
||||
std::vector<uint32_t> stack_buffer(crash_data.callstackLength * 2);
|
||||
for (int i = 0; i < crash_data.callstackLength; ++i) {
|
||||
const CallstackFrame&frame = crash_data.callstack[i];
|
||||
#if CONFIG_IDF_TARGET_ARCH_XTENSA
|
||||
uint32_t pc = esp_cpu_process_stack_pc(frame.pc);
|
||||
#else
|
||||
uint32_t pc = frame.pc; // No processing needed on RISC-V
|
||||
#endif
|
||||
#if CRASH_DATA_INCLUDES_SP
|
||||
uint32_t sp = frame.sp;
|
||||
#endif
|
||||
@@ -41,8 +50,6 @@ std::string getUrlFromCrashData() {
|
||||
#endif
|
||||
}
|
||||
|
||||
free(stack_buffer);
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <soc/soc_caps.h>
|
||||
#endif
|
||||
|
||||
#if defined(ESP_PLATFORM) && defined(SOC_SDMMC_HOST_SUPPORTED)
|
||||
|
||||
#include <Tactility/hal/sdcard/SdmmcDevice.h>
|
||||
#include <Tactility/Log.h>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include "Tactility/service/espnow/EspNow.h"
|
||||
#include "Tactility/service/espnow/EspNowService.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/service/espnow/EspNowService.h>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include "Tactility/service/espnow/EspNow.h"
|
||||
#include "Tactility/service/wifi/Wifi.h"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <sdkconfig.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef ESP_PLATFORM
|
||||
#ifndef CONFIG_ESP_WIFI_ENABLED
|
||||
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user