mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
* **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)
22 lines
607 B
C
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
|