mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-22 01:40:52 +02:00
Add support for led driver in PHY.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
11
src/fs/phy.c
11
src/fs/phy.c
@@ -70,6 +70,11 @@ int phy_serialize_data(const phy_data_t *phy, uint8_t *data, uint16_t *len) {
|
||||
*p++ = 1;
|
||||
*p++ = phy->enabled_usb_itf;
|
||||
}
|
||||
if (phy->led_driver_present) {
|
||||
*p++ = PHY_LED_DRIVER;
|
||||
*p++ = 1;
|
||||
*p++ = phy->led_driver;
|
||||
}
|
||||
|
||||
*len = p - data;
|
||||
return PICOKEY_OK;
|
||||
@@ -141,6 +146,12 @@ int phy_unserialize_data(const uint8_t *data, uint16_t len, phy_data_t *phy) {
|
||||
phy->enabled_usb_itf_present = true;
|
||||
}
|
||||
break;
|
||||
case PHY_LED_DRIVER:
|
||||
if (tlen == 1) {
|
||||
phy->led_driver = *p++;
|
||||
phy->led_driver_present = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
p += tlen;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user