Merge develop into main (#316)
- Updated all boards to use `hal::Configuration.createDevices` - Updated all boards to use new directory structure and file naming convention - Refactored `Xpt2046SoftSpi` driver. - Created `Axp2101Power` device in `Drivers/AXP2101` - Removed global static instances from some drivers (instances that kept a reference to the Device*) - Improved `SystemInfoApp` UI: better memory labels, hide external memory bar when there's no PSRAM - Fix for HAL: register touch devices after displays are registered - Fix for Boot splash hanging on WiFi init: unlock file lock after using it
This commit is contained in:
committed by
GitHub
parent
1deaf4c426
commit
1627b9fa85
@@ -142,8 +142,10 @@ class SystemInfoApp : public App {
|
||||
lv_obj_set_flex_flow(memory_wrapper, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_size(memory_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
|
||||
|
||||
addMemoryBar(memory_wrapper, "Heap", getHeapTotal() - getHeapFree(), getHeapTotal());
|
||||
addMemoryBar(memory_wrapper, "SPI", getSpiTotal() - getSpiFree(), getSpiTotal());
|
||||
addMemoryBar(memory_wrapper, "Internal", getHeapTotal() - getHeapFree(), getHeapTotal());
|
||||
if (getSpiTotal() > 0) {
|
||||
addMemoryBar(memory_wrapper, "External", getSpiTotal() - getSpiFree(), getSpiTotal());
|
||||
}
|
||||
|
||||
#if configUSE_TRACE_FACILITY
|
||||
auto* tasks_label = lv_label_create(wrapper);
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Tactility/hal/spi/SpiInit.h"
|
||||
#include "Tactility/hal/uart/UartInit.h"
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <Tactility/hal/touch/TouchDevice.h>
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
|
||||
namespace tt::hal {
|
||||
@@ -35,6 +37,16 @@ void registerDevices(const Configuration& configuration) {
|
||||
auto devices = configuration.createDevices();
|
||||
for (auto& device : devices) {
|
||||
registerDevice(device);
|
||||
|
||||
// Register attached devices
|
||||
if (device->getType() == Device::Type::Display) {
|
||||
const auto display = std::static_pointer_cast<display::DisplayDevice>(device);
|
||||
assert(display != nullptr);
|
||||
const std::shared_ptr<Device> touch = display->getTouchDevice();
|
||||
if (touch != nullptr) {
|
||||
registerDevice(touch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ struct ApProperties {
|
||||
static void importWifiAp(const std::string& filePath) {
|
||||
std::map<std::string, std::string> map;
|
||||
if (!file::loadPropertiesFile(filePath, map)) {
|
||||
TT_LOG_E(TAG, "Failed to load AP properties at %s", filePath.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ static void importWifiAp(const std::string& filePath) {
|
||||
const auto ssid = ssid_iterator->second;
|
||||
|
||||
if (!settings::contains(ssid)) {
|
||||
|
||||
const auto password_iterator = map.find(AP_PROPERTIES_KEY_PASSWORD);
|
||||
const auto password = password_iterator == map.end() ? "" : password_iterator->second;
|
||||
|
||||
@@ -78,10 +80,10 @@ static void importWifiAp(const std::string& filePath) {
|
||||
}
|
||||
|
||||
static void importWifiApSettings(std::shared_ptr<hal::sdcard::SdCardDevice> sdcard) {
|
||||
auto lock = sdcard->getLock()->asScopedLock();
|
||||
lock.lock();
|
||||
auto path = file::getChildPath(sdcard->getMountPath(), "settings");
|
||||
|
||||
auto lock = sdcard->getLock()->asScopedLock();
|
||||
lock.lock();
|
||||
std::vector<dirent> dirent_list;
|
||||
if (file::scandir(path, dirent_list, [](const dirent* entry) {
|
||||
switch (entry->d_type) {
|
||||
@@ -102,6 +104,7 @@ static void importWifiApSettings(std::shared_ptr<hal::sdcard::SdCardDevice> sdca
|
||||
}, nullptr) == 0) {
|
||||
return;
|
||||
}
|
||||
lock.unlock();
|
||||
|
||||
if (dirent_list.empty()) {
|
||||
TT_LOG_W(TAG, "No AP files found at %s", sdcard->getMountPath().c_str());
|
||||
|
||||
Reference in New Issue
Block a user