summaryrefslogtreecommitdiff
path: root/ControllerFirmware/flash-controller.bat
diff options
context:
space:
mode:
authorBEAST <macbook@Macbooks-MacBook-Pro-2.local>2026-11-16 19:23:09 +0530
committerBEAST <macbook@Macbooks-MacBook-Pro-2.local>2026-11-16 19:23:09 +0530
commit7764125350e66e464dded24ca8cf69a7e1ecef8d (patch)
treee01f8b3a15fe905d6e5ccc3da6822df238b49030 /ControllerFirmware/flash-controller.bat
Add local project files
Diffstat (limited to 'ControllerFirmware/flash-controller.bat')
-rwxr-xr-xControllerFirmware/flash-controller.bat45
1 files changed, 45 insertions, 0 deletions
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