From 88a4bb97a5140b0268531d3cee9fad146432ff51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 24 Aug 2021 21:49:23 +0200 Subject: [PATCH] Remove fior filter again... Not needed. --- stm-firmware/fir-filter.c | 64 ------------------- .../include/reflow-controller/fir-filter.h | 37 ----------- 2 files changed, 101 deletions(-) delete mode 100644 stm-firmware/fir-filter.c delete mode 100644 stm-firmware/include/reflow-controller/fir-filter.h diff --git a/stm-firmware/fir-filter.c b/stm-firmware/fir-filter.c deleted file mode 100644 index 955f600..0000000 --- a/stm-firmware/fir-filter.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Reflow Oven Controller -* -* Copyright (C) 2021 Mario Hüttel -* -* This file is part of the Reflow Oven Controller Project. -* -* The reflow oven controller is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* The Reflow Oven Control Firmware is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with the reflow oven controller project. -* If not, see . -*/ - -#include - -void fir_filter_init_null(struct fir_filter_fixed *filter) -{ - uint32_t idx; - - if (!filter) - return; - filter->put_idx = 0U; - for (idx = 0; idx < filter->tap_count; idx++) - filter->data = 0; -} - - -int32_t fir_filter_process_sample(struct fir_filter_fixed *filter, int32_t sample) -{ - uint32_t tap_idx; - uint32_t coeff_idx; - int32_t output = 0; - - if (!filter) - return 0; - - /* Store the new data point */ - filter->data[filter->put_idx] = sample; - - coeff_idx = filter->put_idx; - - /* Apply fir taps on data */ - for (tap_idx = 0; tap_idx < filter->tap_count; tap_idx++) { - output += filter->data[tap_idx] * filter->coefficients[coeff_idx]; - - if (coeff_idx) - coeff_idx--; - else - coeff_idx = filter->tap_count-1; - } - - filter->put_idx++; - if (filter->put_idx >= filter->tap_count) - filter->put_idx = 0; - - return output; -} diff --git a/stm-firmware/include/reflow-controller/fir-filter.h b/stm-firmware/include/reflow-controller/fir-filter.h deleted file mode 100644 index b9e4221..0000000 --- a/stm-firmware/include/reflow-controller/fir-filter.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Reflow Oven Controller -* -* Copyright (C) 2021 Mario Hüttel -* -* This file is part of the Reflow Oven Controller Project. -* -* The reflow oven controller is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* The Reflow Oven Control Firmware is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with the reflow oven controller project. -* If not, see . -*/ - -#ifndef __FIR_FILTER_H__ -#define __FIR_FILTER_H__ - -#include - -struct fir_filter_fixed { - uint32_t tap_count; - const int32_t *coefficients; - int32_t *data; - uint32_t put_idx; -}; - -void fir_filter_init_null(struct fir_filter_fixed *filter); - -int32_t fir_filter_process_sample(struct fir_filter_fixed *filter, int32_t sample); - -#endif /* __FIR_FILTER_H__ */