Merge develop into main (#303)
- `DisplayDevice` improvements related `DisplayDriver` - Replaced incorrect usage of `spiBusHandle` with `spiHostDevice` in all SPI display devices - Disabled `DisplayDriver` support for RGB displays for now - Updated `GraphicsDemo` project for the above changes - TactilityC improvements: - created `tt_hal_device_find()` - created `tt_hal_display_*` - created `tt_hal_touch_*` - created `tt_lvgl_*` - export `tt_app_*` calls
This commit is contained in:
committed by
GitHub
parent
d875ade8cb
commit
fbaff8cbac
@@ -95,6 +95,8 @@ std::vector<std::shared_ptr<DeviceType>> findDevices(Device::Type type) {
|
||||
}
|
||||
}
|
||||
|
||||
void findDevices(Device::Type type, std::function<bool(const std::shared_ptr<Device>&)> onDeviceFound);
|
||||
|
||||
/** Find the first device of the specified type and cast it to the specified class */
|
||||
template<class DeviceType>
|
||||
std::shared_ptr<DeviceType> findFirstDevice(Device::Type type) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Lock.h>
|
||||
#include <cstdint>
|
||||
|
||||
namespace tt::hal::display {
|
||||
@@ -7,7 +8,9 @@ namespace tt::hal::display {
|
||||
enum class ColorFormat {
|
||||
Monochrome, // 1 bpp
|
||||
BGR565,
|
||||
BGR565Swapped,
|
||||
RGB565,
|
||||
RGB565Swapped,
|
||||
RGB888
|
||||
};
|
||||
|
||||
@@ -21,6 +24,7 @@ public:
|
||||
virtual uint16_t getPixelWidth() const = 0;
|
||||
virtual uint16_t getPixelHeight() const = 0;
|
||||
virtual bool drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) = 0;
|
||||
virtual std::shared_ptr<Lock> getLock() const = 0;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -88,6 +88,15 @@ std::vector<std::shared_ptr<Device>> findDevices(Device::Type type) {
|
||||
});
|
||||
}
|
||||
|
||||
void findDevices(Device::Type type, std::function<bool(const std::shared_ptr<Device>&)> onDeviceFound) {
|
||||
auto devices_view = findDevices(type);
|
||||
for (auto& device : devices_view) {
|
||||
if (!onDeviceFound(device)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Device>> getDevices() {
|
||||
return devices;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ static void update_main(Statusbar* statusbar);
|
||||
|
||||
static TickType_t getNextUpdateTime() {
|
||||
time_t now = ::time(nullptr);
|
||||
struct tm* tm_struct = localtime(&now);
|
||||
tm* tm_struct = localtime(&now);
|
||||
uint32_t seconds_to_wait = 60U - tm_struct->tm_sec;
|
||||
TT_LOG_D(TAG, "Update in %lu s", seconds_to_wait);
|
||||
return pdMS_TO_TICKS(seconds_to_wait * 1000U);
|
||||
@@ -72,7 +72,7 @@ static TickType_t getNextUpdateTime() {
|
||||
|
||||
static void onUpdateTime() {
|
||||
time_t now = ::time(nullptr);
|
||||
struct tm* tm_struct = localtime(&now);
|
||||
tm* tm_struct = localtime(&now);
|
||||
|
||||
if (statusbar_data.mutex.lock(100 / portTICK_PERIOD_MS)) {
|
||||
if (tm_struct->tm_year >= (2025 - 1900)) {
|
||||
|
||||
Reference in New Issue
Block a user