18 void* pvPortRealloc(
void *ptr,
size_t new_size) {
20 return pvPortMalloc(new_size);
21 size_t old_size = vPortGetSizeBlock(ptr);
26 if(new_size <= old_size)
28 void* p = pvPortMalloc(new_size);
31 memcpy(p, ptr, old_size);
39 void *pvPortCalloc(
size_t nmemb,
size_t size){
40 size_t xWantedSize = nmemb*size;
41 void* ptr = pvPortMalloc(xWantedSize);
43 memset(ptr, 0, xWantedSize);
81 arm_sqrt_f32(in, &out);
92 const float coeff_1 =
M_PI/4;
93 const float coeff_2 = 3*
M_PI/4;
94 float abs_y = fabs(y)+1e-10;
97 r = (x - abs_y) / (x + abs_y);
98 angle = coeff_1 - coeff_1 * r;
100 r = (x + abs_y) / (abs_y - x);
101 angle = coeff_2 - coeff_1 * r;
119 #define M_LOG210 3.32192809488736
167 return 31 - __builtin_clz (x);
static uint32_t log_precision
static const float * log_table
float fast_powf(float x, float y)
uint32_t fast_log2i(uint32_t x)
static const uint32_t * pow_table
float fast_fmodf(float x, float y)
void fast_log_set_table(const float *table, int size)
float randf()
generate a random number between 0 and 1
float fast_exp2f(float x)
uint32_t arm_rand32()
Generate an unsigned 32bit pseudo-random number using xorshifter algorithm.
void arm_srand32(uint32_t s)
float fast_exp10f(float x)
float fast_log2f(float x)
void fast_pow_set_table(const uint32_t *table, int size)
float fast_atan2f(float y, float x)
float fast_log10f(float x)
static uint32_t pow_precision
float arm_sqrtf(float in)
float icsi_log(float arg, const float *lookup_table, const uint32_t precision)
float powFastLookup(const float val, const float ilog2, const uint32_t *pTable, const uint32_t precision)
Get pow (fast!).