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:
Ken Van Hoeylandt
2025-01-21 21:55:54 +01:00
committed by GitHub
parent 97b8007aca
commit 12a9839420
58 changed files with 147 additions and 101 deletions
+22
View 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();
}
}
+17
View File
@@ -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) {
+18 -6
View File
@@ -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 = "";