Added screenshot mode config and updated copyright docs (#126)
@ -1,3 +1,4 @@
|
|||||||
|
#include "Tactility.h"
|
||||||
#include "hal/Configuration.h"
|
#include "hal/Configuration.h"
|
||||||
#include "hal/SimulatorPower.h"
|
#include "hal/SimulatorPower.h"
|
||||||
#include "LvglTask.h"
|
#include "LvglTask.h"
|
||||||
@ -7,6 +8,8 @@
|
|||||||
|
|
||||||
#define TAG "hardware"
|
#define TAG "hardware"
|
||||||
|
|
||||||
|
extern const tt::hal::sdcard::SdCard simulatorSdcard;
|
||||||
|
|
||||||
static bool initBoot() {
|
static bool initBoot() {
|
||||||
lv_init();
|
lv_init();
|
||||||
lvgl_task_start();
|
lvgl_task_start();
|
||||||
@ -28,7 +31,7 @@ extern const tt::hal::Configuration hardware = {
|
|||||||
.initBoot = initBoot,
|
.initBoot = initBoot,
|
||||||
.createDisplay = createDisplay,
|
.createDisplay = createDisplay,
|
||||||
.createKeyboard = createKeyboard,
|
.createKeyboard = createKeyboard,
|
||||||
.sdcard = nullptr,
|
.sdcard = &simulatorSdcard,
|
||||||
.power = simulatorPower,
|
.power = simulatorPower,
|
||||||
.i2c = {
|
.i2c = {
|
||||||
tt::hal::i2c::Configuration {
|
tt::hal::i2c::Configuration {
|
||||||
|
|||||||
26
Boards/Simulator/Source/hal/SimulatorSdcard.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "Tactility.h"
|
||||||
|
#include "hal/sdcard/Sdcard.h"
|
||||||
|
|
||||||
|
static uint32_t fake_handle = 0;
|
||||||
|
|
||||||
|
static void* _Nullable sdcard_mount(TT_UNUSED const char* mount_point) {
|
||||||
|
return &fake_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void* sdcard_init_and_mount(TT_UNUSED const char* mount_point) {
|
||||||
|
return &fake_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sdcard_unmount(TT_UNUSED void* context) {
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool sdcard_is_mounted(TT_UNUSED void* context) {
|
||||||
|
return TT_SCREENSHOT_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern const tt::hal::sdcard::SdCard simulatorSdcard = {
|
||||||
|
.mount = &sdcard_init_and_mount,
|
||||||
|
.unmount = &sdcard_unmount,
|
||||||
|
.is_mounted = &sdcard_is_mounted,
|
||||||
|
.mount_behaviour = tt::hal::sdcard::MountBehaviourAtBoot
|
||||||
|
};
|
||||||
@ -1,10 +1,12 @@
|
|||||||
## Tactility
|
# Tactility
|
||||||
|
|
||||||
The Tactility logo copyrights are owned by Ken Van Hoeylandt.
|
The Tactility logo copyrights are owned by Ken Van Hoeylandt.
|
||||||
Firmwares built from [the original repository](https://github.com/ByteWelder/Tactility) can be redistributed with the Tactility logo.
|
Firmwares built from [the original repository](https://github.com/ByteWelder/Tactility) can be redistributed with the Tactility logo.
|
||||||
For other usages, [contact me](https://kenvanhoeylandt.net).
|
For other usages, [contact me](https://kenvanhoeylandt.net).
|
||||||
|
|
||||||
The Tactility firmware and code are published under [GPL License Version 3](./LICENSE.md).
|
The Tactility project is published under [GPL License Version 3](./LICENSE.md).
|
||||||
|
|
||||||
|
The TactilitySDK project is published under an [MIT License](./LICENSE.md).
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
Documentation/pics/screenshot-HelloWorld.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@ -3,4 +3,5 @@
|
|||||||
#include "TactilityHeadlessConfig.h"
|
#include "TactilityHeadlessConfig.h"
|
||||||
|
|
||||||
#define TT_CONFIG_APPS_LIMIT 32
|
#define TT_CONFIG_APPS_LIMIT 32
|
||||||
#define TT_CONFIG_FORCE_ONSCREEN_KEYBOARD false
|
#define TT_CONFIG_FORCE_ONSCREEN_KEYBOARD false // for development/debug purposes
|
||||||
|
#define TT_SCREENSHOT_MODE false // for taking screenshots (e.g. forces SD card presence and Files tree on simulator)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "FilesData.h"
|
#include "FilesData.h"
|
||||||
#include "FileUtils.h"
|
#include "FileUtils.h"
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "TactilityCore.h"
|
#include "Tactility.h"
|
||||||
|
|
||||||
namespace tt::app::files {
|
namespace tt::app::files {
|
||||||
|
|
||||||
@ -42,19 +42,24 @@ bool data_set_entries_for_path(std::shared_ptr<Data> data, const char* path) {
|
|||||||
* ESP32 does not have a root directory, so we have to create it manually.
|
* ESP32 does not have a root directory, so we have to create it manually.
|
||||||
* We'll add the NVS Flash partitions and the binding for the sdcard.
|
* We'll add the NVS Flash partitions and the binding for the sdcard.
|
||||||
*/
|
*/
|
||||||
if (kernel::getPlatform() == kernel::PlatformEsp && strcmp(path, "/") == 0) {
|
#if TT_SCREENSHOT_MODE
|
||||||
|
bool show_custom_root = true;
|
||||||
|
#else
|
||||||
|
bool show_custom_root = (kernel::getPlatform() == kernel::PlatformEsp && strcmp(path, "/") == 0);
|
||||||
|
#endif
|
||||||
|
if (show_custom_root) {
|
||||||
int dir_entries_count = 3;
|
int dir_entries_count = 3;
|
||||||
auto** dir_entries = static_cast<dirent**>(malloc(sizeof(struct dirent*) * 3));
|
auto** dir_entries = (dirent**)malloc(sizeof(struct dirent*) * 3);
|
||||||
|
|
||||||
dir_entries[0] = static_cast<dirent*>(malloc(sizeof(struct dirent)));
|
dir_entries[0] = (dirent*)malloc(sizeof(struct dirent));
|
||||||
dir_entries[0]->d_type = TT_DT_DIR;
|
dir_entries[0]->d_type = TT_DT_DIR;
|
||||||
strcpy(dir_entries[0]->d_name, "assets");
|
strcpy(dir_entries[0]->d_name, "assets");
|
||||||
|
|
||||||
dir_entries[1] = static_cast<dirent*>(malloc(sizeof(struct dirent)));
|
dir_entries[1] = (dirent*)malloc(sizeof(struct dirent));
|
||||||
dir_entries[1]->d_type = TT_DT_DIR;
|
dir_entries[1]->d_type = TT_DT_DIR;
|
||||||
strcpy(dir_entries[1]->d_name, "config");
|
strcpy(dir_entries[1]->d_name, "config");
|
||||||
|
|
||||||
dir_entries[2] = static_cast<dirent*>(malloc(sizeof(struct dirent)));
|
dir_entries[2] = (dirent*)malloc(sizeof(struct dirent));
|
||||||
dir_entries[2]->d_type = TT_DT_DIR;
|
dir_entries[2]->d_type = TT_DT_DIR;
|
||||||
strcpy(dir_entries[2]->d_name, "sdcard");
|
strcpy(dir_entries[2]->d_name, "sdcard");
|
||||||
|
|
||||||
|
|||||||