Out of bounds protection for telemetryItems[] array access and some code refactoring for telemetry value precision

This commit is contained in:
Damjan Adamic
2015-10-18 12:06:25 +02:00
parent 4ef9913f76
commit 082ba0893d
8 changed files with 49 additions and 28 deletions
+5 -3
View File
@@ -1313,10 +1313,12 @@ PACK(typedef struct {
};
void init(const char *label, uint8_t unit=UNIT_RAW, uint8_t prec=0);
void init(uint16_t id);
bool isAvailable();
bool isAvailable() const;
int32_t getValue(int32_t value, uint8_t unit, uint8_t prec) const;
bool isConfigurable();
bool isPrecConfigurable();
bool isConfigurable() const;
bool isPrecConfigurable() const;
uint32_t getPrecMultiplier() const;
uint32_t getPrecDivisor() const;
}) TelemetrySensor;
#endif