ESP-NOW bridge for P4 (#573)

This commit is contained in:
Shadowtrance
2026-07-19 17:23:20 +10:00
committed by GitHub
parent bd30aa046a
commit 2d768ef3a1
40 changed files with 1343 additions and 182 deletions
@@ -0,0 +1,29 @@
#include "tt_app_fileselection.h"
#include <Tactility/app/App.h>
#include <Tactility/app/fileselection/FileSelection.h>
#include <Tactility/Bundle.h>
#include <cstring>
#include <string>
extern "C" {
AppLaunchId tt_app_fileselection_start_for_existing_file() {
return tt::app::fileselection::startForExistingFile();
}
AppLaunchId tt_app_fileselection_start_for_existing_or_new_file() {
return tt::app::fileselection::startForExistingOrNewFile();
}
bool tt_app_fileselection_get_result_path(BundleHandle handle, char* buffer, uint32_t bufferSize) {
auto path = tt::app::fileselection::getResultPath(*(tt::Bundle*)handle);
if (path.empty() || bufferSize == 0) {
return false;
}
strncpy(buffer, path.c_str(), bufferSize - 1);
buffer[bufferSize - 1] = '\0';
return true;
}
}
+7
View File
@@ -2,6 +2,7 @@
#include "tt_app.h"
#include "tt_app_alertdialog.h"
#include "tt_app_fileselection.h"
#include "tt_app_selectiondialog.h"
#include "tt_bundle.h"
#include "tt_gps.h"
@@ -41,6 +42,7 @@
#include <esp_netif.h>
#include <esp_heap_caps.h>
#include <esp_timer.h>
#include <esp_system.h>
#include <fcntl.h>
#include <lwip/sockets.h>
#include <lwip/netdb.h>
@@ -274,6 +276,9 @@ const esp_elfsym main_symbols[] {
ESP_ELFSYM_EXPORT(tt_app_get_parameters),
ESP_ELFSYM_EXPORT(tt_app_set_result),
ESP_ELFSYM_EXPORT(tt_app_has_result),
ESP_ELFSYM_EXPORT(tt_app_fileselection_start_for_existing_file),
ESP_ELFSYM_EXPORT(tt_app_fileselection_start_for_existing_or_new_file),
ESP_ELFSYM_EXPORT(tt_app_fileselection_get_result_path),
ESP_ELFSYM_EXPORT(tt_app_selectiondialog_start),
ESP_ELFSYM_EXPORT(tt_app_selectiondialog_get_result_index),
ESP_ELFSYM_EXPORT(tt_app_alertdialog_start),
@@ -460,6 +465,8 @@ const esp_elfsym main_symbols[] {
ESP_ELFSYM_EXPORT(ppa_do_scale_rotate_mirror),
// esp_cache.h
ESP_ELFSYM_EXPORT(esp_cache_msync),
// esp_system.h
ESP_ELFSYM_EXPORT(esp_restart),
#endif
// delimiter
ESP_ELFSYM_END