Skip to content

Commit

Permalink
tools/psoc6/mpy-psoc.cmd: Fixing board selection validation.
Browse files Browse the repository at this point in the history
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
  • Loading branch information
jaenrig-ifx committed Sep 7, 2023
1 parent 408a2ce commit 9c0b36d
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions tools/psoc6/mpy-psoc6.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exit /b 0
exit /b 0

:cmd_firmware_deploy
call :mpy_firmware_deploy %2 %3
call :mpy_firmware_deploy %2 %3 %4
exit /b 0

:cmd_device_erase
Expand Down Expand Up @@ -175,10 +175,18 @@ exit /b 0
echo ^| 1 ^| CY8CPROTO-063-BLE ^|
echo +---------+-----------------------------------+
echo:
@REM echo No user selection required. Only one choice.
@REM set /a board_index=0
echo:
set /p/( board_index="Please type the desired board ID.")
set /P board_index=Please type the desired board ID:

if !board_index! LSS 0 (
echo error: board ID not valid
exit /b 1
)

if !board_index! GTR 1 (
echo error: board ID not valid
exit /b 1
)

call set board=%%board_list[!board_index!]%%
)
echo MicroPython PSoC6 Board :: %board%
Expand Down Expand Up @@ -239,10 +247,18 @@ exit /b 0
echo ^| 1 ^| CY8CPROTO-063-BLE ^|
echo +---------+-----------------------------------+
echo:
@REM echo No user selection required. Only one choice.
@REM set /a board_index=0
echo:
set /p/( board_index="Please type the desired board ID.")
set /P board_index=Please type the desired board ID:

if !board_index! LSS 0 (
echo error: board ID not valid
exit /b 1
)

if !board_index! GTR 1 (
echo error: board ID not valid
exit /b 1
)

call set board=%%board_list[!board_index!]%%
)
echo MicroPython PSoC6 Board :: %board%
Expand Down

0 comments on commit 9c0b36d

Please sign in to comment.