mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Various fixes and improvements (#177)
- Remove custom `ESP_TARGET` and use `ESP_PLATFORM` everywhere - Add `Loader` service functionality to `tt::app::` namespace - Make `Loader` `PubSub` usable by exposing the messages - Add board type to crash log - Don't show SD card in Files app when it's not mounted - Set default SPI frequency for SD cards - Move TT_VERSION to scope that works for sim too - Log Tactility version and board on boot - Rename "Yellow Board" to "CYD 2432S024C"
This commit is contained in:
parent
97b8007aca
commit
12a9839420
4
.github/workflows/build-firmware.yml
vendored
4
.github/workflows/build-firmware.yml
vendored
@ -4,14 +4,14 @@ on: [push]
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
yellow-board:
|
||||
cyd-2432S024c:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: "Build"
|
||||
uses: ./.github/actions/build-firmware
|
||||
with:
|
||||
board_id: yellow-board
|
||||
board_id: cyd-2432S024c
|
||||
arch: esp32
|
||||
lilygo-tdeck:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/build-sdk.yml
vendored
2
.github/workflows/build-sdk.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
- name: "Build"
|
||||
uses: ./.github/actions/build-sdk
|
||||
with:
|
||||
board_id: yellow-board
|
||||
board_id: cyd-2432S024c
|
||||
arch: esp32
|
||||
esp32s3:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -5,7 +5,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
|
||||
if("${IDF_TARGET}" STREQUAL "esp32")
|
||||
list(APPEND BOARD_COMPONENTS
|
||||
YellowBoard
|
||||
CYD-2432S024C
|
||||
M5stackCore2
|
||||
)
|
||||
endif()
|
||||
|
||||
11
App/Kconfig
11
App/Kconfig
@ -1,13 +1,18 @@
|
||||
# Kconfig file for Tactility example app
|
||||
menu "Tactility App"
|
||||
config TT_BOARD_NAME
|
||||
string "Board Name"
|
||||
default ""
|
||||
config TT_BOARD_ID
|
||||
string "Board ID"
|
||||
default ""
|
||||
choice
|
||||
prompt "Board"
|
||||
default TT_BOARD_CUSTOM
|
||||
|
||||
config TT_BOARD_CUSTOM
|
||||
bool "Custom"
|
||||
config TT_BOARD_YELLOW_BOARD_24_CAP
|
||||
bool "Yellow Board (2.4\" capacitive)"
|
||||
config TT_BOARD_CYD_2432S024C
|
||||
bool "CYD 2432S024C"
|
||||
config TT_BOARD_LILYGO_TDECK
|
||||
bool "LilyGo T-Deck"
|
||||
config TT_BOARD_M5STACK_CORE2
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
#if defined(CONFIG_TT_BOARD_LILYGO_TDECK)
|
||||
#include "LilygoTdeck.h"
|
||||
#define TT_BOARD_HARDWARE &lilygo_tdeck
|
||||
#elif defined(CONFIG_TT_BOARD_YELLOW_BOARD_24_CAP)
|
||||
#include "YellowBoard.h"
|
||||
#define TT_BOARD_HARDWARE &yellow_board_24inch_cap
|
||||
#elif defined(CONFIG_TT_BOARD_CYD_2432S024C)
|
||||
#include "CYD2432S024C.h"
|
||||
#define TT_BOARD_HARDWARE &cyd_2432S024c_config
|
||||
#elif defined(CONFIG_TT_BOARD_M5STACK_CORE2)
|
||||
#include "M5stackCore2.h"
|
||||
#define TT_BOARD_HARDWARE &m5stack_core2
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#include "YellowBoard.h"
|
||||
#include "CYD2432S024C.h"
|
||||
#include "hal/YellowDisplay.h"
|
||||
#include "hal/YellowSdCard.h"
|
||||
|
||||
bool twodotfour_lvgl_init();
|
||||
bool twodotfour_boot();
|
||||
|
||||
const tt::hal::Configuration yellow_board_24inch_cap = {
|
||||
const tt::hal::Configuration cyd_2432S024c_config = {
|
||||
.initBoot = &twodotfour_boot,
|
||||
.initLvgl = &twodotfour_lvgl_init,
|
||||
.createDisplay = createDisplay,
|
||||
@ -3,4 +3,4 @@
|
||||
#include "hal/Configuration.h"
|
||||
|
||||
// Capacitive touch version of the 2.4" yellow board
|
||||
extern const tt::hal::Configuration yellow_board_24inch_cap;
|
||||
extern const tt::hal::Configuration cyd_2432S024c_config;
|
||||
@ -7,11 +7,9 @@
|
||||
|
||||
#define SDCARD_SPI_HOST SPI3_HOST
|
||||
#define SDCARD_PIN_CS GPIO_NUM_5
|
||||
#define SDCARD_SPI_FREQUENCY 20000000U
|
||||
|
||||
std::shared_ptr<SdCard> createYellowSdCard() {
|
||||
auto* configuration = new tt::hal::SpiSdCard::Config(
|
||||
SDCARD_SPI_FREQUENCY,
|
||||
SDCARD_PIN_CS,
|
||||
GPIO_NUM_NC,
|
||||
GPIO_NUM_NC,
|
||||
@ -6,14 +6,12 @@
|
||||
#include <esp_vfs_fat.h>
|
||||
#include <sdmmc_cmd.h>
|
||||
|
||||
#define TDECK_SDCARD_SPI_FREQUENCY 20000000U
|
||||
#define TDECK_SDCARD_PIN_CS GPIO_NUM_39
|
||||
#define TDECK_LCD_PIN_CS GPIO_NUM_12
|
||||
#define TDECK_RADIO_PIN_CS GPIO_NUM_9
|
||||
|
||||
std::shared_ptr<SdCard> createTdeckSdCard() {
|
||||
auto* configuration = new tt::hal::SpiSdCard::Config(
|
||||
TDECK_SDCARD_SPI_FREQUENCY,
|
||||
TDECK_SDCARD_PIN_CS,
|
||||
GPIO_NUM_NC,
|
||||
GPIO_NUM_NC,
|
||||
|
||||
@ -5,13 +5,11 @@
|
||||
|
||||
#include <esp_vfs_fat.h>
|
||||
|
||||
#define CORE2_SDCARD_SPI_FREQUENCY 20000000U
|
||||
#define CORE2_SDCARD_PIN_CS GPIO_NUM_4
|
||||
#define CORE2_LCD_PIN_CS GPIO_NUM_5
|
||||
|
||||
std::shared_ptr<SdCard> createSdCard() {
|
||||
auto* configuration = new tt::hal::SpiSdCard::Config(
|
||||
CORE2_SDCARD_SPI_FREQUENCY,
|
||||
CORE2_SDCARD_PIN_CS,
|
||||
GPIO_NUM_NC,
|
||||
GPIO_NUM_NC,
|
||||
|
||||
@ -5,13 +5,11 @@
|
||||
|
||||
#include <esp_vfs_fat.h>
|
||||
|
||||
#define CORES3_SDCARD_SPI_FREQUENCY 20000000U
|
||||
#define CORES3_SDCARD_PIN_CS GPIO_NUM_4
|
||||
#define CORES3_LCD_PIN_CS GPIO_NUM_3
|
||||
|
||||
std::shared_ptr<SdCard> createSdCard() {
|
||||
auto* configuration = new tt::hal::SpiSdCard::Config(
|
||||
CORES3_SDCARD_SPI_FREQUENCY,
|
||||
CORES3_SDCARD_PIN_CS,
|
||||
GPIO_NUM_NC,
|
||||
GPIO_NUM_NC,
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
#include <esp_vfs_fat.h>
|
||||
|
||||
#define UNPHONE_SDCARD_SPI_FREQUENCY 20000000U
|
||||
#define UNPHONE_SDCARD_PIN_CS GPIO_NUM_43
|
||||
#define UNPHONE_LCD_PIN_CS GPIO_NUM_48
|
||||
#define UNPHONE_LORA_PIN_CS GPIO_NUM_44
|
||||
@ -13,7 +12,6 @@
|
||||
|
||||
std::shared_ptr<SdCard> createUnPhoneSdCard() {
|
||||
auto* configuration = new tt::hal::SpiSdCard::Config(
|
||||
UNPHONE_SDCARD_SPI_FREQUENCY,
|
||||
UNPHONE_SDCARD_PIN_CS,
|
||||
GPIO_NUM_NC,
|
||||
GPIO_NUM_NC,
|
||||
|
||||
@ -6,8 +6,6 @@ endfunction()
|
||||
|
||||
macro(tactility_project project_name)
|
||||
set(TACTILITY_SKIP_SPIFFS 1)
|
||||
add_definitions(-DESP_TARGET)
|
||||
add_compile_definitions(ESP_TARGET)
|
||||
|
||||
include("${TACTILITY_SDK_PATH}/Libraries/elf_loader/elf_loader.cmake")
|
||||
project_elf($project_name)
|
||||
|
||||
@ -8,13 +8,13 @@ set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_CXX_COMPILER_TARGET}")
|
||||
|
||||
include("Buildscripts/logo.cmake")
|
||||
|
||||
file(READ version.txt TACTILITY_VERSION)
|
||||
add_compile_definitions(TT_VERSION="${TACTILITY_VERSION}")
|
||||
|
||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
message("Building with ESP-IDF v$ENV{ESP_IDF_VERSION}")
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
add_definitions(-DESP_TARGET)
|
||||
add_compile_definitions(ESP_TARGET)
|
||||
|
||||
set(COMPONENTS App)
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"Boards"
|
||||
@ -34,7 +34,7 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
|
||||
# Non-ESP32 boards
|
||||
if(NOT "${IDF_TARGET}" STREQUAL "esp32")
|
||||
set(EXCLUDE_COMPONENTS "YellowBoard")
|
||||
set(EXCLUDE_COMPONENTS "CYD-2432S024C")
|
||||
set(EXCLUDE_COMPONENTS "M5stackCore2")
|
||||
endif()
|
||||
|
||||
@ -53,11 +53,10 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
||||
add_compile_definitions(LV_CONF_PATH="${LVGL_CONFIG_FULL_PATH}/lv_conf_kconfig.h")
|
||||
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_panic_handler" APPEND)
|
||||
idf_build_set_property(LINK_OPTIONS "-Wl,--wrap=esp_log_write" APPEND)
|
||||
|
||||
file(READ version.txt TACTILITY_VERSION)
|
||||
add_compile_definitions(TT_VERSION="${TACTILITY_VERSION}")
|
||||
else()
|
||||
message("Building for sim target")
|
||||
add_compile_definitions(CONFIG_TT_BOARD_ID="simulator")
|
||||
add_compile_definitions(CONFIG_TT_BOARD_NAME="Simulator")
|
||||
endif()
|
||||
|
||||
project(Tactility)
|
||||
|
||||
@ -10,18 +10,12 @@
|
||||
- Show error in WiFi screen (e.g. AlertDialog when SPI is not enabled and available memory is below a certain amount)
|
||||
- Clean up static_cast when casting to base class.
|
||||
- EventFlag: Fix return value of set/get/wait (the errors are weirdly mixed in)
|
||||
- tt_check() failure during app argument bundle nullptr check seems to trigger SIGSEGV
|
||||
- Fix bug in T-Deck/etc: esp_lvgl_port settings has a large stack size (~9kB) to fix an issue where the T-Deck would get a stackoverflow. This sometimes happens when WiFi is auto-enabled and you open the app while it is still connecting.
|
||||
- M5Stack Core only shows 4MB of SPIRAM in use
|
||||
- Try to improve Core2 and CoreS3 performance by setting swap_bytes of display driver to false (this is a software operation on the display buffer!) and use 24 bit colour mode if needed
|
||||
- Files app: When SD card is not mounted, don't show it
|
||||
- Crash log must mention board type
|
||||
- Oops crashlog site: Add copy-pasteable addr2line command (e.g. xtensa-esp32s3-elf-addr2line -pfiaC -e Tactility.elf 00000000)
|
||||
|
||||
# TODOs
|
||||
- Experiment with what happens when using C++ code in an external app (without using standard library!)
|
||||
- Get rid of "ESP_TARGET" and use official "ESP_PLATFORM"
|
||||
- SpiSdCard should use SDMMC_FREQ_DEFAULT by default
|
||||
- Boards' CMakeLists.txt manually declare each source folder. Update them all to do a recursive search of all folders.
|
||||
- We currently build all boards for a given platform (e.g. ESP32S3), but it's better to filter all irrelevant ones based on the Kconfig board settings:
|
||||
Projects will load and compile faster as it won't compile all the dependencies of all these other boards
|
||||
@ -43,7 +37,6 @@
|
||||
- Explore LVGL9's FreeRTOS functionality
|
||||
- External app loading: Check version of Tactility and check ESP target hardware, to check for compatibility.
|
||||
- Scanning SD card for external apps and auto-register them (in a temporary register?)
|
||||
- tt::app::start() and similar functions as proxies for Loader app start/stop/etc.
|
||||
- Support hot-plugging SD card
|
||||
|
||||
# Nice-to-haves
|
||||
|
||||
@ -14,22 +14,6 @@
|
||||
|
||||
namespace tt::service::loader {
|
||||
|
||||
|
||||
// region LoaderEvent
|
||||
|
||||
typedef enum {
|
||||
LoaderEventTypeApplicationStarted,
|
||||
LoaderEventTypeApplicationShowing,
|
||||
LoaderEventTypeApplicationHiding,
|
||||
LoaderEventTypeApplicationStopped
|
||||
} LoaderEventType;
|
||||
|
||||
struct LoaderEvent {
|
||||
LoaderEventType type;
|
||||
};
|
||||
|
||||
// endregion LoaderEvent
|
||||
|
||||
// region LoaderMessage
|
||||
|
||||
class LoaderMessageAppStart {
|
||||
|
||||
@ -141,7 +141,7 @@ static void register_and_start_user_services(const std::vector<const service::Se
|
||||
}
|
||||
|
||||
void run(const Configuration& config) {
|
||||
TT_LOG_I(TAG, "init started");
|
||||
TT_LOG_D(TAG, "run");
|
||||
|
||||
tt_assert(config.hardware);
|
||||
const hal::Configuration& hardware = *config.hardware;
|
||||
|
||||
22
Tactility/Source/app/App.cpp
Normal file
22
Tactility/Source/app/App.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "App.h"
|
||||
#include "service/loader/Loader.h"
|
||||
|
||||
namespace tt::app {
|
||||
|
||||
void start(const std::string& id, std::shared_ptr<const Bundle> _Nullable parameters) {
|
||||
service::loader::startApp(id, std::move(parameters));
|
||||
}
|
||||
|
||||
void stop() {
|
||||
service::loader::stopApp();
|
||||
}
|
||||
|
||||
std::shared_ptr<app::AppContext> _Nullable getCurrentAppContext() {
|
||||
return service::loader::getCurrentAppContext();
|
||||
}
|
||||
|
||||
std::shared_ptr<app::App> _Nullable getCurrentApp() {
|
||||
return service::loader::getCurrentApp();
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
#include "AppContext.h"
|
||||
#include "Bundle.h"
|
||||
#include <Mutex.h>
|
||||
#include <string>
|
||||
|
||||
// Forward declarations
|
||||
typedef struct _lv_obj_t lv_obj_t;
|
||||
@ -75,4 +76,20 @@ public:
|
||||
template<typename T>
|
||||
std::shared_ptr<App> create() { return std::shared_ptr<T>(new T); }
|
||||
|
||||
/**
|
||||
* @brief Start an app
|
||||
* @param[in] id application name or id
|
||||
* @param[in] parameters optional parameters to pass onto the application
|
||||
*/
|
||||
void start(const std::string& id, std::shared_ptr<const Bundle> _Nullable parameters = nullptr);
|
||||
|
||||
/** @brief Stop the currently showing app. Show the previous app if any app was still running. */
|
||||
void stop();
|
||||
|
||||
/** @return the currently running app context (it is only ever null before the splash screen is shown) */
|
||||
std::shared_ptr<app::AppContext> _Nullable getCurrentAppContext();
|
||||
|
||||
/** @return the currently running app (it is only ever null before the splash screen is shown) */
|
||||
std::shared_ptr<app::App> _Nullable getCurrentApp();
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "app/crashdiagnostics/QrHelpers.h"
|
||||
#include "app/crashdiagnostics/QrUrl.h"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
namespace tt::app::crashdiagnostics {
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "app/crashdiagnostics/QrUrl.h"
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
#include <sstream>
|
||||
#include <esp_cpu_utils.h>
|
||||
|
||||
#include <sdkconfig.h>
|
||||
|
||||
std::string getUrlFromCrashData() {
|
||||
auto crash_data = getRtcCrashData();
|
||||
auto* stack_buffer = (uint32_t*) malloc(crash_data.callstackLength * 2 * sizeof(uint32_t));
|
||||
@ -28,6 +30,7 @@ std::string getUrlFromCrashData() {
|
||||
stream << "https://oops.tactility.one";
|
||||
stream << "?v=" << TT_VERSION; // Version
|
||||
stream << "&a=" << CONFIG_IDF_TARGET; // Architecture
|
||||
stream << "&b=" << CONFIG_TT_BOARD_ID; // Board identifier
|
||||
stream << "&s="; // Stacktrace
|
||||
|
||||
for (int i = crash_data.callstackLength - 1; i >= 0; --i) {
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
#include "app/files/State.h"
|
||||
#include "app/files/FileUtils.h"
|
||||
|
||||
#include "kernel/Kernel.h"
|
||||
#include "Log.h"
|
||||
#include "Partitions.h"
|
||||
#include "TactilityHeadless.h"
|
||||
#include "hal/SdCard.h"
|
||||
#include "kernel/Kernel.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
@ -61,11 +62,22 @@ bool State::setEntriesForPath(const std::string& path) {
|
||||
.d_type = TT_DT_DIR,
|
||||
.d_name = DATA_PARTITION_NAME
|
||||
});
|
||||
dir_entries.push_back({
|
||||
.d_ino = 2,
|
||||
.d_type = TT_DT_DIR,
|
||||
.d_name = TT_SDCARD_MOUNT_NAME
|
||||
});
|
||||
|
||||
#ifndef TT_SCREENSHOT_MODE
|
||||
auto sdcard = tt::hal::getConfiguration()->sdcard;
|
||||
if (sdcard != nullptr) {
|
||||
auto state = sdcard->getState();
|
||||
if (state == hal::SdCard::State::Mounted) {
|
||||
#endif
|
||||
dir_entries.push_back({
|
||||
.d_ino = 2,
|
||||
.d_type = TT_DT_DIR,
|
||||
.d_name = TT_SDCARD_MOUNT_NAME
|
||||
});
|
||||
#ifndef TT_SCREENSHOT_MODE
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
current_path = path;
|
||||
selected_child_entry = "";
|
||||
|
||||
@ -49,10 +49,10 @@ static void loader_free() {
|
||||
loader_singleton = nullptr;
|
||||
}
|
||||
|
||||
void startApp(const std::string& id, const std::shared_ptr<const Bundle>& parameters) {
|
||||
void startApp(const std::string& id, std::shared_ptr<const Bundle> parameters) {
|
||||
TT_LOG_I(TAG, "Start app %s", id.c_str());
|
||||
tt_assert(loader_singleton);
|
||||
auto message = std::make_shared<LoaderMessageAppStart>(id, parameters);
|
||||
auto message = std::make_shared<LoaderMessageAppStart>(id, std::move(parameters));
|
||||
loader_singleton->dispatcherThread->dispatch(onStartAppMessage, message);
|
||||
}
|
||||
|
||||
|
||||
@ -8,15 +8,27 @@
|
||||
|
||||
namespace tt::service::loader {
|
||||
|
||||
typedef struct Loader Loader;
|
||||
// region LoaderEvent for PubSub
|
||||
|
||||
typedef enum {
|
||||
LoaderEventTypeApplicationStarted,
|
||||
LoaderEventTypeApplicationShowing,
|
||||
LoaderEventTypeApplicationHiding,
|
||||
LoaderEventTypeApplicationStopped
|
||||
} LoaderEventType;
|
||||
|
||||
struct LoaderEvent {
|
||||
LoaderEventType type;
|
||||
};
|
||||
|
||||
// endregion LoaderEvent for PubSub
|
||||
|
||||
/**
|
||||
* @brief Start an app
|
||||
* @param[in] id application name or id
|
||||
* @param[in] parameters optional parameters to pass onto the application
|
||||
*/
|
||||
void startApp(const std::string& id, const std::shared_ptr<const Bundle>& _Nullable parameters = nullptr);
|
||||
void startApp(const std::string& id, std::shared_ptr<const Bundle> _Nullable parameters = nullptr);
|
||||
|
||||
/** @brief Stop the currently showing app. Show the previous app if any app was still running. */
|
||||
void stopApp();
|
||||
|
||||
@ -31,7 +31,7 @@ TT_NORETURN void _crash() {
|
||||
logTaskInfo();
|
||||
logMemoryInfo();
|
||||
// TODO: Add breakpoint when debugger is attached.
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
esp_system_abort("System halted. Connect debugger for more info.");
|
||||
#endif
|
||||
__builtin_unreachable();
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
#define TT_ALIGN(n) __attribute__((aligned(n)))
|
||||
|
||||
// Used by portENABLE_INTERRUPTS and portDISABLE_INTERRUPTS?
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
#define TT_IS_IRQ_MODE() (xPortInIsrContext() == pdTRUE)
|
||||
#else
|
||||
#define TT_IS_IRQ_MODE() false
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
#include "LogMessages.h"
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <esp_log.h>
|
||||
#else
|
||||
#include <cstdarg>
|
||||
@ -43,7 +43,7 @@ LogEntry* copyLogEntries(unsigned int& outIndex);
|
||||
} // namespace tt
|
||||
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#define TT_LOG_E(tag, format, ...) \
|
||||
ESP_LOGE(tag, format, ##__VA_ARGS__)
|
||||
@ -75,4 +75,4 @@ void log(LogLevel level, const char* tag, const char* format, ...);
|
||||
#define TT_LOG_V(tag, format, ...) \
|
||||
tt::log(tt::LogLevel::Trace, tag, format, ##__VA_ARGS__)
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
namespace tt {
|
||||
|
||||
@ -8,4 +8,4 @@ void initEsp();
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
@ -10,4 +10,4 @@ esp_err_t initPartitionsEsp();
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "EspPartitions_i.h"
|
||||
#include "Log.h"
|
||||
@ -51,4 +51,4 @@ esp_err_t initPartitionsEsp() {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
@ -38,6 +38,7 @@ static void register_and_start_system_services() {
|
||||
}
|
||||
|
||||
void initHeadless(const hal::Configuration& config) {
|
||||
TT_LOG_I(TAG, "Tactility v%s on %s (%s)", TT_VERSION, CONFIG_TT_BOARD_NAME, CONFIG_TT_BOARD_ID);
|
||||
#ifdef ESP_PLATFORM
|
||||
initEsp();
|
||||
#endif
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "TactilityCore.h"
|
||||
#include "EspPartitions_i.h"
|
||||
|
||||
@ -74,7 +74,7 @@ bool SpiSdCard::mountInternal(const char* mountPoint) {
|
||||
// The following value is from T-Deck repo's UnitTest.ino project:
|
||||
// https://github.com/Xinyuan-LilyGO/T-Deck/blob/master/examples/UnitTest/UnitTest.ino
|
||||
// Observation: Using this automatically sets the bus to 20MHz
|
||||
host.max_freq_khz = config->spiFrequency / 1000U;
|
||||
host.max_freq_khz = config->spiFrequencyKhz;
|
||||
host.slot = config->spiHost;
|
||||
|
||||
esp_err_t result = esp_vfs_fat_sdspi_mount(mountPoint, &host, &slot_config, &mount_config, &card);
|
||||
|
||||
@ -19,7 +19,6 @@ class SpiSdCard : public tt::hal::SdCard {
|
||||
public:
|
||||
struct Config {
|
||||
Config(
|
||||
int spiFrequency,
|
||||
gpio_num_t spiPinCs,
|
||||
gpio_num_t spiPinCd,
|
||||
gpio_num_t spiPinWp,
|
||||
@ -27,8 +26,9 @@ public:
|
||||
MountBehaviour mountBehaviourAtBoot,
|
||||
std::shared_ptr<Lockable> lockable = nullptr,
|
||||
std::vector<gpio_num_t> csPinWorkAround = std::vector<gpio_num_t>(),
|
||||
spi_host_device_t spiHost = SPI2_HOST
|
||||
) : spiFrequency(spiFrequency),
|
||||
spi_host_device_t spiHost = SPI2_HOST,
|
||||
int spiFrequencyKhz = SDMMC_FREQ_DEFAULT
|
||||
) : spiFrequencyKhz(spiFrequencyKhz),
|
||||
spiPinCs(spiPinCs),
|
||||
spiPinCd(spiPinCd),
|
||||
spiPinWp(spiPinWp),
|
||||
@ -39,7 +39,7 @@ public:
|
||||
spiHost(spiHost)
|
||||
{}
|
||||
|
||||
int spiFrequency;
|
||||
int spiFrequencyKhz;
|
||||
gpio_num_t spiPinCs; // Clock
|
||||
gpio_num_t spiPinCd; // Card detect
|
||||
gpio_num_t spiPinWp; // Write-protect
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "I2c.h"
|
||||
#include "Log.h"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <hal/i2c_types.h>
|
||||
#include <driver/i2c.h>
|
||||
#else
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
/**
|
||||
* This code is based on i2c_manager from https://github.com/ropg/i2c_manager/blob/master/i2c_manager/i2c_manager.c (original has MIT license)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "Wifi.h"
|
||||
|
||||
@ -970,4 +970,4 @@ extern const ServiceManifest manifest = {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#include "Wifi.h"
|
||||
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "Check.h"
|
||||
#include "Log.h"
|
||||
@ -160,4 +160,4 @@ extern const ServiceManifest manifest = {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@ -1,4 +1,4 @@
|
||||
#ifdef ESP_TARGET
|
||||
#ifdef ESP_PLATFORM
|
||||
|
||||
#include "WifiGlobals.h"
|
||||
#include "WifiSettings.h"
|
||||
@ -144,4 +144,4 @@ bool remove(const char* ssid) {
|
||||
|
||||
} // nemespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@ -1,4 +1,4 @@
|
||||
#ifndef ESP_TARGET
|
||||
#ifndef ESP_PLATFORM
|
||||
|
||||
#include "WifiSettings.h"
|
||||
#include "Log.h"
|
||||
@ -25,4 +25,4 @@ bool remove(const char* ssid) {
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // ESP_TARGET
|
||||
#endif // ESP_PLATFORM
|
||||
@ -29,7 +29,9 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_TT_BOARD_YELLOW_BOARD_24_CAP=y
|
||||
CONFIG_TT_BOARD_CYD_2432S024C=y
|
||||
CONFIG_TT_BOARD_NAME="CYD 2432S024C"
|
||||
CONFIG_TT_BOARD_ID="cyd-2432S024c"
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
@ -29,8 +29,10 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_TT_BOARD_LILYGO_TDECK=y
|
||||
CONFIG_TT_BOARD_NAME="LilyGo T-Deck"
|
||||
CONFIG_TT_BOARD_ID="lilygo-tdeck"
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
@ -29,8 +29,10 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_TT_BOARD_M5STACK_CORE2=y
|
||||
CONFIG_TT_BOARD_NAME="M5Stack Core2"
|
||||
CONFIG_TT_BOARD_ID="m5stack-core2"
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_IDF_TARGET="esp32"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
@ -29,8 +29,10 @@ CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_TT_BOARD_M5STACK_CORES3=y
|
||||
CONFIG_TT_BOARD_NAME="M5Stack CoreS3"
|
||||
CONFIG_TT_BOARD_ID="m5stack-cores3"
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
@ -30,6 +30,8 @@ CONFIG_FATFS_VOLUME_COUNT=3
|
||||
|
||||
# Hardware: Main
|
||||
CONFIG_TT_BOARD_UNPHONE=y
|
||||
CONFIG_TT_BOARD_NAME="unPhone"
|
||||
CONFIG_TT_BOARD_ID="unphone"
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user