diff options
| author | BEAST <macbook@Macbooks-MacBook-Pro-2.local> | 2026-11-17 09:40:39 +0530 |
|---|---|---|
| committer | BEAST <macbook@Macbooks-MacBook-Pro-2.local> | 2026-11-17 09:40:39 +0530 |
| commit | d358423b15bbd89ca8b34bb4ffc787811774105a (patch) | |
| tree | 5fa7233c0d5752d59e95c8070e28cd7d09b3170c /ControllerFirmware/flash-controller.bat | |
Add local files and custom README
Diffstat (limited to 'ControllerFirmware/flash-controller.bat')
| -rwxr-xr-x | ControllerFirmware/flash-controller.bat | 45 |
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
|
