@echo off
REM AutoSense Flash Tool - ESP32
REM Requires: Python + esptool (pip install esptool)

set /p COMPORT=Enter the COM port your ESP32 is connected to (e.g. COM5):

echo.
echo Flashing AutoSense firmware to ESP32 on %COMPORT% ...
echo.

python -m esptool --chip esp32 --port %COMPORT% --baud 460800 write_flash -z ^
  --flash_mode dout --flash_freq 40m --flash_size 4MB ^
  0x1000 bin\esp32\bootloader.bin ^
  0x8000 bin\esp32\partitions.bin ^
  0xe000 bin\esp32\boot_app0.bin ^
  0x10000 bin\esp32\firmware.bin ^
  0x310000 bin\esp32\littlefs.bin

echo.
echo Done. Disconnect and power-cycle the device.
pause
