feat: flash DFU device in HID mode (#337)

Co-authored-by: th33xitus <th33xitus@googlemail.com>
This commit is contained in:
CODeRUS
2023-06-04 21:23:32 +02:00
committed by GitHub
parent c19acb1694
commit 477f3ca72c

View File

@@ -70,6 +70,7 @@ function select_mcu_connection() {
echo -e "| How is the controller board connected to the host? |"
echo -e "| 1) USB |"
echo -e "| 2) UART |"
echo -e "| 3) USB (DFU mode) |"
blank_line
back_help_footer
@@ -85,6 +86,10 @@ function select_mcu_connection() {
status_msg "Identifying MCU possibly connected via UART ...\n"
get_uart_id || true # continue even after exit code 1
break;;
3)
status_msg "Identifying MCU connected via USB in DFU mode ...\n"
get_dfu_id || true # continue even after exit code 1
break;;
B|b)
advanced_menu
break;;
@@ -329,6 +334,16 @@ function get_uart_id() {
done
}
function get_dfu_id() {
unset mcu_list
sleep 1
mcus=$(lsusb | grep "DFU" | cut -d " " -f 6 2>/dev/null)
for mcu in ${mcus}; do
mcu_list+=("${mcu}")
done
}
function show_flash_method_help() {
top_border
echo -e "| ~~~~~~~~ < ? > Help: Flash MCU < ? > ~~~~~~~~ |"
@@ -406,4 +421,4 @@ function show_mcu_connection_help() {
error_msg "Invalid command!";;
esac
done
}
}