mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-22 03:15:05 +00:00
Compare commits
No commits in common. "e9f72490fc93d66a2bf2b3fa00c79727bc04895f" and "ee5a5a7181715ffa194fa4a373c0f4dd9875a257" have entirely different histories.
e9f72490fc
...
ee5a5a7181
2
.github/actions/build-firmware/action.yml
vendored
2
.github/actions/build-firmware/action.yml
vendored
@ -20,7 +20,7 @@ runs:
|
|||||||
- name: 'Build'
|
- name: 'Build'
|
||||||
uses: espressif/esp-idf-ci-action@v1
|
uses: espressif/esp-idf-ci-action@v1
|
||||||
with:
|
with:
|
||||||
esp_idf_version: v5.5
|
esp_idf_version: v5.4
|
||||||
target: ${{ inputs.arch }}
|
target: ${{ inputs.arch }}
|
||||||
path: './'
|
path: './'
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
|
|||||||
4
.github/actions/build-sdk/action.yml
vendored
4
.github/actions/build-sdk/action.yml
vendored
@ -21,14 +21,14 @@ runs:
|
|||||||
uses: espressif/esp-idf-ci-action@v1
|
uses: espressif/esp-idf-ci-action@v1
|
||||||
with:
|
with:
|
||||||
# NOTE: Update with ESP-IDF!
|
# NOTE: Update with ESP-IDF!
|
||||||
esp_idf_version: v5.5
|
esp_idf_version: v5.4
|
||||||
target: ${{ inputs.arch }}
|
target: ${{ inputs.arch }}
|
||||||
path: './'
|
path: './'
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
# NOTE: Update with ESP-IDF!
|
# NOTE: Update with ESP-IDF!
|
||||||
ESP_IDF_VERSION: '5.5'
|
ESP_IDF_VERSION: '5.4'
|
||||||
run: Buildscripts/release-sdk.sh release/TactilitySDK
|
run: Buildscripts/release-sdk.sh release/TactilitySDK
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@ -19,4 +19,4 @@ dependencies:
|
|||||||
version: "1.7.6~1"
|
version: "1.7.6~1"
|
||||||
rules:
|
rules:
|
||||||
- if: "target == esp32s3"
|
- if: "target == esp32s3"
|
||||||
idf: '5.5'
|
idf: '5.4'
|
||||||
|
|||||||
@ -239,13 +239,13 @@ void TpagerKeyboard::initEncoder(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pcnt_chan_config_t chan_1_config = {
|
pcnt_chan_config_t chan_1_config = {
|
||||||
.edge_gpio_num = ENCODER_B,
|
|
||||||
.level_gpio_num = ENCODER_A,
|
|
||||||
};
|
|
||||||
pcnt_chan_config_t chan_2_config = {
|
|
||||||
.edge_gpio_num = ENCODER_A,
|
.edge_gpio_num = ENCODER_A,
|
||||||
.level_gpio_num = ENCODER_B,
|
.level_gpio_num = ENCODER_B,
|
||||||
};
|
};
|
||||||
|
pcnt_chan_config_t chan_2_config = {
|
||||||
|
.edge_gpio_num = ENCODER_B,
|
||||||
|
.level_gpio_num = ENCODER_A,
|
||||||
|
};
|
||||||
|
|
||||||
pcnt_channel_handle_t pcnt_chan_1 = NULL;
|
pcnt_channel_handle_t pcnt_chan_1 = NULL;
|
||||||
pcnt_channel_handle_t pcnt_chan_2 = NULL;
|
pcnt_channel_handle_t pcnt_chan_2 = NULL;
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
language=en-US
|
|
||||||
timeFormat24h=true
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Apps
|
|
||||||
Files
|
|
||||||
Settings
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Apps
|
|
||||||
Files
|
|
||||||
Settings
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Appli
|
|
||||||
Fichiers
|
|
||||||
Réglages
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Apps
|
|
||||||
Bestanden
|
|
||||||
Instellingen
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
Apps
|
|
||||||
Bestanden
|
|
||||||
Instellingen
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
Dutch (Netherlands)
|
|
||||||
Dutch (Belgium)
|
|
||||||
English (United States)
|
|
||||||
English (United Kingdom)
|
|
||||||
French (France)
|
|
||||||
Region
|
|
||||||
Language
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
Dutch (Netherlands)
|
|
||||||
Dutch (Belgium)
|
|
||||||
English (United States)
|
|
||||||
English (United Kingdom)
|
|
||||||
French (France)
|
|
||||||
Region
|
|
||||||
Language
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
Néerlandais (Pays-Bas)
|
|
||||||
Néerlandais (Belgique)
|
|
||||||
Anglais (États-Unis)
|
|
||||||
Anglais (Royaume-Uni)
|
|
||||||
Français (France)
|
|
||||||
Région
|
|
||||||
Langue
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
Nederlands (Nederland)
|
|
||||||
Nederlands (België)
|
|
||||||
Engels (Verenigde Staten)
|
|
||||||
Engels (Verenigd Koninkrijk)
|
|
||||||
Frans (Frankrijk)
|
|
||||||
Regio
|
|
||||||
Taal
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
Nederlands (Nederland)
|
|
||||||
Nederlands (België)
|
|
||||||
Engels (Verenigde Staten)
|
|
||||||
Engels (Verenigd Koninkrijk)
|
|
||||||
Frans (Frankrijk)
|
|
||||||
Regio
|
|
||||||
Taal
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
OK
|
|
||||||
Yes
|
|
||||||
No
|
|
||||||
Cancel
|
|
||||||
Retry
|
|
||||||
Close
|
|
||||||
Open
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
OK
|
|
||||||
Yes
|
|
||||||
No
|
|
||||||
Cancel
|
|
||||||
Retry
|
|
||||||
Close
|
|
||||||
Open
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
OK
|
|
||||||
Oui
|
|
||||||
Non
|
|
||||||
Annuler
|
|
||||||
Réessayer
|
|
||||||
Fermer
|
|
||||||
Ouvrir
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
OK
|
|
||||||
Ja
|
|
||||||
Nee
|
|
||||||
Annuleren
|
|
||||||
Opnieuw
|
|
||||||
Sluiten
|
|
||||||
Openen
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
OK
|
|
||||||
Ja
|
|
||||||
Nee
|
|
||||||
Annuleren
|
|
||||||
Opnieuw
|
|
||||||
Sluiten
|
|
||||||
Openen
|
|
||||||
@ -4,15 +4,15 @@
|
|||||||
|
|
||||||
- Move Development settings from flash to `/data/apps/development/development.properties` (just the "start on boot")
|
- Move Development settings from flash to `/data/apps/development/development.properties` (just the "start on boot")
|
||||||
- Move Display settings from flash to `/data/apps/display/display.properties`
|
- Move Display settings from flash to `/data/apps/display/display.properties`
|
||||||
|
- App data directory should be automatically created (and then we can remove the custom code from Notes.cpp)
|
||||||
|
- When an external app fails to load (e.g. due to mapping error) then show an error dialog.
|
||||||
- Expose app::Paths to TactilityC
|
- Expose app::Paths to TactilityC
|
||||||
- Call tt::lvgl::isSyncSet after HAL init and show an error (and crash?) when it is not set.
|
- Call tt::lvgl::isSyncSet after HAL init and show an error (and crash?) when it is not set.
|
||||||
- External app loading: Check the version of Tactility and check ESP target hardware to check for compatibility.
|
- External app loading: Check the version of Tactility and check ESP target hardware to check for compatibility.
|
||||||
|
- Localization of texts (load in boot app from sd?)
|
||||||
- App packaging
|
- App packaging
|
||||||
- Create more unit tests for `tactility-core`
|
- Create more unit tests for `tactility-core`
|
||||||
- Make a URL handler. Use it for handling local files. Match file types with apps.
|
- Make a URL handler. Use it for handling local files. Match file types with apps.
|
||||||
- Fix Development service: when no SD card is present, the app fails to install. Consider installing to `/data`
|
|
||||||
- Refactor `PropertiesFile.cpp` to use `tt::file::readLines()` (see TODO in code)
|
|
||||||
- Localize all apps
|
|
||||||
|
|
||||||
## Lower Priority
|
## Lower Priority
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/i18n/TextResources.h"
|
|
||||||
|
|
||||||
// WARNING: This file is auto-generated. Do not edit manually.
|
|
||||||
|
|
||||||
namespace tt::i18n::core {
|
|
||||||
|
|
||||||
enum class Text {
|
|
||||||
OK = 0,
|
|
||||||
YES = 1,
|
|
||||||
NO = 2,
|
|
||||||
CANCEL = 3,
|
|
||||||
RETRY = 4,
|
|
||||||
CLOSE = 5,
|
|
||||||
OPEN = 6,
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace tt::i18n {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds localized text data.
|
|
||||||
*
|
|
||||||
* It is used with data generated from Translations/ with the python generation scripts.
|
|
||||||
* It's used with a header file that specifies the indexes, and generated text files (.i18n)
|
|
||||||
*/
|
|
||||||
class TextResources {
|
|
||||||
|
|
||||||
std::vector<std::string> data;
|
|
||||||
std::string path;
|
|
||||||
static std::string ERROR_RESULT;
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* @param[in] path
|
|
||||||
*/
|
|
||||||
TextResources(const std::string& path) : path(path) {}
|
|
||||||
|
|
||||||
const std::string& get(const int index) const {
|
|
||||||
if (index < data.size()) {
|
|
||||||
return data[index];
|
|
||||||
} else {
|
|
||||||
return ERROR_RESULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename EnumType>
|
|
||||||
const std::string& get(EnumType value) const { return get(static_cast<int>(value)); }
|
|
||||||
|
|
||||||
const std::string& operator[](const int index) const { return get(index); }
|
|
||||||
|
|
||||||
template <typename EnumType>
|
|
||||||
const std::string& operator[](const EnumType index) const { return get(index); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load or reload an i18n file with the system's current locale settings.
|
|
||||||
* @return true on success
|
|
||||||
*/
|
|
||||||
bool load();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
enum class Language {
|
|
||||||
en_GB,
|
|
||||||
en_US,
|
|
||||||
fr_FR,
|
|
||||||
nl_BE,
|
|
||||||
nl_NL,
|
|
||||||
count
|
|
||||||
};
|
|
||||||
|
|
||||||
void setLanguage(Language language);
|
|
||||||
|
|
||||||
Language getLanguage();
|
|
||||||
|
|
||||||
std::string toString(Language language);
|
|
||||||
|
|
||||||
bool fromString(const std::string& text, Language& language);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Language.h"
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
struct SettingsProperties {
|
|
||||||
Language language;
|
|
||||||
bool timeFormat24h;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool loadSettingsProperties(SettingsProperties& properties);
|
|
||||||
|
|
||||||
bool saveSettingsProperties(const SettingsProperties& properties);
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace tt::settings {
|
namespace tt::time {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the timezone
|
* Set the timezone
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/i18n/TextResources.h"
|
|
||||||
|
|
||||||
// WARNING: This file is auto-generated. Do not edit manually.
|
|
||||||
|
|
||||||
namespace tt::app::launcher::i18n {
|
|
||||||
|
|
||||||
enum class Text {
|
|
||||||
APPS = 0,
|
|
||||||
FILES = 1,
|
|
||||||
SETTINGS = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace tt::app::localesettings {
|
|
||||||
|
|
||||||
void start();
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/i18n/TextResources.h"
|
|
||||||
|
|
||||||
// WARNING: This file is auto-generated. Do not edit manually.
|
|
||||||
|
|
||||||
namespace tt::app::localesettings::i18n {
|
|
||||||
|
|
||||||
enum class Text {
|
|
||||||
NL_NL = 0,
|
|
||||||
NL_BE = 1,
|
|
||||||
EN_US = 2,
|
|
||||||
EN_GB = 3,
|
|
||||||
FR_FR = 4,
|
|
||||||
REGION = 5,
|
|
||||||
LANGUAGE = 6,
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
void initTimeZone();
|
|
||||||
|
|
||||||
}
|
|
||||||
7
Tactility/Private/Tactility/time/TimePrivate.h
Normal file
7
Tactility/Private/Tactility/time/TimePrivate.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace tt::time {
|
||||||
|
|
||||||
|
void init();
|
||||||
|
|
||||||
|
}
|
||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace tt {
|
namespace tt {
|
||||||
|
|
||||||
static const char* TAG = "Partitions";
|
static const char* TAG = "partitions";
|
||||||
|
|
||||||
static esp_err_t initNvsFlashSafely() {
|
static esp_err_t initNvsFlashSafely() {
|
||||||
esp_err_t result = nvs_flash_init();
|
esp_err_t result = nvs_flash_init();
|
||||||
@ -22,27 +22,13 @@ static esp_err_t initNvsFlashSafely() {
|
|||||||
|
|
||||||
static wl_handle_t data_wl_handle = WL_INVALID_HANDLE;
|
static wl_handle_t data_wl_handle = WL_INVALID_HANDLE;
|
||||||
|
|
||||||
size_t getSectorSize() {
|
|
||||||
#if defined(CONFIG_FATFS_SECTOR_512)
|
|
||||||
return 512;
|
|
||||||
#elif defined(CONFIG_FATFS_SECTOR_1024)
|
|
||||||
return 1024;
|
|
||||||
#elif defined(CONFIG_FATFS_SECTOR_2048)
|
|
||||||
return 2048;
|
|
||||||
#elif defined(CONFIG_FATFS_SECTOR_4096)
|
|
||||||
return 4096;
|
|
||||||
#else
|
|
||||||
#error Not implemented
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_err_t initPartitionsEsp() {
|
esp_err_t initPartitionsEsp() {
|
||||||
ESP_ERROR_CHECK(initNvsFlashSafely());
|
ESP_ERROR_CHECK(initNvsFlashSafely());
|
||||||
|
|
||||||
const esp_vfs_fat_mount_config_t mount_config = {
|
const esp_vfs_fat_mount_config_t mount_config = {
|
||||||
.format_if_mount_failed = false,
|
.format_if_mount_failed = false,
|
||||||
.max_files = 4,
|
.max_files = 4,
|
||||||
.allocation_unit_size = getSectorSize(),
|
.allocation_unit_size = CONFIG_WL_SECTOR_SIZE,
|
||||||
.disk_status_check_enable = false,
|
.disk_status_check_enable = false,
|
||||||
.use_one_fat = true,
|
.use_one_fat = true,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -47,7 +47,6 @@ namespace app {
|
|||||||
namespace imageviewer { extern const AppManifest manifest; }
|
namespace imageviewer { extern const AppManifest manifest; }
|
||||||
namespace inputdialog { extern const AppManifest manifest; }
|
namespace inputdialog { extern const AppManifest manifest; }
|
||||||
namespace launcher { extern const AppManifest manifest; }
|
namespace launcher { extern const AppManifest manifest; }
|
||||||
namespace localesettings { extern const AppManifest manifest; }
|
|
||||||
namespace log { extern const AppManifest manifest; }
|
namespace log { extern const AppManifest manifest; }
|
||||||
namespace notes { extern const AppManifest manifest; }
|
namespace notes { extern const AppManifest manifest; }
|
||||||
namespace power { extern const AppManifest manifest; }
|
namespace power { extern const AppManifest manifest; }
|
||||||
@ -90,7 +89,6 @@ static void registerSystemApps() {
|
|||||||
addApp(app::imageviewer::manifest);
|
addApp(app::imageviewer::manifest);
|
||||||
addApp(app::inputdialog::manifest);
|
addApp(app::inputdialog::manifest);
|
||||||
addApp(app::launcher::manifest);
|
addApp(app::launcher::manifest);
|
||||||
addApp(app::localesettings::manifest);
|
|
||||||
addApp(app::log::manifest);
|
addApp(app::log::manifest);
|
||||||
addApp(app::notes::manifest);
|
addApp(app::notes::manifest);
|
||||||
addApp(app::serialconsole::manifest);
|
addApp(app::serialconsole::manifest);
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include "Tactility/service/ServiceRegistration.h"
|
#include "Tactility/service/ServiceRegistration.h"
|
||||||
|
|
||||||
#include <Tactility/Dispatcher.h>
|
#include <Tactility/Dispatcher.h>
|
||||||
#include <Tactility/settings/TimePrivate.h>
|
#include <Tactility/time/TimePrivate.h>
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
#include "Tactility/InitEsp.h"
|
#include "Tactility/InitEsp.h"
|
||||||
@ -45,7 +45,7 @@ void initHeadless(const hal::Configuration& config) {
|
|||||||
initEsp();
|
initEsp();
|
||||||
#endif
|
#endif
|
||||||
hardwareConfig = &config;
|
hardwareConfig = &config;
|
||||||
settings::initTimeZone();
|
time::init();
|
||||||
hal::init(config);
|
hal::init(config);
|
||||||
network::ntp::init();
|
network::ntp::init();
|
||||||
registerAndStartSystemServices();
|
registerAndStartSystemServices();
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <Tactility/app/alertdialog/AlertDialog.h>
|
|
||||||
|
|
||||||
namespace tt::app {
|
namespace tt::app {
|
||||||
|
|
||||||
@ -40,18 +39,10 @@ class ElfApp : public App {
|
|||||||
|
|
||||||
const std::string filePath;
|
const std::string filePath;
|
||||||
std::unique_ptr<uint8_t[]> elfFileData;
|
std::unique_ptr<uint8_t[]> elfFileData;
|
||||||
esp_elf_t elf {
|
esp_elf_t elf;
|
||||||
.psegment = nullptr,
|
|
||||||
.svaddr = 0,
|
|
||||||
.ptext = nullptr,
|
|
||||||
.pdata = nullptr,
|
|
||||||
.sec = { },
|
|
||||||
.entry = nullptr
|
|
||||||
};
|
|
||||||
bool shouldCleanupElf = false; // Whether we have to clean up the above "elf" object
|
bool shouldCleanupElf = false; // Whether we have to clean up the above "elf" object
|
||||||
std::unique_ptr<ElfManifest> manifest;
|
std::unique_ptr<ElfManifest> manifest;
|
||||||
void* data = nullptr;
|
void* data = nullptr;
|
||||||
std::string lastError = "";
|
|
||||||
|
|
||||||
bool startElf() {
|
bool startElf() {
|
||||||
TT_LOG_I(TAG, "Starting ELF %s", filePath.c_str());
|
TT_LOG_I(TAG, "Starting ELF %s", filePath.c_str());
|
||||||
@ -67,17 +58,14 @@ class ElfApp : public App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (esp_elf_init(&elf) != ESP_OK) {
|
if (esp_elf_init(&elf) != ESP_OK) {
|
||||||
lastError = "Failed to initialize";
|
TT_LOG_E(TAG, "Failed to initialize");
|
||||||
TT_LOG_E(TAG, "%s", lastError.c_str());
|
|
||||||
elfFileData = nullptr;
|
elfFileData = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto relocate_result = esp_elf_relocate(&elf, elfFileData.get());
|
if (esp_elf_relocate(&elf, elfFileData.get()) != ESP_OK) {
|
||||||
if (relocate_result != 0) {
|
TT_LOG_E(TAG, "Failed to load executable");
|
||||||
// Note: the result code mapes to values from cstdlib's errno.h
|
esp_elf_deinit(&elf);
|
||||||
lastError = std::format("Failed to load executable (error code {})", -relocate_result);
|
|
||||||
TT_LOG_E(TAG, "%s", lastError.c_str());
|
|
||||||
elfFileData = nullptr;
|
elfFileData = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -86,8 +74,7 @@ class ElfApp : public App {
|
|||||||
char* argv[] = {};
|
char* argv[] = {};
|
||||||
|
|
||||||
if (esp_elf_request(&elf, 0, argc, argv) != ESP_OK) {
|
if (esp_elf_request(&elf, 0, argc, argv) != ESP_OK) {
|
||||||
lastError = "Executable returned error code";
|
TT_LOG_W(TAG, "Executable returned error code");
|
||||||
TT_LOG_E(TAG, "%s", lastError.c_str());
|
|
||||||
esp_elf_deinit(&elf);
|
esp_elf_deinit(&elf);
|
||||||
elfFileData = nullptr;
|
elfFileData = nullptr;
|
||||||
return false;
|
return false;
|
||||||
@ -119,29 +106,22 @@ public:
|
|||||||
auto lock = elfManifestLock->asScopedLock();
|
auto lock = elfManifestLock->asScopedLock();
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
|
||||||
elfManifestSetCount = 0;
|
auto initial_count = elfManifestSetCount;
|
||||||
if (!startElf()) {
|
if (startElf()) {
|
||||||
|
if (elfManifestSetCount > initial_count) {
|
||||||
|
manifest = std::make_unique<ElfManifest>(elfManifest);
|
||||||
|
lock.unlock();
|
||||||
|
|
||||||
|
if (manifest->createData != nullptr) {
|
||||||
|
data = manifest->createData();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (manifest->onCreate != nullptr) {
|
||||||
|
manifest->onCreate(&appContext, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
service::loader::stopApp();
|
service::loader::stopApp();
|
||||||
auto message = lastError.empty() ? "Application failed to start." : std::format("Application failed to start: {}", lastError);
|
|
||||||
alertdialog::start("Error", message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (elfManifestSetCount == 0) {
|
|
||||||
service::loader::stopApp();
|
|
||||||
alertdialog::start("Error", "Application failed to start: application failed to register itself");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
manifest = std::make_unique<ElfManifest>(elfManifest);
|
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
if (manifest->createData != nullptr) {
|
|
||||||
data = manifest->createData();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (manifest->onCreate != nullptr) {
|
|
||||||
manifest->onCreate(&appContext, data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#include "Tactility/app/AppContext.h"
|
#include "Tactility/app/AppContext.h"
|
||||||
#include "Tactility/app/launcher/TextResources.h"
|
|
||||||
#include "Tactility/app/AppRegistration.h"
|
#include "Tactility/app/AppRegistration.h"
|
||||||
#include "Tactility/service/loader/Loader.h"
|
#include "Tactility/service/loader/Loader.h"
|
||||||
|
|
||||||
@ -8,9 +7,9 @@
|
|||||||
#include <lvgl.h>
|
#include <lvgl.h>
|
||||||
#include <Tactility/BootProperties.h>
|
#include <Tactility/BootProperties.h>
|
||||||
|
|
||||||
namespace tt::app::launcher {
|
#define TAG "launcher"
|
||||||
|
|
||||||
constexpr auto* TAG = "Launcher";
|
namespace tt::app::launcher {
|
||||||
|
|
||||||
static void onAppPressed(TT_UNUSED lv_event_t* e) {
|
static void onAppPressed(TT_UNUSED lv_event_t* e) {
|
||||||
auto* appId = (const char*)lv_event_get_user_data(e);
|
auto* appId = (const char*)lv_event_get_user_data(e);
|
||||||
@ -53,7 +52,6 @@ static lv_obj_t* createAppButton(lv_obj_t* parent, const char* title, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LauncherApp : public App {
|
class LauncherApp : public App {
|
||||||
tt::i18n::TextResources textResources = tt::i18n::TextResources("/system/app/Launcher/i18n");
|
|
||||||
|
|
||||||
void onCreate(TT_UNUSED AppContext& app) override {
|
void onCreate(TT_UNUSED AppContext& app) override {
|
||||||
BootProperties boot_properties;
|
BootProperties boot_properties;
|
||||||
@ -64,8 +62,6 @@ class LauncherApp : public App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onShow(TT_UNUSED AppContext& app, lv_obj_t* parent) override {
|
void onShow(TT_UNUSED AppContext& app, lv_obj_t* parent) override {
|
||||||
textResources.load();
|
|
||||||
|
|
||||||
auto* wrapper = lv_obj_create(parent);
|
auto* wrapper = lv_obj_create(parent);
|
||||||
|
|
||||||
lv_obj_align(wrapper, LV_ALIGN_CENTER, 0, 0);
|
lv_obj_align(wrapper, LV_ALIGN_CENTER, 0, 0);
|
||||||
@ -91,14 +87,9 @@ class LauncherApp : public App {
|
|||||||
auto apps_icon_path = paths->getSystemPathLvgl("icon_apps.png");
|
auto apps_icon_path = paths->getSystemPathLvgl("icon_apps.png");
|
||||||
auto files_icon_path = paths->getSystemPathLvgl("icon_files.png");
|
auto files_icon_path = paths->getSystemPathLvgl("icon_files.png");
|
||||||
auto settings_icon_path = paths->getSystemPathLvgl("icon_settings.png");
|
auto settings_icon_path = paths->getSystemPathLvgl("icon_settings.png");
|
||||||
|
createAppButton(wrapper, "Apps", apps_icon_path.c_str(), "AppList", 0);
|
||||||
const auto& apps_title = textResources[i18n::Text::APPS];
|
createAppButton(wrapper, "Files", files_icon_path.c_str(), "Files", padding);
|
||||||
const auto& files_title = textResources[i18n::Text::FILES];
|
createAppButton(wrapper, "Settings", settings_icon_path.c_str(), "Settings", padding);
|
||||||
const auto& settings_title = textResources[i18n::Text::SETTINGS];
|
|
||||||
|
|
||||||
createAppButton(wrapper, apps_title.c_str(), apps_icon_path.c_str(), "AppList", 0);
|
|
||||||
createAppButton(wrapper, files_title.c_str(), files_icon_path.c_str(), "Files", padding);
|
|
||||||
createAppButton(wrapper, settings_title.c_str(), settings_icon_path.c_str(), "Settings", padding);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,168 +0,0 @@
|
|||||||
#include <Tactility/Assets.h>
|
|
||||||
#include <Tactility/app/timezone/TimeZone.h>
|
|
||||||
#include <Tactility/app/localesettings/TextResources.h>
|
|
||||||
#include <Tactility/lvgl/Toolbar.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <Tactility/service/loader/Loader.h>
|
|
||||||
#include <Tactility/settings/Time.h>
|
|
||||||
|
|
||||||
#include <lvgl.h>
|
|
||||||
#include <map>
|
|
||||||
#include <sstream>
|
|
||||||
#include <Tactility/StringUtils.h>
|
|
||||||
#include <Tactility/settings/Language.h>
|
|
||||||
|
|
||||||
namespace tt::app::localesettings {
|
|
||||||
|
|
||||||
constexpr auto* TAG = "LocaleSettings";
|
|
||||||
|
|
||||||
extern const AppManifest manifest;
|
|
||||||
|
|
||||||
class LocaleSettingsApp : public App {
|
|
||||||
tt::i18n::TextResources textResources = tt::i18n::TextResources("/system/app/LocaleSettings/i18n");
|
|
||||||
Mutex mutex = Mutex(Mutex::Type::Recursive);
|
|
||||||
lv_obj_t* timeZoneLabel = nullptr;
|
|
||||||
lv_obj_t* regionLabel = nullptr;
|
|
||||||
lv_obj_t* languageDropdown = nullptr;
|
|
||||||
lv_obj_t* languageLabel = nullptr;
|
|
||||||
|
|
||||||
static void onConfigureTimeZonePressed(TT_UNUSED lv_event_t* event) {
|
|
||||||
timezone::start();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<settings::Language, std::string> languageMap;
|
|
||||||
|
|
||||||
std::string getLanguageOptions() const {
|
|
||||||
std::vector<std::string> items;
|
|
||||||
for (int i = 0; i < static_cast<int>(settings::Language::count); i++) {
|
|
||||||
switch (static_cast<settings::Language>(i)) {
|
|
||||||
case settings::Language::en_GB:
|
|
||||||
items.push_back(textResources[i18n::Text::EN_GB]);
|
|
||||||
break;
|
|
||||||
case settings::Language::en_US:
|
|
||||||
items.push_back(textResources[i18n::Text::EN_US]);
|
|
||||||
break;
|
|
||||||
case settings::Language::fr_FR:
|
|
||||||
items.push_back(textResources[i18n::Text::FR_FR]);
|
|
||||||
break;
|
|
||||||
case settings::Language::nl_BE:
|
|
||||||
items.push_back(textResources[i18n::Text::NL_BE]);
|
|
||||||
break;
|
|
||||||
case settings::Language::nl_NL:
|
|
||||||
items.push_back(textResources[i18n::Text::NL_NL]);
|
|
||||||
break;
|
|
||||||
case settings::Language::count:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return string::join(items, "\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateViews() {
|
|
||||||
textResources.load();
|
|
||||||
|
|
||||||
lv_label_set_text(regionLabel , textResources[i18n::Text::REGION].c_str());
|
|
||||||
lv_label_set_text(languageLabel, textResources[i18n::Text::LANGUAGE].c_str());
|
|
||||||
|
|
||||||
std::string language_options = getLanguageOptions();
|
|
||||||
lv_dropdown_set_options(languageDropdown, language_options.c_str());
|
|
||||||
lv_dropdown_set_selected(languageDropdown, static_cast<uint32_t>(settings::getLanguage()));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void onLanguageSet(lv_event_t* event) {
|
|
||||||
auto* dropdown = static_cast<lv_obj_t*>(lv_event_get_target(event));
|
|
||||||
auto index = lv_dropdown_get_selected(dropdown);
|
|
||||||
auto language = static_cast<settings::Language>(index);
|
|
||||||
settings::setLanguage(language);
|
|
||||||
|
|
||||||
auto* self = static_cast<LocaleSettingsApp*>(lv_event_get_user_data(event));
|
|
||||||
self->updateViews();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
void onShow(AppContext& app, lv_obj_t* parent) override {
|
|
||||||
textResources.load();
|
|
||||||
|
|
||||||
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
|
|
||||||
|
|
||||||
lvgl::toolbar_create(parent, app);
|
|
||||||
|
|
||||||
auto* main_wrapper = lv_obj_create(parent);
|
|
||||||
lv_obj_set_flex_flow(main_wrapper, LV_FLEX_FLOW_COLUMN);
|
|
||||||
lv_obj_set_width(main_wrapper, LV_PCT(100));
|
|
||||||
lv_obj_set_flex_grow(main_wrapper, 1);
|
|
||||||
|
|
||||||
auto* region_wrapper = lv_obj_create(main_wrapper);
|
|
||||||
lv_obj_set_width(region_wrapper, LV_PCT(100));
|
|
||||||
lv_obj_set_height(region_wrapper, LV_SIZE_CONTENT);
|
|
||||||
lv_obj_set_style_pad_all(region_wrapper, 0, 0);
|
|
||||||
lv_obj_set_style_border_width(region_wrapper, 0, 0);
|
|
||||||
|
|
||||||
regionLabel = lv_label_create(region_wrapper);
|
|
||||||
lv_label_set_text(regionLabel , textResources[i18n::Text::REGION].c_str());
|
|
||||||
lv_obj_align(regionLabel , LV_ALIGN_LEFT_MID, 0, 0);
|
|
||||||
|
|
||||||
timeZoneLabel = lv_label_create(region_wrapper);
|
|
||||||
std::string timeZoneName = settings::getTimeZoneName();
|
|
||||||
if (timeZoneName.empty()) {
|
|
||||||
timeZoneName = "not set";
|
|
||||||
}
|
|
||||||
lv_label_set_text(timeZoneLabel, timeZoneName.c_str());
|
|
||||||
// TODO: Find out why Y offset is needed
|
|
||||||
lv_obj_align_to(timeZoneLabel, regionLabel, LV_ALIGN_OUT_RIGHT_MID, 10, 8);
|
|
||||||
|
|
||||||
auto* region_button = lv_button_create(region_wrapper);
|
|
||||||
lv_obj_align(region_button, LV_ALIGN_TOP_RIGHT, 0, 0);
|
|
||||||
auto* region_button_image = lv_image_create(region_button);
|
|
||||||
lv_obj_add_event_cb(region_button, onConfigureTimeZonePressed, LV_EVENT_SHORT_CLICKED, nullptr);
|
|
||||||
lv_image_set_src(region_button_image, LV_SYMBOL_SETTINGS);
|
|
||||||
|
|
||||||
auto* language_wrapper = lv_obj_create(main_wrapper);
|
|
||||||
lv_obj_set_width(language_wrapper, LV_PCT(100));
|
|
||||||
lv_obj_set_height(language_wrapper, LV_SIZE_CONTENT);
|
|
||||||
lv_obj_set_style_pad_all(language_wrapper, 0, 0);
|
|
||||||
lv_obj_set_style_border_width(language_wrapper, 0, 0);
|
|
||||||
|
|
||||||
languageLabel = lv_label_create(language_wrapper);
|
|
||||||
lv_label_set_text(languageLabel, textResources[i18n::Text::LANGUAGE].c_str());
|
|
||||||
lv_obj_align(languageLabel, LV_ALIGN_LEFT_MID, 0, 0);
|
|
||||||
|
|
||||||
languageDropdown = lv_dropdown_create(language_wrapper);
|
|
||||||
lv_obj_align(languageDropdown, LV_ALIGN_RIGHT_MID, 0, 0);
|
|
||||||
std::string language_options = getLanguageOptions();
|
|
||||||
lv_dropdown_set_options(languageDropdown, language_options.c_str());
|
|
||||||
lv_dropdown_set_selected(languageDropdown, static_cast<uint32_t>(settings::getLanguage()));
|
|
||||||
lv_obj_add_event_cb(languageDropdown, onLanguageSet, LV_EVENT_VALUE_CHANGED, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void onResult(AppContext& app, TT_UNUSED LaunchId launchId, Result result, std::unique_ptr<Bundle> bundle) override {
|
|
||||||
if (result == Result::Ok && bundle != nullptr) {
|
|
||||||
const auto name = timezone::getResultName(*bundle);
|
|
||||||
const auto code = timezone::getResultCode(*bundle);
|
|
||||||
TT_LOG_I(TAG, "Result name=%s code=%s", name.c_str(), code.c_str());
|
|
||||||
settings::setTimeZone(name, code);
|
|
||||||
|
|
||||||
if (!name.empty()) {
|
|
||||||
if (lvgl::lock(100 / portTICK_PERIOD_MS)) {
|
|
||||||
lv_label_set_text(timeZoneLabel, name.c_str());
|
|
||||||
lvgl::unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const AppManifest manifest = {
|
|
||||||
.id = "LocaleSettings",
|
|
||||||
.name = "Region & Language",
|
|
||||||
.icon = TT_ASSETS_APP_ICON_TIME_DATE_SETTINGS,
|
|
||||||
.type = Type::Settings,
|
|
||||||
.createApp = create<LocaleSettingsApp>
|
|
||||||
};
|
|
||||||
|
|
||||||
void start() {
|
|
||||||
service::loader::startApp(manifest.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@ -1,25 +1,33 @@
|
|||||||
#include <Tactility/Assets.h>
|
#include "Tactility/app/timezone/TimeZone.h"
|
||||||
#include <Tactility/app/AppManifest.h>
|
#include "Tactility/lvgl/Toolbar.h"
|
||||||
#include <Tactility/lvgl/Toolbar.h>
|
#include "Tactility/service/loader/Loader.h"
|
||||||
#include <Tactility/service/loader/Loader.h>
|
#include "Tactility/lvgl/LvglSync.h"
|
||||||
#include <Tactility/settings/Time.h>
|
|
||||||
|
|
||||||
|
#include <Tactility/Assets.h>
|
||||||
|
#include <Tactility/time/Time.h>
|
||||||
#include <lvgl.h>
|
#include <lvgl.h>
|
||||||
|
|
||||||
namespace tt::app::timedatesettings {
|
#define TAG "text_viewer"
|
||||||
|
|
||||||
constexpr auto* TAG = "TimeDate";
|
namespace tt::app::timedatesettings {
|
||||||
|
|
||||||
extern const AppManifest manifest;
|
extern const AppManifest manifest;
|
||||||
|
|
||||||
class TimeDateSettingsApp : public App {
|
class TimeDateSettingsApp : public App {
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
Mutex mutex = Mutex(Mutex::Type::Recursive);
|
Mutex mutex = Mutex(Mutex::Type::Recursive);
|
||||||
|
lv_obj_t* regionLabelWidget = nullptr;
|
||||||
|
|
||||||
|
static void onConfigureTimeZonePressed(TT_UNUSED lv_event_t* event) {
|
||||||
|
timezone::start();
|
||||||
|
}
|
||||||
|
|
||||||
static void onTimeFormatChanged(lv_event_t* event) {
|
static void onTimeFormatChanged(lv_event_t* event) {
|
||||||
auto* widget = lv_event_get_target_obj(event);
|
auto* widget = lv_event_get_target_obj(event);
|
||||||
bool show_24 = lv_obj_has_state(widget, LV_STATE_CHECKED);
|
bool show_24 = lv_obj_has_state(widget, LV_STATE_CHECKED);
|
||||||
settings::setTimeFormat24Hour(show_24);
|
time::setTimeFormat24Hour(show_24);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -34,6 +42,32 @@ public:
|
|||||||
lv_obj_set_width(main_wrapper, LV_PCT(100));
|
lv_obj_set_width(main_wrapper, LV_PCT(100));
|
||||||
lv_obj_set_flex_grow(main_wrapper, 1);
|
lv_obj_set_flex_grow(main_wrapper, 1);
|
||||||
|
|
||||||
|
auto* region_wrapper = lv_obj_create(main_wrapper);
|
||||||
|
lv_obj_set_width(region_wrapper, LV_PCT(100));
|
||||||
|
lv_obj_set_height(region_wrapper, LV_SIZE_CONTENT);
|
||||||
|
lv_obj_set_style_pad_all(region_wrapper, 0, 0);
|
||||||
|
lv_obj_set_style_border_width(region_wrapper, 0, 0);
|
||||||
|
|
||||||
|
auto* region_prefix_label = lv_label_create(region_wrapper);
|
||||||
|
lv_label_set_text(region_prefix_label, "Region: ");
|
||||||
|
lv_obj_align(region_prefix_label, LV_ALIGN_LEFT_MID, 0, 0);
|
||||||
|
|
||||||
|
auto* region_label = lv_label_create(region_wrapper);
|
||||||
|
std::string timeZoneName = time::getTimeZoneName();
|
||||||
|
if (timeZoneName.empty()) {
|
||||||
|
timeZoneName = "not set";
|
||||||
|
}
|
||||||
|
regionLabelWidget = region_label;
|
||||||
|
lv_label_set_text(region_label, timeZoneName.c_str());
|
||||||
|
// TODO: Find out why Y offset is needed
|
||||||
|
lv_obj_align_to(region_label, region_prefix_label, LV_ALIGN_OUT_RIGHT_MID, 0, 8);
|
||||||
|
|
||||||
|
auto* region_button = lv_button_create(region_wrapper);
|
||||||
|
lv_obj_align(region_button, LV_ALIGN_TOP_RIGHT, 0, 0);
|
||||||
|
auto* region_button_image = lv_image_create(region_button);
|
||||||
|
lv_obj_add_event_cb(region_button, onConfigureTimeZonePressed, LV_EVENT_SHORT_CLICKED, nullptr);
|
||||||
|
lv_image_set_src(region_button_image, LV_SYMBOL_SETTINGS);
|
||||||
|
|
||||||
auto* time_format_wrapper = lv_obj_create(main_wrapper);
|
auto* time_format_wrapper = lv_obj_create(main_wrapper);
|
||||||
lv_obj_set_width(time_format_wrapper, LV_PCT(100));
|
lv_obj_set_width(time_format_wrapper, LV_PCT(100));
|
||||||
lv_obj_set_height(time_format_wrapper, LV_SIZE_CONTENT);
|
lv_obj_set_height(time_format_wrapper, LV_SIZE_CONTENT);
|
||||||
@ -47,12 +81,28 @@ public:
|
|||||||
auto* time_24h_switch = lv_switch_create(time_format_wrapper);
|
auto* time_24h_switch = lv_switch_create(time_format_wrapper);
|
||||||
lv_obj_align(time_24h_switch, LV_ALIGN_RIGHT_MID, 0, 0);
|
lv_obj_align(time_24h_switch, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||||
lv_obj_add_event_cb(time_24h_switch, onTimeFormatChanged, LV_EVENT_VALUE_CHANGED, nullptr);
|
lv_obj_add_event_cb(time_24h_switch, onTimeFormatChanged, LV_EVENT_VALUE_CHANGED, nullptr);
|
||||||
if (settings::isTimeFormat24Hour()) {
|
if (time::isTimeFormat24Hour()) {
|
||||||
lv_obj_add_state(time_24h_switch, LV_STATE_CHECKED);
|
lv_obj_add_state(time_24h_switch, LV_STATE_CHECKED);
|
||||||
} else {
|
} else {
|
||||||
lv_obj_remove_state(time_24h_switch, LV_STATE_CHECKED);
|
lv_obj_remove_state(time_24h_switch, LV_STATE_CHECKED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onResult(AppContext& app, TT_UNUSED LaunchId launchId, Result result, std::unique_ptr<Bundle> bundle) override {
|
||||||
|
if (result == Result::Ok && bundle != nullptr) {
|
||||||
|
auto name = timezone::getResultName(*bundle);
|
||||||
|
auto code = timezone::getResultCode(*bundle);
|
||||||
|
TT_LOG_I(TAG, "Result name=%s code=%s", name.c_str(), code.c_str());
|
||||||
|
time::setTimeZone(name, code);
|
||||||
|
|
||||||
|
if (!name.empty()) {
|
||||||
|
if (lvgl::lock(100 / portTICK_PERIOD_MS)) {
|
||||||
|
lv_label_set_text(regionLabelWidget, name.c_str());
|
||||||
|
lvgl::unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const AppManifest manifest = {
|
extern const AppManifest manifest = {
|
||||||
|
|||||||
@ -31,7 +31,6 @@ bool loadPropertiesFile(const std::string& filePath, std::function<void(const st
|
|||||||
const std::string input_string = input_start;
|
const std::string input_string = input_start;
|
||||||
|
|
||||||
uint16_t line_count = 0;
|
uint16_t line_count = 0;
|
||||||
// TODO: Rewrite to use file::readLines()
|
|
||||||
string::split(input_string, "\n", [&line_count, &filePath, &callback](auto token) {
|
string::split(input_string, "\n", [&line_count, &filePath, &callback](auto token) {
|
||||||
line_count++;
|
line_count++;
|
||||||
std::string key, value;
|
std::string key, value;
|
||||||
|
|||||||
@ -1,82 +0,0 @@
|
|||||||
#include "Tactility/i18n/TextResources.h"
|
|
||||||
#include "Tactility/file/FileLock.h"
|
|
||||||
|
|
||||||
#include <Tactility/file/File.h>
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <format>
|
|
||||||
#include <utility>
|
|
||||||
#include <Tactility/settings/Language.h>
|
|
||||||
|
|
||||||
namespace tt::i18n {
|
|
||||||
|
|
||||||
constexpr auto* TAG = "I18n";
|
|
||||||
|
|
||||||
static std::string getFallbackLocale() {
|
|
||||||
return "en-US";
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string getDesiredLocale() {
|
|
||||||
switch (settings::getLanguage()) {
|
|
||||||
case settings::Language::en_GB:
|
|
||||||
return "en-GB";
|
|
||||||
case settings::Language::en_US:
|
|
||||||
return "en-US";
|
|
||||||
case settings::Language::fr_FR:
|
|
||||||
return "fr-FR";
|
|
||||||
case settings::Language::nl_BE:
|
|
||||||
return "nl-BE";
|
|
||||||
case settings::Language::nl_NL:
|
|
||||||
return "nl-NL";
|
|
||||||
default:
|
|
||||||
return getFallbackLocale();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string getI18nDataFilePath(const std::string& path) {
|
|
||||||
auto locale = getDesiredLocale();
|
|
||||||
auto desired_file_path = std::format("{}/{}.i18n", path, locale);
|
|
||||||
if (file::isFile(desired_file_path)) {
|
|
||||||
return desired_file_path;
|
|
||||||
} else {
|
|
||||||
TT_LOG_W(TAG, "Translations not found for %s at %s", locale.c_str(), desired_file_path.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
auto fallback_locale = getFallbackLocale();
|
|
||||||
auto fallback_file_path = std::format("{}/{}.i18n", path, getFallbackLocale());
|
|
||||||
if (file::isFile(fallback_file_path)) {
|
|
||||||
return fallback_file_path;
|
|
||||||
} else {
|
|
||||||
TT_LOG_W(TAG, "Fallback translations not found for %s at %s", fallback_locale.c_str(), fallback_file_path.c_str());
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string TextResources::ERROR_RESULT = "TXT_RES_ERROR";
|
|
||||||
|
|
||||||
bool TextResources::load() {
|
|
||||||
std::vector<std::string> new_data;
|
|
||||||
|
|
||||||
// Resolve the language file that we need (depends on system language selection)
|
|
||||||
auto file_path = getI18nDataFilePath(path);
|
|
||||||
if (file_path.empty()) {
|
|
||||||
TT_LOG_E(TAG, "Couldn't find i18n data for %s", path.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
file::withLock<void>(file_path, [&file_path, &new_data] {
|
|
||||||
file::readLines(file_path, true, [&new_data](const char* line) {
|
|
||||||
new_data.push_back(line);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
if (new_data.empty()) {
|
|
||||||
TT_LOG_E(TAG, "Couldn't find i18n data for %s", path.c_str());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
data = std::move(new_data);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#include <Tactility/PubSub.h>
|
#include <Tactility/PubSub.h>
|
||||||
#include <Tactility/TactilityCore.h>
|
#include <Tactility/TactilityCore.h>
|
||||||
#include <Tactility/Timer.h>
|
#include <Tactility/Timer.h>
|
||||||
#include <Tactility/settings/Time.h>
|
#include <Tactility/time/Time.h>
|
||||||
|
|
||||||
#include <lvgl.h>
|
#include <lvgl.h>
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ lv_obj_t* statusbar_create(lv_obj_t* parent) {
|
|||||||
|
|
||||||
static void update_time(Statusbar* statusbar) {
|
static void update_time(Statusbar* statusbar) {
|
||||||
if (statusbar_data.time_set) {
|
if (statusbar_data.time_set) {
|
||||||
bool format24 = settings::isTimeFormat24Hour();
|
bool format24 = time::isTimeFormat24Hour();
|
||||||
int hours = format24 ? statusbar_data.time_hours : statusbar_data.time_hours % 12;
|
int hours = format24 ? statusbar_data.time_hours : statusbar_data.time_hours % 12;
|
||||||
lv_label_set_text_fmt(statusbar->time, "%d:%02d", hours, statusbar_data.time_minutes);
|
lv_label_set_text_fmt(statusbar->time, "%d:%02d", hours, statusbar_data.time_minutes);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
#include <Tactility/app/App.h>
|
#include <Tactility/app/App.h>
|
||||||
#include <Tactility/app/ElfApp.h>
|
#include <Tactility/app/ElfApp.h>
|
||||||
#include <Tactility/app/AppRegistration.h>
|
#include <Tactility/app/AppRegistration.h>
|
||||||
#include <Tactility/file/File.h>
|
|
||||||
|
|
||||||
namespace tt::service::development {
|
namespace tt::service::development {
|
||||||
|
|
||||||
@ -199,11 +198,6 @@ esp_err_t DevelopmentService::handleAppRun(httpd_req_t* request) {
|
|||||||
|
|
||||||
auto app_id = id_key_pos->second;
|
auto app_id = id_key_pos->second;
|
||||||
if (app_id.ends_with(".app.elf")) {
|
if (app_id.ends_with(".app.elf")) {
|
||||||
if (!file::isFile(app_id)) {
|
|
||||||
TT_LOG_W(TAG, "[400] /app/run cannot find app %s", app_id.c_str());
|
|
||||||
httpd_resp_send_err(request, HTTPD_400_BAD_REQUEST, "app not found");
|
|
||||||
return ESP_FAIL;
|
|
||||||
}
|
|
||||||
app::registerElfApp(app_id);
|
app::registerElfApp(app_id);
|
||||||
app_id = app::getElfAppId(app_id);
|
app_id = app::getElfAppId(app_id);
|
||||||
} else if (!app::findAppById(app_id.c_str())) {
|
} else if (!app::findAppById(app_id.c_str())) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#include "Tactility/Preferences.h"
|
#include "Tactility/Preferences.h"
|
||||||
#include "Tactility/file/PropertiesFile.h"
|
#include "Tactility/file/PropertiesFile.h"
|
||||||
|
|
||||||
#include <Tactility/Log.h>
|
#include <Tactility/LogEsp.h>
|
||||||
#include <Tactility/file/File.h>
|
#include <Tactility/file/File.h>
|
||||||
|
|
||||||
namespace tt::service::wifi::settings {
|
namespace tt::service::wifi::settings {
|
||||||
|
|||||||
@ -1,65 +0,0 @@
|
|||||||
#include <Tactility/Log.h>
|
|
||||||
#include <Tactility/settings/Language.h>
|
|
||||||
#include <utility>
|
|
||||||
#include <Tactility/settings/SettingsProperties.h>
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
constexpr auto* TAG = "Language";
|
|
||||||
|
|
||||||
void setLanguage(Language newLanguage) {
|
|
||||||
SettingsProperties properties;
|
|
||||||
if (!loadSettingsProperties(properties)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
properties.language = newLanguage;
|
|
||||||
saveSettingsProperties(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
Language getLanguage() {
|
|
||||||
SettingsProperties properties;
|
|
||||||
if (!loadSettingsProperties(properties)) {
|
|
||||||
return Language::en_US;
|
|
||||||
} else {
|
|
||||||
return properties.language;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string toString(Language language) {
|
|
||||||
switch (language) {
|
|
||||||
case Language::en_GB:
|
|
||||||
return "en-GB";
|
|
||||||
case Language::en_US:
|
|
||||||
return "en-US";
|
|
||||||
case Language::fr_FR:
|
|
||||||
return "fr-FR";
|
|
||||||
case Language::nl_BE:
|
|
||||||
return "nl-BE";
|
|
||||||
case Language::nl_NL:
|
|
||||||
return "nl-NL";
|
|
||||||
default:
|
|
||||||
TT_LOG_E(TAG, "Missing serialization for language %d", static_cast<int>(language));
|
|
||||||
std::unreachable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool fromString(const std::string& text, Language& language) {
|
|
||||||
if (text == "en-GB") {
|
|
||||||
language = Language::en_GB;
|
|
||||||
} else if (text == "en-US") {
|
|
||||||
language = Language::en_US;
|
|
||||||
} else if (text == "fr-FR") {
|
|
||||||
language = Language::fr_FR;
|
|
||||||
} else if (text == "nl-BE") {
|
|
||||||
language = Language::nl_BE;
|
|
||||||
} else if (text == "nl-NL") {
|
|
||||||
language = Language::nl_NL;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
#include <Tactility/Mutex.h>
|
|
||||||
#include <Tactility/file/FileLock.h>
|
|
||||||
#include <Tactility/file/PropertiesFile.h>
|
|
||||||
#include <Tactility/settings/Language.h>
|
|
||||||
#include <Tactility/settings/SettingsProperties.h>
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
constexpr auto* TAG = "SettingsProperties";
|
|
||||||
constexpr auto* FILE_PATH = "/data/settings.properties";
|
|
||||||
|
|
||||||
static Mutex mutex = Mutex();
|
|
||||||
static bool cached = false;
|
|
||||||
static SettingsProperties cachedProperties;
|
|
||||||
|
|
||||||
static bool loadSettingsPropertiesFromFile(SettingsProperties& properties) {
|
|
||||||
std::map<std::string, std::string> map;
|
|
||||||
if (!file::withLock<bool>(FILE_PATH, [&map] {
|
|
||||||
return file::loadPropertiesFile(FILE_PATH, map);
|
|
||||||
})) {
|
|
||||||
TT_LOG_E(TAG, "Failed to load %s", FILE_PATH);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto language_entry = map.find("language");
|
|
||||||
if (language_entry != map.end()) {
|
|
||||||
if (!fromString(language_entry->second, properties.language)) {
|
|
||||||
TT_LOG_W(TAG, "Unknown language \"%s\" in %s", language_entry->second.c_str(), FILE_PATH);
|
|
||||||
properties.language = Language::en_US;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
properties.language = Language::en_US;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto time_format_entry = map.find("timeFormat24h");
|
|
||||||
bool time_format_24h = time_format_entry == map.end() ? true : (time_format_entry->second == "true");
|
|
||||||
properties.timeFormat24h = time_format_24h;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool loadSettingsProperties(SettingsProperties& properties) {
|
|
||||||
auto scoped_lock = mutex.asScopedLock();
|
|
||||||
scoped_lock.lock();
|
|
||||||
|
|
||||||
if (!cached) {
|
|
||||||
if (!loadSettingsPropertiesFromFile(cachedProperties)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
cached = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
properties = cachedProperties;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool saveSettingsProperties(const SettingsProperties& properties) {
|
|
||||||
auto scoped_lock = mutex.asScopedLock();
|
|
||||||
scoped_lock.lock();
|
|
||||||
|
|
||||||
return file::withLock<bool>(FILE_PATH, [&properties] {
|
|
||||||
std::map<std::string, std::string> map;
|
|
||||||
map["language"] = toString(properties.language);
|
|
||||||
map["timeFormat24h"] = properties.timeFormat24h ? "true" : "false";
|
|
||||||
|
|
||||||
if (!file::savePropertiesFile(FILE_PATH, map)) {
|
|
||||||
TT_LOG_E(TAG, "Failed to save %s", FILE_PATH);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
cachedProperties = properties;
|
|
||||||
cached = true;
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,81 +0,0 @@
|
|||||||
#include <Tactility/settings/Time.h>
|
|
||||||
|
|
||||||
#include <Tactility/kernel/SystemEvents.h>
|
|
||||||
#include <Tactility/Preferences.h>
|
|
||||||
#include <Tactility/settings/SettingsProperties.h>
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
#include <ctime>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace tt::settings {
|
|
||||||
|
|
||||||
constexpr auto* TIME_SETTINGS_NAMESPACE = "time";
|
|
||||||
|
|
||||||
constexpr auto* TIMEZONE_PREFERENCES_KEY_NAME = "tz_name";
|
|
||||||
constexpr auto* TIMEZONE_PREFERENCES_KEY_CODE = "tz_code";
|
|
||||||
constexpr auto* TIMEZONE_PREFERENCES_KEY_TIME24 = "tz_time24";
|
|
||||||
|
|
||||||
void initTimeZone() {
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
auto code= getTimeZoneCode();
|
|
||||||
if (!code.empty()) {
|
|
||||||
setenv("TZ", code.c_str(), 1);
|
|
||||||
tzset();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void setTimeZone(const std::string& name, const std::string& code) {
|
|
||||||
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
|
||||||
preferences.putString(TIMEZONE_PREFERENCES_KEY_NAME, name);
|
|
||||||
preferences.putString(TIMEZONE_PREFERENCES_KEY_CODE, code);
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
setenv("TZ", code.c_str(), 1);
|
|
||||||
tzset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
kernel::publishSystemEvent(kernel::SystemEvent::Time);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getTimeZoneName() {
|
|
||||||
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
|
||||||
std::string result;
|
|
||||||
if (preferences.optString(TIMEZONE_PREFERENCES_KEY_NAME, result)) {
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getTimeZoneCode() {
|
|
||||||
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
|
||||||
std::string result;
|
|
||||||
if (preferences.optString(TIMEZONE_PREFERENCES_KEY_CODE, result)) {
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isTimeFormat24Hour() {
|
|
||||||
SettingsProperties properties;
|
|
||||||
if (!loadSettingsProperties(properties)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return properties.timeFormat24h;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void setTimeFormat24Hour(bool show24Hour) {
|
|
||||||
SettingsProperties properties;
|
|
||||||
if (!loadSettingsProperties(properties)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
properties.timeFormat24h = show24Hour;
|
|
||||||
saveSettingsProperties(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
104
Tactility/Source/time/Time.cpp
Normal file
104
Tactility/Source/time/Time.cpp
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
#include "Tactility/time/Time.h"
|
||||||
|
#include "Tactility/kernel/SystemEvents.h"
|
||||||
|
|
||||||
|
#ifdef ESP_PLATFORM
|
||||||
|
#include <ctime>
|
||||||
|
#include "Tactility/Preferences.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace tt::time {
|
||||||
|
|
||||||
|
#ifdef ESP_PLATFORM
|
||||||
|
|
||||||
|
#define TIME_SETTINGS_NAMESPACE "time"
|
||||||
|
|
||||||
|
#define TIMEZONE_PREFERENCES_KEY_NAME "tz_name"
|
||||||
|
#define TIMEZONE_PREFERENCES_KEY_CODE "tz_code"
|
||||||
|
#define TIMEZONE_PREFERENCES_KEY_TIME24 "tz_time24"
|
||||||
|
|
||||||
|
void init() {
|
||||||
|
auto code= getTimeZoneCode();
|
||||||
|
if (!code.empty()) {
|
||||||
|
setenv("TZ", code.c_str(), 1);
|
||||||
|
tzset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTimeZone(const std::string& name, const std::string& code) {
|
||||||
|
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
||||||
|
preferences.putString(TIMEZONE_PREFERENCES_KEY_NAME, name);
|
||||||
|
preferences.putString(TIMEZONE_PREFERENCES_KEY_CODE, code);
|
||||||
|
|
||||||
|
setenv("TZ", code.c_str(), 1);
|
||||||
|
tzset();
|
||||||
|
|
||||||
|
kernel::publishSystemEvent(kernel::SystemEvent::Time);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getTimeZoneName() {
|
||||||
|
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
||||||
|
std::string result;
|
||||||
|
if (preferences.optString(TIMEZONE_PREFERENCES_KEY_NAME, result)) {
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getTimeZoneCode() {
|
||||||
|
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
||||||
|
std::string result;
|
||||||
|
if (preferences.optString(TIMEZONE_PREFERENCES_KEY_CODE, result)) {
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isTimeFormat24Hour() {
|
||||||
|
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
||||||
|
bool show24Hour = true;
|
||||||
|
preferences.optBool(TIMEZONE_PREFERENCES_KEY_TIME24, show24Hour);
|
||||||
|
return show24Hour;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTimeFormat24Hour(bool show24Hour) {
|
||||||
|
Preferences preferences(TIME_SETTINGS_NAMESPACE);
|
||||||
|
preferences.putBool(TIMEZONE_PREFERENCES_KEY_TIME24, show24Hour);
|
||||||
|
kernel::publishSystemEvent(kernel::SystemEvent::Time);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static std::string timeZoneName;
|
||||||
|
static std::string timeZoneCode;
|
||||||
|
static bool show24Hour = true;
|
||||||
|
|
||||||
|
void init() {}
|
||||||
|
|
||||||
|
void setTimeZone(const std::string& name, const std::string& code) {
|
||||||
|
timeZoneName = name;
|
||||||
|
timeZoneCode = code;
|
||||||
|
kernel::publishSystemEvent(kernel::SystemEvent::Time);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getTimeZoneName() {
|
||||||
|
return timeZoneName;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getTimeZoneCode() {
|
||||||
|
return timeZoneCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isTimeFormat24Hour() {
|
||||||
|
return show24Hour;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTimeFormat24Hour(bool enabled) {
|
||||||
|
show24Hour = enabled;
|
||||||
|
kernel::publishSystemEvent(kernel::SystemEvent::Time);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#include "tt_time.h"
|
#include "tt_time.h"
|
||||||
|
|
||||||
#include <Tactility/settings/Time.h>
|
#include <Tactility/time/Time.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
using namespace tt;
|
using namespace tt;
|
||||||
@ -8,11 +8,11 @@ using namespace tt;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
void tt_timezone_set(const char* name, const char* code) {
|
void tt_timezone_set(const char* name, const char* code) {
|
||||||
settings::setTimeZone(name, code);
|
time::setTimeZone(name, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tt_timezone_get_name(char* buffer, size_t bufferSize) {
|
bool tt_timezone_get_name(char* buffer, size_t bufferSize) {
|
||||||
auto name = settings::getTimeZoneName();
|
auto name = time::getTimeZoneName();
|
||||||
if (bufferSize < (name.length() + 1)) {
|
if (bufferSize < (name.length() + 1)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -22,7 +22,7 @@ bool tt_timezone_get_name(char* buffer, size_t bufferSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool tt_timezone_get_code(char* buffer, size_t bufferSize) {
|
bool tt_timezone_get_code(char* buffer, size_t bufferSize) {
|
||||||
auto code = settings::getTimeZoneCode();
|
auto code = time::getTimeZoneCode();
|
||||||
if (bufferSize < (code.length() + 1)) {
|
if (bufferSize < (code.length() + 1)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -32,11 +32,11 @@ bool tt_timezone_get_code(char* buffer, size_t bufferSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool tt_timezone_is_format_24_hour() {
|
bool tt_timezone_is_format_24_hour() {
|
||||||
return settings::isTimeFormat24Hour();
|
return time::isTimeFormat24Hour();
|
||||||
}
|
}
|
||||||
|
|
||||||
void tt_timezone_set_format_24_hour(bool show24Hour) {
|
void tt_timezone_set_format_24_hour(bool show24Hour) {
|
||||||
return settings::setTimeFormat24Hour(show24Hour);
|
return time::setTimeFormat24Hour(show24Hour);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,6 +110,4 @@ int scandir(
|
|||||||
ScandirSort _Nullable sort
|
ScandirSort _Nullable sort
|
||||||
);
|
);
|
||||||
|
|
||||||
bool readLines(const std::string& filePath, bool stripNewLine, std::function<void(const char* line)> callback);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,28 +222,4 @@ bool isDirectory(const std::string& path) {
|
|||||||
return stat(path.c_str(), &stat_result) == 0 && S_ISDIR(stat_result.st_mode);
|
return stat(path.c_str(), &stat_result) == 0 && S_ISDIR(stat_result.st_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool readLines(const std::string& filepath, bool stripNewLine, std::function<void(const char* line)> callback) {
|
|
||||||
auto* file = fopen(filepath.c_str(), "r");
|
|
||||||
if (file == nullptr) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
char line[1024];
|
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), file) != nullptr) {
|
|
||||||
// Strip newline
|
|
||||||
if (stripNewLine) {
|
|
||||||
size_t line_length = strlen(line);
|
|
||||||
if (line_length > 0 && line[line_length - 1] == '\n') {
|
|
||||||
line[line_length - 1] = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Publish
|
|
||||||
callback(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(file);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
Translations/.gitignore
vendored
2
Translations/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*.csv
|
|
||||||
*.ods#
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
# Translations
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- Install [LibreOffice Calc](https://libreoffice.org/)
|
|
||||||
- Ensure you have Python 3 installed (Python 2 is not supported)
|
|
||||||
|
|
||||||
## Steps
|
|
||||||
|
|
||||||
To add new translations or edit existing ones, please follow these steps:
|
|
||||||
|
|
||||||
1. Edit `Translations.ods` (see chapter below)
|
|
||||||
2. In LibreOffice Calc, select the relevant tab that you want to export
|
|
||||||
3. Click on `File` -> `Save a copy...` and save the file as `[tabname].csv` (without the "[]")
|
|
||||||
4. Repeat step 2 and 3 for all tabs that you updated
|
|
||||||
5. Run `python generate-all.py`
|
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
- Do not commit the CSV files
|
|
||||||
- When editing the ODS file, make sure you don't paste in formatted data (use CTRL+Shift+V instead of CTRL+V)
|
|
||||||
- ODS export settings:
|
|
||||||
- Field delimiter: `,`
|
|
||||||
- String delimiter: `"`
|
|
||||||
- Encoding: `UTF-8`
|
|
||||||
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
def get_project_root():
|
|
||||||
return Path(__file__).parent.parent.resolve()
|
|
||||||
|
|
||||||
def generate(csv_file, header_file, header_namespace, data_path):
|
|
||||||
csv_file_path = f"{get_project_root()}/Translations/{csv_file}"
|
|
||||||
if os.path.isfile(csv_file_path):
|
|
||||||
print(f"Processing {csv_file}")
|
|
||||||
script_path = f"{get_project_root()}/Translations/generate.py"
|
|
||||||
os.system(f"python {script_path} {csv_file} {header_file} {header_namespace} {data_path}")
|
|
||||||
else:
|
|
||||||
print(f"Skipping {csv_file} (not found)")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
# Core translations
|
|
||||||
generate(
|
|
||||||
"Core.csv",
|
|
||||||
"Tactility/Include/Tactility/i18n/CoreTextResources.h",
|
|
||||||
"tt::i18n::core",
|
|
||||||
"Data/system/i18n/core"
|
|
||||||
)
|
|
||||||
# Launcher app
|
|
||||||
generate(
|
|
||||||
"Launcher.csv",
|
|
||||||
"Tactility/Private/Tactility/app/launcher/TextResources.h",
|
|
||||||
"tt::app::launcher::i18n",
|
|
||||||
"Data/system/app/Launcher/i18n"
|
|
||||||
)
|
|
||||||
# LocaleSettings app
|
|
||||||
generate(
|
|
||||||
"LocaleSettings.csv",
|
|
||||||
"Tactility/Private/Tactility/app/localesettings/TextResources.h",
|
|
||||||
"tt::app::localesettings::i18n",
|
|
||||||
"Data/system/app/LocaleSettings/i18n"
|
|
||||||
)
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
import csv
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
from typing import List
|
|
||||||
|
|
||||||
def get_project_root():
|
|
||||||
return Path(__file__).parent.parent.resolve()
|
|
||||||
|
|
||||||
def load_csv(path: str, delimiter: str = ",", quotechar: str = '"', encoding: str = "utf-8", skip_header: bool = False) -> List[List[str]]:
|
|
||||||
"""
|
|
||||||
Load a CSV file into a list of rows, where each row is a list of strings.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
path: Path to the CSV file.
|
|
||||||
delimiter: Field delimiter character.
|
|
||||||
quotechar: Quote character.
|
|
||||||
encoding: File encoding.
|
|
||||||
skip_header: If True, skip the first row (header).
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
List of rows (list of lists of strings).
|
|
||||||
"""
|
|
||||||
rows: List[List[str]] = []
|
|
||||||
with open(path, "r", encoding=encoding, newline="") as f:
|
|
||||||
reader = csv.reader(f, delimiter=delimiter, quotechar=quotechar)
|
|
||||||
if skip_header:
|
|
||||||
next(reader, None)
|
|
||||||
for row in reader:
|
|
||||||
rows.append(row)
|
|
||||||
return rows
|
|
||||||
|
|
||||||
def print_help():
|
|
||||||
print("Usage: python generate.py [csv_file] [header_file_path] [header_namespace] [i18n_directory]\n\n")
|
|
||||||
print("\t[csv_file] the CSV file containing the translations, exported from the .ods file")
|
|
||||||
print("\t[header_file_path] the path to the header file to be generated")
|
|
||||||
print("\t[header_namespace] the C++ namespace to use for the generated header file")
|
|
||||||
print("\t[i18n_directory] the directory where the .i18n files will be generated")
|
|
||||||
|
|
||||||
def open_i18n_files(row, i18n_path):
|
|
||||||
result = []
|
|
||||||
for i in range(1, len(row)):
|
|
||||||
filepath = f"{i18n_path}/{row[i]}.i18n"
|
|
||||||
print(f"Opening {filepath}")
|
|
||||||
file = open(filepath, "w")
|
|
||||||
result.append(file)
|
|
||||||
return result
|
|
||||||
|
|
||||||
def close_i18n_files(files):
|
|
||||||
for file in files:
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
def generate_header(filepath, namespace, rows):
|
|
||||||
file = open(filepath, "w")
|
|
||||||
file.write("#pragma once\n\n")
|
|
||||||
file.write("#include \"Tactility/i18n/TextResources.h\"\n\n")
|
|
||||||
file.write("// WARNING: This file is auto-generated. Do not edit manually.\n\n")
|
|
||||||
file.write(f"namespace {namespace}")
|
|
||||||
file.write(" {\n\n")
|
|
||||||
file.write("enum class Text {\n")
|
|
||||||
for i in range(1, len(rows)):
|
|
||||||
key = rows[i][0].upper()
|
|
||||||
file.write(f" {key} = {i - 1},\n")
|
|
||||||
file.write("};\n")
|
|
||||||
file.write("\n}\n")
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
def translate(rows, language_index, file):
|
|
||||||
for i in range(1, len(rows)):
|
|
||||||
value = rows[i][language_index]
|
|
||||||
if value == "":
|
|
||||||
value = f"{rows[i][0]}_untranslated"
|
|
||||||
file.write(value)
|
|
||||||
file.write("\n")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if "--help" in sys.argv:
|
|
||||||
print_help()
|
|
||||||
sys.exit()
|
|
||||||
if len(sys.argv) != 5:
|
|
||||||
print_help()
|
|
||||||
sys.exit()
|
|
||||||
project_root_path = get_project_root()
|
|
||||||
csv_file = f"{project_root_path}/Translations/{sys.argv[1]}"
|
|
||||||
header_path = f"{project_root_path}/{sys.argv[2]}"
|
|
||||||
header_namespace = sys.argv[3]
|
|
||||||
i18n_path = f"{project_root_path}/{sys.argv[4]}"
|
|
||||||
rows = load_csv(csv_file)
|
|
||||||
if len(rows) == 0:
|
|
||||||
print("Error: CSV file is empty.")
|
|
||||||
sys.exit(1)
|
|
||||||
generate_header(header_path, header_namespace, rows)
|
|
||||||
i18n_files = open_i18n_files(rows[0], i18n_path)
|
|
||||||
for i in range(0, len(i18n_files)):
|
|
||||||
i18n_file = i18n_files[i]
|
|
||||||
translate(rows, i + 1, i18n_file)
|
|
||||||
close_i18n_files(i18n_files)
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
# Name, Type, SubType, Offset, Size, Flags
|
|
||||||
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
|
|
||||||
nvs, data, nvs, 0x9000, 0x6000,
|
|
||||||
phy_init, data, phy, 0xf000, 0x1000,
|
|
||||||
factory, app, factory, 0x10000, 3M,
|
|
||||||
system, data, fat, , 450k,
|
|
||||||
data, data, fat, , 450k,
|
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
nvs, data, nvs, 0x9000, 0x6000,
|
nvs, data, nvs, 0x9000, 0x6000,
|
||||||
phy_init, data, phy, 0xf000, 0x1000,
|
phy_init, data, phy, 0xf000, 0x1000,
|
||||||
factory, app, factory, 0x10000, 3M,
|
factory, app, factory, 0x10000, 3M,
|
||||||
system, data, fat, , 300k,
|
system, data, fat, , 256k,
|
||||||
data, data, fat, , 600k,
|
data, data, fat, , 256k,
|
||||||
|
|||||||
|
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_CYD_2432S024C=y
|
CONFIG_TT_BOARD_CYD_2432S024C=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_CYD_2432S032C=y
|
CONFIG_TT_BOARD_CYD_2432S032C=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_CYD_JC2432W328C=y
|
CONFIG_TT_BOARD_CYD_JC2432W328C=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
CONFIG_COMPILER_OPTIMIZATION_PERF=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_28=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_28=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_35=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_35=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_50=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_50=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_28=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_28=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_35=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_35=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_50=y
|
CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_50=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_LILYGO_TDECK=y
|
CONFIG_TT_BOARD_LILYGO_TDECK=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_LILYGO_TLORA_PAGER=y
|
CONFIG_TT_BOARD_LILYGO_TLORA_PAGER=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_M5STACK_CORE2=y
|
CONFIG_TT_BOARD_M5STACK_CORE2=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_M5STACK_CORES3=y
|
CONFIG_TT_BOARD_M5STACK_CORES3=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_UNPHONE=y
|
CONFIG_TT_BOARD_UNPHONE=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware: Main
|
# Hardware: Main
|
||||||
CONFIG_TT_BOARD_WAVESHARE_S3_TOUCH_43=y
|
CONFIG_TT_BOARD_WAVESHARE_S3_TOUCH_43=y
|
||||||
|
|||||||
@ -26,11 +26,6 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|||||||
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
|
||||||
CONFIG_FATFS_LFN_HEAP=y
|
CONFIG_FATFS_LFN_HEAP=y
|
||||||
CONFIG_FATFS_VOLUME_COUNT=3
|
CONFIG_FATFS_VOLUME_COUNT=3
|
||||||
CONFIG_FATFS_SECTOR_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE_512=y
|
|
||||||
CONFIG_WL_SECTOR_SIZE=512
|
|
||||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
|
||||||
CONFIG_WL_SECTOR_MODE=1
|
|
||||||
|
|
||||||
# Hardware defaults
|
# Hardware defaults
|
||||||
CONFIG_TT_BOARD_CUSTOM=y
|
CONFIG_TT_BOARD_CUSTOM=y
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user