mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-20 17:05:06 +00:00
Fixes for paths
This commit is contained in:
parent
45c796c7cd
commit
ef4d0c6cdc
@ -72,7 +72,7 @@ bool delete_recursively(const std::string& path) {
|
||||
|
||||
bool get_app_install_directory(std::string& out_path) {
|
||||
char root[192];
|
||||
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
if (paths_get_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
out_path = std::string(root) + "/app";
|
||||
|
||||
@ -11,7 +11,7 @@ extern "C" {
|
||||
|
||||
error_t app_paths_get_user_data_directory(const char* app_id, char* out_path, size_t out_path_size) {
|
||||
char root[192];
|
||||
error_t error = paths_get_user_data_path(root, sizeof(root));
|
||||
error_t error = paths_get_data_path(root, sizeof(root));
|
||||
if (error != ERROR_NONE) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
error_t service_paths_get_user_data_directory(const char* service_id, char* out_path, size_t out_path_size) {
|
||||
char root[192];
|
||||
error_t error = paths_get_user_data_path(root, sizeof(root));
|
||||
error_t error = paths_get_data_path(root, sizeof(root));
|
||||
if (error != ERROR_NONE) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
#include <Tactility/app/i2cscanner/I2cHelpers.h>
|
||||
#include <Tactility/app/i2cscanner/I2cScannerPrivate.h>
|
||||
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <Tactility/Timer.h>
|
||||
#include <Tactility/app/i2cscanner/I2cHelpers.h>
|
||||
#include <Tactility/app/i2cscanner/I2cScannerPrivate.h>
|
||||
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/paths.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/paths.h>
|
||||
#include <tactility/preferences.h>
|
||||
|
||||
#include <cassert>
|
||||
@ -55,7 +56,7 @@ struct Context {
|
||||
|
||||
bool getPreferencesPath(std::string& outPath) {
|
||||
char root[128];
|
||||
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
if (app_paths_get_user_data_directory(manifest.id, root, sizeof(root)) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
outPath = std::string(root) + "/i2c_scanner.properties";
|
||||
|
||||
@ -9,11 +9,11 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/paths.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/paths.h>
|
||||
|
||||
#include <lvgl/fonts.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -40,7 +40,7 @@ namespace {
|
||||
|
||||
bool getCompletedMarkerPath(std::string& outPath) {
|
||||
char root[128];
|
||||
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
if (app_paths_get_user_data_directory(manifest.id, root, sizeof(root)) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
outPath = std::string(root) + "/.setup_complete";
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
#include <service/paths.h>
|
||||
|
||||
#include <Tactility/network/NtpPrivate.h>
|
||||
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/paths.h>
|
||||
#include <tactility/preferences.h>
|
||||
#include <tactility/system_event.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <tactility/system_event.h>
|
||||
#include <esp_netif_sntp.h>
|
||||
#include <esp_sntp.h>
|
||||
#endif
|
||||
@ -23,7 +24,8 @@ static bool processedSyncEvent = false;
|
||||
|
||||
static bool getPreferencesPath(std::string& outPath) {
|
||||
char root[128];
|
||||
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
// Not really a service, but this is the best way of organising it for now
|
||||
if (service_paths_get_user_data_directory("tactility.ntp", root, sizeof(root)) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
outPath = std::string(root) + "/time.properties";
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <Tactility/settings/Time.h>
|
||||
#include <service/paths.h>
|
||||
|
||||
#include <Tactility/settings/Time.h>
|
||||
#include <Tactility/settings/SystemSettings.h>
|
||||
|
||||
#include <tactility/paths.h>
|
||||
@ -24,7 +25,8 @@ namespace {
|
||||
// "syncTime" - matches the shared NVS namespace this used to be.
|
||||
bool getPreferencesPath(std::string& outPath) {
|
||||
char root[128];
|
||||
if (paths_get_user_data_path(root, sizeof(root)) != ERROR_NONE) {
|
||||
// Not really a service, but this is the best way of organising it for now
|
||||
if (service_paths_get_user_data_directory("tactility.time", root, sizeof(root)) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
outPath = std::string(root) + "/" + TIME_SETTINGS_NAMESPACE + ".properties";
|
||||
|
||||
@ -17,7 +17,7 @@ extern "C" {
|
||||
* @retval ERROR_BUFFER_OVERFLOW if out_path_size is too small
|
||||
* @retval ERROR_NONE on success
|
||||
*/
|
||||
error_t paths_get_user_data_path(char* out_path, size_t out_path_size);
|
||||
error_t paths_get_data_path(char* out_path, size_t out_path_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_size) {
|
||||
static error_t paths_get_data_root_path(char* out_path, size_t out_path_size) {
|
||||
#if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
|
||||
#ifdef ESP_PLATFORM
|
||||
const char* mount_point = "/data";
|
||||
@ -41,10 +41,10 @@ static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_siz
|
||||
|
||||
extern "C" {
|
||||
|
||||
error_t paths_get_user_data_path(char* out_path, size_t out_path_size) {
|
||||
error_t paths_get_data_path(char* out_path, size_t out_path_size) {
|
||||
#ifdef ESP_PLATFORM
|
||||
char root[64];
|
||||
error_t error = paths_get_user_data_root_path(root, sizeof(root));
|
||||
error_t error = paths_get_data_root_path(root, sizeof(root));
|
||||
if (error != ERROR_NONE) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
||||
DEFINE_MODULE_SYMBOL(keyboard_read_key),
|
||||
DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE),
|
||||
// drivers/paths
|
||||
DEFINE_MODULE_SYMBOL(paths_get_user_data_path),
|
||||
DEFINE_MODULE_SYMBOL(paths_get_data_path),
|
||||
// drivers/pointer
|
||||
DEFINE_MODULE_SYMBOL(pointer_enter_sleep),
|
||||
DEFINE_MODULE_SYMBOL(pointer_exit_sleep),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user