Remove old HAL components and refactored GPS-related code (#583)
- Added generic GPS/GNSS support with device detection, configuration, and persistent settings. - Improved device and module lifecycle management. - Added flexible filesystem locking support for displays and storage. - Improved display-idle and keyboard backlight handling. - Updated architecture, driver, module, testing, and licensing documentation. - Removed old HAL device and related code.
This commit is contained in:
committed by
GitHub
parent
29e80cfd65
commit
2a2558b29a
@@ -1,43 +1,9 @@
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/sdcard.h>
|
||||
#include <tactility/filesystem/file_system.h>
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace tt::hal::sdcard {
|
||||
|
||||
std::shared_ptr<Lock> findSdCardLock(const std::string& path) {
|
||||
struct Ctx {
|
||||
const std::string& path;
|
||||
std::shared_ptr<Lock> result;
|
||||
};
|
||||
Ctx ctx = { path, nullptr };
|
||||
|
||||
file_system_for_each(&ctx, [](FileSystem* fs, void* context) {
|
||||
auto* c = static_cast<Ctx*>(context);
|
||||
char mount_path[64];
|
||||
if (file_system_get_path(fs, mount_path, sizeof(mount_path)) != ERROR_NONE) return true;
|
||||
if (!c->path.starts_with(mount_path)) return true;
|
||||
|
||||
auto* owner = file_system_get_owner(fs);
|
||||
if (owner != nullptr) {
|
||||
// Check for I2C controller: if it has more than 2 children, assume it's the display
|
||||
// TODO: Improve this
|
||||
auto* parent = device_get_parent(owner);
|
||||
if (parent != nullptr && device_get_child_count(parent) >= 2) {
|
||||
c->result = lvgl::getSyncLock();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
return ctx.result;
|
||||
}
|
||||
|
||||
void mountAll() {
|
||||
void startAll() {
|
||||
device_for_each_of_type(&SDCARD_TYPE, nullptr, [](::Device* device, void*) -> bool {
|
||||
if (!device_is_ready(device)) {
|
||||
if (device_start(device) != ERROR_NONE) {
|
||||
|
||||
Reference in New Issue
Block a user