добавлены newline и по мелочи
This commit is contained in:
@@ -87,6 +87,8 @@ int32_t process_value_int(int32_t raw_adc_quant) {
|
||||
#ifdef ARM_MATH_CM4
|
||||
#include "arm_math.h"
|
||||
#define DSP_FITLERS 1
|
||||
#else
|
||||
#include "math.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -201,6 +201,12 @@ extern void Error_Handler(void);
|
||||
*/
|
||||
#define ABS(x) ( ((x) > 0)? (x) : -(x))
|
||||
|
||||
/**
|
||||
* @brief Константа Пи
|
||||
*/
|
||||
#ifndef PI
|
||||
#define PI 3.14159265f
|
||||
#endif
|
||||
/** UTILS_DEFINES
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -354,14 +354,14 @@ float FilterRMS_Process(FilterRMS_t* filter, float input) {
|
||||
|
||||
// ==================== INT32_T ВЕРСИИ ====================
|
||||
|
||||
// Вспомогательная функция для сравнения int32_t
|
||||
static int Filter_int32_compare(const void *a, const void *b) {
|
||||
int32_t ia = *(const int32_t*)a;
|
||||
int32_t ib = *(const int32_t*)b;
|
||||
if (ia < ib) return -1;
|
||||
if (ia > ib) return 1;
|
||||
return 0;
|
||||
}
|
||||
//// Вспомогательная функция для сравнения int32_t
|
||||
//static int Filter_int32_compare(const void *a, const void *b) {
|
||||
// int32_t ia = *(const int32_t*)a;
|
||||
// int32_t ib = *(const int32_t*)b;
|
||||
// if (ia < ib) return -1;
|
||||
// if (ia > ib) return 1;
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
/**
|
||||
* @brief Инициализация медианного фильтра (int32_t)
|
||||
@@ -748,7 +748,7 @@ int32_t FilterRMSInt_Process(FilterRMSInt_t* filter, int32_t input) {
|
||||
int64_t mean_square = filter->sum_squares / filter->count;
|
||||
// Защита от отрицательных значений
|
||||
if (mean_square < 0) mean_square = 0;
|
||||
filter->last_rms = (int32_t)sqrt((double)mean_square);
|
||||
filter->last_rms = (int32_t)_sqrtf((float)mean_square);
|
||||
}
|
||||
|
||||
return filter->last_rms;
|
||||
|
||||
Reference in New Issue
Block a user