Refactored events (#621)
Event handling: - Added unified event handling for application, system, and Wi‑Fi events. - Updated all apps to reflect event handling changes Wi-Fi: - Refactored event handling from listener interface to task & event group. - Added direct Wi‑Fi radio controls and improved event subscriptions. - Wi‑Fi screens now refresh asynchronously and handle unavailable devices more gracefully. - Enabled Wi‑Fi by default on in dts files, but radio on/off is still done by code. The main reason was reliable event subscription and consistent devicetree states. - Improved Wi‑Fi shutdown cleanup and radio-state handling. Other: - Renamed the Kernel Display app to Display.
This commit is contained in:
committed by
GitHub
parent
db48dfe812
commit
ab75d2022d
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <Tactility/service/espnow/EspNowHostedTransport.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/wifi.h>
|
||||
|
||||
namespace tt::service::espnow::backend {
|
||||
@@ -16,16 +17,19 @@ namespace tt::service::espnow::backend {
|
||||
// truth shared with any other caller (e.g. an external OTA app), instead of being duplicated
|
||||
// here.
|
||||
bool waitForHostedTransport(uint32_t timeoutMs) {
|
||||
Device* device = wifi_find_first_registered_device();
|
||||
if (device == nullptr) {
|
||||
Device* device = nullptr;
|
||||
if (device_get_first_by_type(&WIFI_TYPE, &device) != ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
const FirmwareOps* ops = nullptr;
|
||||
void* ctx = nullptr;
|
||||
if (wifi_get_firmware_ops(device, &ops, &ctx) != ERROR_NONE) {
|
||||
device_put(device);
|
||||
return false;
|
||||
}
|
||||
return ops->wait_ready(ctx, timeoutMs);
|
||||
bool ready = ops->wait_ready(ctx, timeoutMs);
|
||||
device_put(device);
|
||||
return ready;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user