add prediction for 10s

This commit is contained in:
2024-12-25 22:10:38 +01:00
parent 307278e679
commit ff16e601fb
3 changed files with 47 additions and 7 deletions

View File

@ -3,6 +3,8 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define AVG10_SAMPLE_SIZE 10U
#define AVG60_SAMPLE_SIZE 60U
#define PRED10_SAMPLE_SIZE 10U
#define PRED60_SAMPLE_SIZE 60U
typedef enum _BurnerErrorState
{
@ -24,11 +26,21 @@ typedef struct _Average
size_t bufferCount;
} sAverage;
typedef struct _Predict
{
float fValue;
float samples[MAX(PRED10_SAMPLE_SIZE, PRED60_SAMPLE_SIZE)];
size_t bufferIndex;
size_t bufferCount;
} sPredict;
typedef struct _Measurement
{
float fCurrentValue;
sAverage average10s;
sAverage average60s;
sPredict predict10s;
sPredict predict60s;
eMeasurementErrorState state;
} sMeasurement;