feat: add 0xf8 feature report to get firmware version and add config version

This commit is contained in:
awalol
2026-05-14 20:28:22 +08:00
parent 303a58b9c5
commit 58909831e1
6 changed files with 47 additions and 14 deletions
+8 -1
View File
@@ -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;
}