Merge develop into main (#337)
- Implement `UiScale` in `hal::Configuration`: small screens with no touch can now opt for a more optimized experience (e.g. Cardputer, Waveshare 1.47, Waveshare 1.3", etc.) - Fix for Cardputer UART configuration and added I2C configuration - Fix for software keyboard bug in Gui - Removed deprecated fields from `hal::Configuration` - Updated the simulator devices to use the new HAL config - add `bool tt::hal::hasDevice(Device::Type)` - Cleanup of `AppList` app code - Improve `Gpio` app for small screen devices - Added various ESP32 GCC wrappers to wrap LVGL functions (with manipulations for small screen devices) - Moved `Launcher` assets to `assets/` subfolder - Optimized `Toolbar` for small screen devices - Stop showing `system/` partition in `FileBrowser` because it's read-only and not very useful. Created `config::SHOW_SYSTEM_PARTITION` to override this behaviour. - Hide apps when their required hardware isn't available (I2C, UART, PowerDevice) - Fix for `CYD-2432S032C` DPI setting
This commit is contained in:
committed by
GitHub
parent
ce8ac61d42
commit
53b711584f
@@ -33,7 +33,17 @@ void run(const Configuration& config);
|
||||
*/
|
||||
const Configuration* _Nullable getConfiguration();
|
||||
|
||||
|
||||
/** Provides access to the dispatcher that runs on the main task.
|
||||
* @warning This dispatcher is used for WiFi and might block for some time during WiFi connection.
|
||||
* @return the dispatcher
|
||||
*/
|
||||
Dispatcher& getMainDispatcher();
|
||||
|
||||
} // namespace
|
||||
namespace hal {
|
||||
|
||||
/** While technically this configuration is nullable, it's never null after initHeadless() is called. */
|
||||
const Configuration* _Nullable getConfiguration();
|
||||
|
||||
} // namespace hal
|
||||
|
||||
} // namespace tt
|
||||
|
||||
@@ -11,3 +11,9 @@
|
||||
#else // Sim
|
||||
#define TT_FEATURE_SCREENSHOT_ENABLED true
|
||||
#endif
|
||||
|
||||
namespace tt::config {
|
||||
|
||||
constexpr auto SHOW_SYSTEM_PARTITION = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/Configuration.h"
|
||||
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include <Tactility/Dispatcher.h>
|
||||
|
||||
namespace tt {
|
||||
|
||||
/** Initialize the hardware and started the internal services. */
|
||||
void initHeadless(const hal::Configuration& config);
|
||||
|
||||
/** Provides access to the dispatcher that runs on the main task.
|
||||
* @warning This dispatcher is used for WiFi and might block for some time during WiFi connection.
|
||||
* @return the dispatcher
|
||||
*/
|
||||
Dispatcher& getMainDispatcher();
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace tt::hal {
|
||||
|
||||
/** While technically this configuration is nullable, it's never null after initHeadless() is called. */
|
||||
const Configuration* _Nullable getConfiguration();
|
||||
|
||||
} // namespace
|
||||
@@ -9,14 +9,6 @@ namespace tt::hal {
|
||||
|
||||
typedef bool (*InitBoot)();
|
||||
|
||||
namespace display { class DisplayDevice; }
|
||||
namespace keyboard { class KeyboardDevice; }
|
||||
namespace power { class PowerDevice; }
|
||||
|
||||
typedef std::shared_ptr<display::DisplayDevice> (*CreateDisplay)();
|
||||
typedef std::shared_ptr<keyboard::KeyboardDevice> (*CreateKeyboard)();
|
||||
typedef std::shared_ptr<power::PowerDevice> (*CreatePower)();
|
||||
|
||||
typedef std::vector<std::shared_ptr<Device>> DeviceVector;
|
||||
|
||||
typedef std::shared_ptr<Device> (*CreateDevice)();
|
||||
@@ -26,6 +18,14 @@ enum class LvglInit {
|
||||
None
|
||||
};
|
||||
|
||||
/** Affects LVGL widget style */
|
||||
enum class UiScale {
|
||||
/** Ideal for very small non-touch screen devices (e.g. Waveshare S3 LCD 1.3") */
|
||||
Smallest,
|
||||
/** Nothing was changed in the LVGL UI/UX */
|
||||
Default
|
||||
};
|
||||
|
||||
struct Configuration {
|
||||
/**
|
||||
* Called before I2C/SPI/etc is initialized.
|
||||
@@ -36,21 +36,8 @@ struct Configuration {
|
||||
/** Init behaviour: default (esp_lvgl_port for ESP32, nothing for PC) or None (nothing on any platform). Only used in Tactility, not in TactilityHeadless. */
|
||||
const LvglInit lvglInit = LvglInit::Default;
|
||||
|
||||
/** Display HAL functionality. */
|
||||
[[deprecated("use createDevices")]]
|
||||
const CreateDisplay _Nullable createDisplay = nullptr;
|
||||
|
||||
/** Keyboard HAL functionality. */
|
||||
[[deprecated("use createDevices")]]
|
||||
const CreateKeyboard _Nullable createKeyboard = nullptr;
|
||||
|
||||
/** An optional SD card interface. */
|
||||
[[deprecated("use createDevices")]]
|
||||
const std::shared_ptr<sdcard::SdCardDevice> _Nullable sdcard = nullptr;
|
||||
|
||||
/** An optional power interface for battery or other power delivery. */
|
||||
[[deprecated("use createDevices")]]
|
||||
const CreatePower _Nullable power = nullptr;
|
||||
/** Modify LVGL widget size */
|
||||
const UiScale uiScale = UiScale::Default;
|
||||
|
||||
std::function<DeviceVector()> createDevices = [] { return std::vector<std::shared_ptr<Device>>(); };
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <cassert>
|
||||
|
||||
namespace tt::hal {
|
||||
|
||||
/** Base class for HAL-related devices. */
|
||||
class Device {
|
||||
|
||||
@@ -119,4 +118,7 @@ std::shared_ptr<DeviceType> findFirstDevice(Device::Type type) {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return true if there are 1 or more devices of the specified type */
|
||||
bool hasDevice(Device::Type type);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../app/AppContext.h"
|
||||
#include "Tactility/Tactility.h"
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
namespace tt::lvgl {
|
||||
|
||||
#define TOOLBAR_HEIGHT 40
|
||||
#define TOOLBAR_TITLE_FONT_HEIGHT 18
|
||||
#define TOOLBAR_ACTION_LIMIT 4
|
||||
|
||||
/** Create a toolbar widget that shows the app name as title */
|
||||
|
||||
Reference in New Issue
Block a user