From c22c02722ca138e8e7715fe7d8c0f5566670d947 Mon Sep 17 00:00:00 2001 From: cmdgears Date: Wed, 20 Oct 2021 17:37:00 +0200 Subject: [PATCH] added volatile to variables susceptible to be changed in a ISR (i.e. all member variables in this case...) --- Statistic.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Statistic.h b/Statistic.h index ae34cb4..55d1365 100644 --- a/Statistic.h +++ b/Statistic.h @@ -38,12 +38,12 @@ public: protected: - uint32_t _cnt; - float _sum; - float _min; - float _max; - bool _useStdDev; - float _ssqdif; // sum of squares difference + volatile uint32_t _cnt; + volatile float _sum; + volatile float _min; + volatile float _max; + volatile bool _useStdDev; + volatile float _ssqdif; // sum of squares difference };