mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 00:51:25 +02:00
Added support for dynamic USB_VID / USB_PID.
It can be changed on runtime without rebuilding or patching. Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -283,8 +283,10 @@ void scan_flash() {
|
||||
scan_region(false);
|
||||
#ifndef ENABLE_EMULATION
|
||||
file_t *ef_vp = search_dynamic_file(EF_VP);
|
||||
if (file_has_data(ef_vp)) {
|
||||
|
||||
if (file_has_data(ef_vp) && file_get_size(ef_vp) >= 4) {
|
||||
uint8_t *data = file_get_data(ef_vp);
|
||||
usb_vid = (data[0] << 8) | data[1];
|
||||
usb_pid = (data[2] << 8) | data[3];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user