1.优化设备命令。

This commit is contained in:
MacRsh
2023-11-29 15:16:37 +08:00
parent 68df69b294
commit 7bf435b6bd
11 changed files with 79 additions and 65 deletions

View File

@@ -127,6 +127,14 @@ extern "C" {
*/
#define mr_min(a, b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
/**
* @brief This macro function swaps two values.
*
* @param a The first value.
* @param b The second value.
*/
#define mr_swap(a, b) (a ^= b, b ^= a, a ^= b)
/**
* @brief This macro function aligns the size up to a multiple of 4.
*