Browse Source

feat(setup): Disallow split w/ wired controller.

For now, disallow wired split combination during setup.
xmkb
Peter Johanson 3 years ago committed by Pete Johanson
parent
commit
6227866e8c
  1. 1
      docs/src/setup-script-generation-plugin/index.js
  2. 11
      docs/src/templates/setup.ps1.mustache
  3. 7
      docs/src/templates/setup.sh.mustache

1
docs/src/setup-script-generation-plugin/index.js

@ -30,6 +30,7 @@ function generateSetupScripts() {
if (item.features?.includes("keys")) { if (item.features?.includes("keys")) {
agg.keyboards.push(item); agg.keyboards.push(item);
} else { } else {
item.usb_only = !item.outputs?.includes("ble");
agg.boards.push(item); agg.boards.push(item);
} }
break; break;

11
docs/src/templates/setup.ps1.mustache

@ -125,12 +125,23 @@ if ($keyboard_type -eq "shield") {
{{id}} = "{{{name}}}"; {{id}} = "{{{name}}}";
{{/boards}} {{/boards}}
} }
$boards_usb_only = [ordered]@{
{{#boards}}
{{id}} = "{{usb_only}}";
{{/boards}}
}
Write-Host "$title" Write-Host "$title"
Write-Host "" Write-Host ""
Write-Host "MCU Board Selection:" Write-Host "MCU Board Selection:"
$choice = Get-Choice-From-Options -Options $boards.values -Prompt $prompt $choice = Get-Choice-From-Options -Options $boards.values -Prompt $prompt
if ($keyboard_split -eq "true" -and $($($boards_usb_only.values)[$choice]) -eq "true") {
Write-Host "Wired split is not yet supported by ZMK."
exit 1
}
$shields = $keyboard_siblings $shields = $keyboard_siblings
$board = $($($boards.keys)[$choice]) $board = $($($boards.keys)[$choice])
$boards = ( $board ) $boards = ( $board )

7
docs/src/templates/setup.sh.mustache

@ -120,6 +120,7 @@ if [ "$keyboard_shield" == "y" ]; then
prompt="Pick an MCU board:" prompt="Pick an MCU board:"
options=({{#boards}}"{{{name}}}" {{/boards}}) options=({{#boards}}"{{{name}}}" {{/boards}})
board_ids=({{#boards}}"{{id}}" {{/boards}}) board_ids=({{#boards}}"{{id}}" {{/boards}})
boards_usb_only=({{#boards}}"{{#usb_only}}y{{/usb_only}}{{^usb_only}}n{{/usb_only}}" {{/boards}})
echo "" echo ""
echo "MCU Board Selection:" echo "MCU Board Selection:"
@ -134,6 +135,12 @@ if [ "$keyboard_shield" == "y" ]; then
echo "Invalid option. Try another one." echo "Invalid option. Try another one."
continue continue
fi fi
if [ -n "${!keyboard_sibling_first}" ] && [ "${boards_usb_only[$board_index]}" = "y" ] ; then
echo "Wired split is not yet supported by ZMK."
exit 1
fi
board_index=$(( $REPLY-1 )) board_index=$(( $REPLY-1 ))
board=${board_ids[$board_index]} board=${board_ids[$board_index]}
board_title=${options[$board_index]} board_title=${options[$board_index]}

Loading…
Cancel
Save