feat: add 0xf8 feature report to get firmware version and add config version
This commit is contained in:
+8
-1
@@ -14,7 +14,8 @@
|
||||
|
||||
bool is_pico_cmd(uint8_t report_id) {
|
||||
if (report_id == 0xf6 ||
|
||||
report_id == 0xf7
|
||||
report_id == 0xf7 ||
|
||||
report_id == 0xf8
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
@@ -31,6 +32,12 @@ uint16_t pico_cmd_get(uint8_t report_id, uint8_t *buffer, uint16_t reqlen) {
|
||||
memcpy(buffer,&get_config(),len);
|
||||
return len;
|
||||
}
|
||||
if (report_id == 0xf8) {
|
||||
printf("[HID] Receive 0xf8 getting firmware version\n");
|
||||
const auto len = std::min(strlen(PICO_PROGRAM_VERSION_STRING), static_cast<size_t>(reqlen));
|
||||
memcpy(buffer, PICO_PROGRAM_VERSION_STRING, len);
|
||||
return len;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user