Fix DGUS write variable endianness (#18689)
This commit is contained in:
parent
b9d4b0ddce
commit
6f0885a3a3
@ -1180,6 +1180,10 @@ void DGUSDisplay::WriteVariable(uint16_t adr, const void* values, uint8_t values
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DGUSDisplay::WriteVariable(uint16_t adr, uint16_t value) {
|
||||||
|
WriteVariable(adr, static_cast<const void*>(&value), sizeof(uint16_t));
|
||||||
|
}
|
||||||
|
|
||||||
void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
|
void DGUSDisplay::WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr) {
|
||||||
const char* myvalues = static_cast<const char*>(values);
|
const char* myvalues = static_cast<const char*>(values);
|
||||||
bool strend = !myvalues;
|
bool strend = !myvalues;
|
||||||
|
@ -54,10 +54,7 @@ public:
|
|||||||
// Variable access.
|
// Variable access.
|
||||||
static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
static void WriteVariable(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
||||||
static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
static void WriteVariablePGM(uint16_t adr, const void* values, uint8_t valueslen, bool isstr=false);
|
||||||
template<typename T>
|
static void WriteVariable(uint16_t adr, uint16_t value);
|
||||||
static void WriteVariable(uint16_t adr, T value) {
|
|
||||||
WriteVariable(adr, static_cast<const void*>(&value), sizeof(T));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Until now I did not need to actively read from the display. That's why there is no ReadVariable
|
// Until now I did not need to actively read from the display. That's why there is no ReadVariable
|
||||||
// (I extensively use the auto upload of the display)
|
// (I extensively use the auto upload of the display)
|
||||||
|
Loading…
Reference in New Issue
Block a user