Various improvements (#264)

- Replace C function pointers with C++ `std::function` in `Thread`, `Timer` and `DispatcherThread`
- Rename `SystemEvent`-related functions
- WiFi: fix auto-connect when WiFi disconnects from bad signal
- WiFi: fix auto-connect when WiFi fails to auto-connect
- WiFi: implement disconnect() when tapping connected WiFi ap in WiFi management app
This commit is contained in:
Ken Van Hoeylandt
2025-03-30 21:59:31 +02:00
committed by GitHub
parent d72852a6e2
commit 3f1bfee3f5
37 changed files with 239 additions and 322 deletions
+8 -8
View File
@@ -15,19 +15,19 @@
namespace tt::hal {
void init(const Configuration& configuration) {
kernel::systemEventPublish(kernel::SystemEvent::BootInitHalBegin);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitHalBegin);
kernel::systemEventPublish(kernel::SystemEvent::BootInitI2cBegin);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitI2cBegin);
tt_check(i2c::init(configuration.i2c), "I2C init failed");
kernel::systemEventPublish(kernel::SystemEvent::BootInitI2cEnd);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitI2cEnd);
kernel::systemEventPublish(kernel::SystemEvent::BootInitSpiBegin);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitSpiBegin);
tt_check(spi::init(configuration.spi), "SPI init failed");
kernel::systemEventPublish(kernel::SystemEvent::BootInitSpiEnd);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitSpiEnd);
kernel::systemEventPublish(kernel::SystemEvent::BootInitUartBegin);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitUartBegin);
tt_check(uart::init(configuration.uart), "UART init failed");
kernel::systemEventPublish(kernel::SystemEvent::BootInitUartEnd);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitUartEnd);
if (configuration.initBoot != nullptr) {
TT_LOG_I(TAG, "Init power");
@@ -47,7 +47,7 @@ void init(const Configuration& configuration) {
hal::registerDevice(power);
}
kernel::systemEventPublish(kernel::SystemEvent::BootInitHalEnd);
kernel::publishSystemEvent(kernel::SystemEvent::BootInitHalEnd);
}
} // namespace