From 7764125350e66e464dded24ca8cf69a7e1ecef8d Mon Sep 17 00:00:00 2001 From: BEAST Date: Mon, 16 Nov 2026 19:23:09 +0530 Subject: Add local project files --- ControllerFirmware/flash-controller.bat | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 ControllerFirmware/flash-controller.bat (limited to 'ControllerFirmware/flash-controller.bat') diff --git a/ControllerFirmware/flash-controller.bat b/ControllerFirmware/flash-controller.bat new file mode 100755 index 0000000..f08023a --- /dev/null +++ b/ControllerFirmware/flash-controller.bat @@ -0,0 +1,45 @@ +@echo off +rem =================================================================== +rem NRL - Flash the Controller (double-click launcher, Windows) +rem Writes the prebuilt controller firmware to a plugged-in controller. +rem =================================================================== +setlocal +title NRL - Flash Controller + +set "SCRIPT=%~dp0flash_controller.py" + +rem Find a usable Python 3 via the kit's installer helper (in ..\tools\); +rem if this ControllerFirmware folder was copied without tools\, fall back +rem to whatever py/python is already on this PC. +set "ENSURE=%~dp0..\tools\ensure-python.ps1" +set "PYEXE=" +if exist "%ENSURE%" ( + for /f "usebackq delims=" %%i in (`powershell -NoProfile -ExecutionPolicy Bypass -File "%ENSURE%"`) do set "PYEXE=%%i" +) +if defined PYEXE goto run + +where py >nul 2>nul +if errorlevel 1 goto try_python +set "PYEXE=py" +goto run + +:try_python +where python >nul 2>nul +if errorlevel 1 goto no_python +set "PYEXE=python" +goto run + +:run +"%PYEXE%" "%SCRIPT%" %* +goto end + +:no_python +echo. +echo [error] Python 3 was not found and could not be installed automatically. +echo Install Python 3 from https://www.python.org/downloads/ and re-run, +echo ticking "Add python.exe to PATH" during setup. + +:end +echo. +if not defined NRL_NO_PAUSE pause +endlocal -- cgit v1.2.3