|
| 1 | +OPENOCD_SCRIPTS_PATH=${OPENOCD_SCRIPTS_PATH:-/usr/share/openocd/scripts/} |
| 2 | +DOCKER=${DOCKER:-docker} |
| 3 | + |
1 | 4 | function _boards { |
2 | 5 | local -a _boards_available |
3 | 6 | local -a _board_dirs |
@@ -78,6 +81,16 @@ function _hw_programmers { |
78 | 81 | _describe 'hw_programmer' _hw_programmer_vals |
79 | 82 | } |
80 | 83 |
|
| 84 | +function _ftdi_adapter { |
| 85 | + local -a _adapter_vals=($(find "$OPENOCD_SCRIPTS_PATH"/interface/ftdi -type f -name '*.cfg' -exec basename --suffix=.cfg {} \;)) |
| 86 | + _describe 'ftdi_adapter' _adapter_vals |
| 87 | +} |
| 88 | + |
| 89 | +function _docker_image { |
| 90 | + local -a _docker_image_vals=($("$DOCKER" image ls --format '{{.Repository}}')) |
| 91 | + _describe 'docker_image' _docker_image_vals |
| 92 | +} |
| 93 | + |
81 | 94 | function _riot { |
82 | 95 | local -a _std_targets=( |
83 | 96 | "all:build the application" |
@@ -123,13 +136,15 @@ function _riot { |
123 | 136 | 'BOARD[Select the board to build for]:board:_boards' |
124 | 137 | 'TOOLCHAIN[Select the toolchain to use]:toolcahin:_toolchains' |
125 | 138 | 'BUILD_IN_DOCKER[Build inside docker container]:bool:_bools' |
| 139 | + 'DOCKER_IMAGE[The docker image to use with BUILD_IN_DOCKER=1]:docker_image:_docker_image' |
126 | 140 | 'LTO[Enable link time optimization]:bool:_bools' |
127 | 141 | 'VERBOSE_ASSERT[Print source file and line on blown assertion]:bool:_bools' |
128 | 142 | 'QUIET[Reduce verbosity of build output]:bool:_bools' |
129 | 143 | 'WERROR[Enable/disable -Werror flag]:bool:_bools' |
130 | 144 | 'RIOT_CI_BUILD[Behave as in the CI: Less verbose output, reproducible builds, ...]:bool:_bools' |
131 | 145 | 'PROGRAMMER[Select the programmer software to flash (debug) with]:programmer:_programmers' |
132 | 146 | 'OPENOCD_DEBUG_ADAPTER[Select the programmer hardware to use with OpenOCD]:hw_programmer:_hw_programmers' |
| 147 | + 'OPENOCD_FTDI_ADAPTER[Select the FTDI adapter config to use with OpenOCD]:ftdi_adapter:_ftdi_adapter' |
133 | 148 | 'OPENOCD_RESET_USE_CONNECT_ASSERT_SRST[Let OpenOCD attach while reset signal is asserted]:bool:_bools' |
134 | 149 | 'STATIC_ANALYSIS[Enable static analysis for modules that claim support]:bool:_bools' |
135 | 150 | ) |
|
0 commit comments