New logging and more (#446)
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>` - Changed default timezone to Europe/Amsterdam - Fix for logic bug in unPhone hardware - Fix for init/deinit in DRV2605 driver - Other fixes - Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
This commit is contained in:
committed by
GitHub
parent
719f7bcece
commit
f620255c41
@@ -9,15 +9,16 @@
|
||||
#include <Tactility/app/App.h>
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
#include <Tactility/kernel/Platform.h>
|
||||
#include <Tactility/Logger.h>
|
||||
#include <Tactility/lvgl/Lvgl.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
#include <Tactility/service/screenshot/Screenshot.h>
|
||||
|
||||
constexpr auto* TAG = "Screenshot";
|
||||
|
||||
namespace tt::app::screenshot {
|
||||
|
||||
static const auto LOGGER = Logger("Screenshot");
|
||||
|
||||
extern const AppManifest manifest;
|
||||
|
||||
class ScreenshotApp final : public App {
|
||||
@@ -97,27 +98,27 @@ void ScreenshotApp::onModeSet() {
|
||||
void ScreenshotApp::onStartPressed() {
|
||||
auto service = service::screenshot::optScreenshotService();
|
||||
if (service == nullptr) {
|
||||
TT_LOG_E(TAG, "Service not found/running");
|
||||
LOGGER.error("Service not found/running");
|
||||
return;
|
||||
}
|
||||
|
||||
if (service->isTaskStarted()) {
|
||||
TT_LOG_I(TAG, "Stop screenshot");
|
||||
LOGGER.info("Stop screenshot");
|
||||
service->stop();
|
||||
} else {
|
||||
uint32_t selected = lv_dropdown_get_selected(modeDropdown);
|
||||
const char* path = lv_textarea_get_text(pathTextArea);
|
||||
if (selected == 0) {
|
||||
TT_LOG_I(TAG, "Start timed screenshots");
|
||||
LOGGER.info("Start timed screenshots");
|
||||
const char* delay_text = lv_textarea_get_text(delayTextArea);
|
||||
int delay = atoi(delay_text);
|
||||
if (delay > 0) {
|
||||
service->startTimed(path, delay, 1);
|
||||
} else {
|
||||
TT_LOG_W(TAG, "Ignored screenshot start because delay was 0");
|
||||
LOGGER.warn("Ignored screenshot start because delay was 0");
|
||||
}
|
||||
} else {
|
||||
TT_LOG_I(TAG, "Start app screenshots");
|
||||
LOGGER.info("Start app screenshots");
|
||||
service->startApps(path);
|
||||
}
|
||||
}
|
||||
@@ -128,7 +129,7 @@ void ScreenshotApp::onStartPressed() {
|
||||
void ScreenshotApp::updateScreenshotMode() {
|
||||
auto service = service::screenshot::optScreenshotService();
|
||||
if (service == nullptr) {
|
||||
TT_LOG_E(TAG, "Service not found/running");
|
||||
LOGGER.error("Service not found/running");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,7 +152,7 @@ void ScreenshotApp::updateScreenshotMode() {
|
||||
void ScreenshotApp::createModeSettingWidgets(lv_obj_t* parent) {
|
||||
auto service = service::screenshot::optScreenshotService();
|
||||
if (service == nullptr) {
|
||||
TT_LOG_E(TAG, "Service not found/running");
|
||||
LOGGER.error("Service not found/running");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,7 +204,7 @@ void ScreenshotApp::createFilePathWidgets(lv_obj_t* parent) {
|
||||
if (kernel::getPlatform() == kernel::PlatformEsp) {
|
||||
auto sdcard_devices = tt::hal::findDevices<tt::hal::sdcard::SdCardDevice>(tt::hal::Device::Type::SdCard);
|
||||
if (sdcard_devices.size() > 1) {
|
||||
TT_LOG_W(TAG, "Found multiple SD card devices - picking first");
|
||||
LOGGER.warn("Found multiple SD card devices - picking first");
|
||||
}
|
||||
if (!sdcard_devices.empty() && sdcard_devices.front()->isMounted()) {
|
||||
std::string lvgl_mount_path = lvgl::PATH_PREFIX + sdcard_devices.front()->getMountPath();
|
||||
|
||||
Reference in New Issue
Block a user