Various improvements (#461)
* **New Features** * Time and delay utilities added (ticks, ms, µs); SD card now uses an expansion-header CS pin; HTTP downloads warn when run on the GUI task and yield to avoid blocking. * **Bug Fixes / Reliability** * Many hard-crash paths converted to guarded checks to reduce abrupt termination and improve stability. * **Tests** * Unit tests added to validate time and delay accuracy. * **Chores** * License header and build/macro updates.
This commit is contained in:
committed by
GitHub
parent
619b5aa53b
commit
e6abd496f9
@@ -1,4 +1,5 @@
|
||||
#include <Tactility/Tactility.h>
|
||||
#include <Tactility/Check.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/hal/Device.h>
|
||||
#include <Tactility/hal/gps/GpsInit.h>
|
||||
@@ -68,20 +69,19 @@ void init(const Configuration& configuration) {
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitHalBegin);
|
||||
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitI2cBegin);
|
||||
tt_check(i2c::init(configuration.i2c), "I2C init failed");
|
||||
check(i2c::init(configuration.i2c), "I2C init failed");
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitI2cEnd);
|
||||
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitSpiBegin);
|
||||
tt_check(spi::init(configuration.spi), "SPI init failed");
|
||||
check(spi::init(configuration.spi), "SPI init failed");
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitSpiEnd);
|
||||
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitUartBegin);
|
||||
tt_check(uart::init(configuration.uart), "UART init failed");
|
||||
check(uart::init(configuration.uart), "UART init failed");
|
||||
kernel::publishSystemEvent(kernel::SystemEvent::BootInitUartEnd);
|
||||
|
||||
if (configuration.initBoot != nullptr) {
|
||||
LOGGER.info("Init boot");
|
||||
tt_check(configuration.initBoot(), "Init boot failed");
|
||||
check(configuration.initBoot(), "Init boot failed");
|
||||
}
|
||||
|
||||
registerDevices(configuration);
|
||||
|
||||
@@ -139,7 +139,7 @@ GpsResponse getACKCas(uart::Uart& uart, uint8_t class_id, uint8_t msg_id, uint32
|
||||
bool init(uart::Uart& uart, GpsModel type) {
|
||||
switch (type) {
|
||||
case GpsModel::Unknown:
|
||||
tt_crash();
|
||||
check(false);
|
||||
case GpsModel::AG3335:
|
||||
case GpsModel::AG3352:
|
||||
return initAg33xx(uart);
|
||||
|
||||
@@ -202,7 +202,7 @@ bool masterWrite(i2c_port_t port, uint8_t address, const uint8_t* data, uint16_t
|
||||
}
|
||||
|
||||
bool masterWriteRegister(i2c_port_t port, uint8_t address, uint8_t reg, const uint8_t* data, uint16_t dataSize, TickType_t timeout) {
|
||||
tt_check(reg != 0);
|
||||
check(reg != 0);
|
||||
|
||||
auto lock = getLock(port).asScopedLock();
|
||||
if (!lock.lock(timeout)) {
|
||||
|
||||
Reference in New Issue
Block a user