mirror of
https://github.com/esphome/esphome.git
synced 2025-08-06 02:17:45 +00:00
fix byte ordering
This commit is contained in:
parent
3d6a1811c5
commit
f245c74520
@ -127,8 +127,8 @@ static inline uint16_t convert_seconds_to_ms(uint16_t value) { return value * 10
|
||||
static inline void convert_int_values_to_hex(const int *values, uint8_t *bytes) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
uint16_t val = values[i] & 0xFFFF;
|
||||
bytes[i * 2] = (val >> 8) & 0xFF; // Store high byte
|
||||
bytes[i * 2 + 1] = val & 0xFF; // Store low byte
|
||||
bytes[i * 2] = val & 0xFF; // Store low byte first (little-endian)
|
||||
bytes[i * 2 + 1] = (val >> 8) & 0xFF; // Store high byte second
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user