From be7ef9ae1b4200116c5a980d2ff1b42111dd90cb Mon Sep 17 00:00:00 2001 From: DimitryP6 Date: Sun, 17 Nov 2024 15:36:11 -0500 Subject: [PATCH] #173: fixed clang format issue --- .pre-commit-config.yaml | 18 +++++++++--------- simple_ema.c | 29 ++++++++++++++++------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 570ca9b..157f2fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ -repos: - - repo: local - hooks: - - id: clang_restage - name: Restage formatted files - entry: clang_restage - language: system - pass_filenames: false - always_run: true +repos: + - repo: local + hooks: + - id: clang_restage + name: Restage formatted files + entry: clang_restage + language: system + pass_filenames: false + always_run: true stages: [pre-commit] \ No newline at end of file diff --git a/simple_ema.c b/simple_ema.c index f6221f0..b0a6ca1 100644 --- a/simple_ema.c +++ b/simple_ema.c @@ -1,13 +1,16 @@ -#include - -// Exponential Moving Average Lowpass Filter -void ema_filter(float current_value, float *previous_ema, float alpha) { - *previous_ema = (alpha * current_value) + ((1 - alpha) * (*previous_ema)); -} - -int main() { - float alpha = 0.1f; // smoothing strength - float ema = 0.0f; // initial value can be 0 - // Something like : ema_filter(curent_unfiltered_value, &ema, alpha) - return 0; -} +#include + +// Exponential Moving Average Lowpass Filter +void ema_filter(float current_value, float *previous_ema, float alpha) +{ + *previous_ema = + (alpha * current_value) + ((1 - alpha) * (*previous_ema)); +} + +int main() +{ + float alpha = 0.1f; // smoothing strength + float ema = 0.0f; // initial value can be 0 + // Something like : ema_filter(curent_unfiltered_value, &ema, alpha) + return 0; +}