Ken Van Hoeylandt e6abd496f9
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.
2026-01-27 08:04:21 +01:00

18 lines
469 B
C++

// SPDX-License-Identifier: Apache-2.0
#include <Tactility/ErrorEsp32.h>
error_t esp_err_to_error(esp_err_t error) {
switch (error) {
case ESP_OK:
return ERROR_NONE;
case ESP_ERR_INVALID_ARG:
return ERROR_INVALID_ARGUMENT;
case ESP_ERR_INVALID_STATE:
return ERROR_INVALID_STATE;
case ESP_ERR_TIMEOUT:
return ERROR_TIMEOUT;
default:
return ERROR_UNDEFINED;
}
}