Ken Van Hoeylandt 71f8369377
TactilityKernel improvements (#464)
* **New Features**
  * Thread API with lifecycle, priority, affinity and state monitoring
  * Timer subsystem: one-shot/periodic timers, reset, pending callbacks, expiry queries
  * Expanded I²C: register-level ops, bulk writes, presence checks, ESP32 integration and new config properties
  * GPIO controller: pin level and options APIs
  * Error utilities: new error code, error-to-string, timeout helper and common macros
  * Device construction helpers (construct+start)

* **Tests**
  * New unit tests for thread and timer behavior

* **Documentation**
  * Expanded coding style guide (files/folders, C conventions)
2026-01-28 23:58:11 +01:00

36 lines
933 B
C++

// SPDX-License-Identifier: Apache-2.0
#include <tactility/error.h>
extern "C" {
const char* error_to_string(error_t error) {
switch (error) {
case ERROR_NONE:
return "no error";
case ERROR_UNDEFINED:
return "undefined";
case ERROR_INVALID_STATE:
return "invalid state";
case ERROR_INVALID_ARGUMENT:
return "invalid argument";
case ERROR_MISSING_PARAMETER:
return "missing parameter";
case ERROR_NOT_FOUND:
return "not found";
case ERROR_ISR_STATUS:
return "ISR status";
case ERROR_RESOURCE:
return "resource";
case ERROR_TIMEOUT:
return "timeout";
case ERROR_OUT_OF_MEMORY:
return "out of memory";
case ERROR_NOT_SUPPORTED:
return "not supported";
default:
return "unknown";
}
}
}