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,5 +1,6 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/gps-generic-module
|
||||
- Drivers/st7796-module
|
||||
- Drivers/bq27220-module
|
||||
- Drivers/tca8418-module
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <gps_generic/bindings.h>
|
||||
#include <bindings/st7796.h>
|
||||
#include <bindings/bq27220.h>
|
||||
#include <bindings/tca8418.h>
|
||||
@@ -181,6 +182,13 @@
|
||||
port = <UART_NUM_0>;
|
||||
pin-tx = <&gpio0 12 GPIO_FLAG_NONE>;
|
||||
pin-rx = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
|
||||
gps {
|
||||
compatible = "tactility,gps-generic";
|
||||
status = "disabled";
|
||||
baud-rate = <38400>;
|
||||
model = <GPS_MODEL_UBLOX10>;
|
||||
};
|
||||
};
|
||||
|
||||
uart_external: uart1 {
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/driver.h>
|
||||
#include <tactility/lvgl_module.h>
|
||||
#include <tactility/module.h>
|
||||
|
||||
#include <Tactility/LogMessages.h>
|
||||
#include <Tactility/SystemEvents.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/hal/gps/GpsConfiguration.h>
|
||||
#include <Tactility/kernel/Kernel.h>
|
||||
#include <Tactility/service/gps/GpsService.h>
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/lvgl_module.h>
|
||||
|
||||
#include <lilygo/drivers/tpager_encoder_input.h>
|
||||
|
||||
@@ -17,41 +10,22 @@ constexpr auto* TAG = "T-Lora Pager";
|
||||
|
||||
extern "C" {
|
||||
|
||||
tt::kernel::SystemEventSubscription event_subscription;
|
||||
tt::kernel::SystemEventSubscription event_subscription = tt::kernel::NoSystemEventSubscription;
|
||||
|
||||
static error_t start() {
|
||||
|
||||
LOG_I(TAG, LOG_MESSAGE_POWER_ON_START);
|
||||
|
||||
event_subscription = tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootSplash, [](tt::kernel::SystemEvent) {
|
||||
// The kernel tpager_encoder device is already started by kernel_init(); this just
|
||||
// registers it as an LVGL input device, which requires LVGL to be up first.
|
||||
lvgl_lock();
|
||||
tpager_encoder::init();
|
||||
lvgl_unlock();
|
||||
|
||||
auto gps_service = tt::service::gps::findGpsService();
|
||||
if (gps_service != nullptr) {
|
||||
std::vector<tt::hal::gps::GpsConfiguration> gps_configurations;
|
||||
gps_service->getGpsConfigurations(gps_configurations);
|
||||
if (gps_configurations.empty()) {
|
||||
if (gps_service->addGpsConfiguration(tt::hal::gps::GpsConfiguration {
|
||||
.uartName = "uart0",
|
||||
.baudRate = 38400,
|
||||
.model = tt::hal::gps::GpsModel::UBLOX10
|
||||
})) {
|
||||
LOG_I(TAG, "Configured internal GPS");
|
||||
} else {
|
||||
LOG_E(TAG, "Failed to configure internal GPS");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
tt::kernel::unsubscribeSystemEvent(event_subscription);
|
||||
event_subscription = tt::kernel::NoSystemEventSubscription;
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user