Use BE/LE functions for packing uint16.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-12-23 21:00:38 +01:00
parent d530ea6979
commit 8e68e6cae9
5 changed files with 15 additions and 18 deletions

View File

@@ -43,8 +43,8 @@ int phy_serialize_data(const phy_data_t *phy, uint8_t *data, uint16_t *len) {
*p++ = phy->led_brightness;
}
*p++ = PHY_OPTS;
*p++ = phy->opts >> 8;
*p++ = phy->opts & 0xff;
put_uint16_t_be(phy->opts, p);
p += 2;
if (phy->up_btn_present) {
*p++ = PHY_UP_BTN;
*p++ = phy->up_btn;