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

22 lines
607 B
C

// SPDX-License-Identifier: Apache-2.0
/**
* @brief Contains various unsorted defines
* @note Preprocessor defines with potentially clashing names implement an #ifdef check.
*/
#pragma once
#ifndef MIN
/** @brief Get the minimum value of 2 values */
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
/** @brief Get the maximum value of 2 values */
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef CLAMP
/** @brief Clamp a value between the provided minimum and maximum */
#define CLAMP(min, max, value) (((value) < (min)) ? (min) : (((value) > (max)) ? (max) : (value)))
#endif