Added screenshot mode config and updated copyright docs (#126)
This commit is contained in:
committed by
GitHub
parent
07f45b8fb0
commit
100c24f6a3
@@ -3,4 +3,5 @@
|
||||
#include "TactilityHeadlessConfig.h"
|
||||
|
||||
#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 "FileUtils.h"
|
||||
#include "StringUtils.h"
|
||||
#include "TactilityCore.h"
|
||||
#include "Tactility.h"
|
||||
|
||||
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.
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
strcpy(dir_entries[2]->d_name, "sdcard");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user