mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-09-11 19:55:14 +02:00
Improve handling of invalid values in OBPringbuffer; avoid some double coding
This commit is contained in:
@@ -45,9 +45,9 @@ private:
|
||||
size_t last; // Points to the last (newest) valid element
|
||||
size_t count; // Number of valid elements currently in buffer
|
||||
bool is_Full; // Indicates that all buffer elements are used and ringing is in use
|
||||
T MIN_VAL; // lowest possible value of buffer of type <T>
|
||||
T MAX_VAL; // highest possible value of buffer of type <T> -> indicates invalid value in buffer
|
||||
double dblMIN_VAL, dblMAX_VAL; // MIN_VAL, MAX_VAL in double format
|
||||
T NUMLIMIT_LOW; // internally lowest possible value of buffer of type <T>
|
||||
T NUMLIMIT_HIGH; // internally highest possible value of buffer of type <T>
|
||||
double BUFMIN_VAL, BUFMAX_VAL; // lowest/highest possible buffer value considering multiplier -> externally used
|
||||
mutable SemaphoreHandle_t bufLocker;
|
||||
|
||||
// metadata for buffer
|
||||
@@ -55,8 +55,8 @@ private:
|
||||
String dataFmt; // Format of boat data in buffer
|
||||
int updFreq; // Update frequency in milliseconds
|
||||
double mltplr; // Multiplier which transforms original <double> value into buffer type format
|
||||
double smallest; // Value range of buffer: smallest value; needs to be => MIN_VAL
|
||||
double largest; // Value range of buffer: biggest value; needs to be < MAX_VAL, since MAX_VAL indicates invalid entries
|
||||
double lowest; // low value range for boat data in this buffer; needs to be => BUFMIN_VAL
|
||||
double highest; // high value range for boat data in this buffer; needs to be < BUFMAX_VAL, since BUFMAX_VAL indicates invalid entries
|
||||
|
||||
void initCommon();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user