feat(dma): advanced dma malloc helper

This commit is contained in:
Armando
2024-01-24 13:28:15 +08:00
committed by Gao Xu
parent 9c846916fa
commit f0518b3c16
27 changed files with 672 additions and 130 deletions

View File

@@ -7,25 +7,6 @@
#include "hal/hal_utils.h"
#include "hal/assert.h"
/**
* @brief helper function, calculate the Greatest Common Divisor
* @note gcd(a, b) = gcd(b, a % b)
* @param a bigger value
* @param b smaller value
* @return result of gcd(a, b)
*/
__attribute__((always_inline))
static inline uint32_t _gcd(uint32_t a, uint32_t b)
{
uint32_t c = a % b;
while (c != 0) {
a = b;
b = c;
c = a % b;
}
return b;
}
__attribute__((always_inline))
static inline uint32_t _sub_abs(uint32_t a, uint32_t b)
{