Fix WS2812 led definition
[inav.git] / src / main / flight / smith_predictor.h
blob1d8ebcb13be7fe71cc020523d0b5db55685f39e8
1 /*
2 * This file is part of INAV Project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/.
8 * Alternatively, the contents of this file may be used under the terms
9 * of the GNU General Public License Version 3, as described below:
11 * This file is free software: you may copy, redistribute and/or modify
12 * it under the terms of the GNU General Public License as published by the
13 * Free Software Foundation, either version 3 of the License, or (at your
14 * option) any later version.
16 * This file is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/.
24 * This code is a derivative of work done in EmuFlight Project https://github.com/emuflight/EmuFlight
28 #pragma once
30 #include <stdint.h>
31 #include "common/filter.h"
33 #define MAX_SMITH_SAMPLES 64
35 typedef struct smithPredictor_s {
36 bool enabled;
37 uint8_t samples;
38 uint8_t idx;
39 float data[MAX_SMITH_SAMPLES + 1];
40 pt1Filter_t smithPredictorFilter;
41 float smithPredictorStrength;
42 } smithPredictor_t;
44 float applySmithPredictor(uint8_t axis, smithPredictor_t *predictor, float sample);
45 void smithPredictorInit(smithPredictor_t *predictor, float delay, float strength, uint16_t filterLpfHz, uint32_t looptime);