@echo off
echo Will upload 1.0.53 firmware + your chosen temp factor files
echo usage: tempsensor_upload.bat air-ohm clt-ohm aref
echo WARNING: Overwrites your current firmware in your ECU
echo ctrl-c to abort
echo -----------------------------------------------------------------------
pause
if exist Tools\ntc_airX_cltfactor\airXfactor_%1_%3.hex (
if exist Tools\ntc_airX_cltfactor\cltfactor_%2_%3.hex (
if exist firmware\upload.hex del firmware\upload.hex
type Tools\ntc_airX_cltfactor\airXfactor_%1_%3.hex > temppatch.hex
type Tools\ntc_airX_cltfactor\cltfactor_%2_%3.hex >> temppatch.hex
Tools\ntc_airX_cltfactor\hexpatch.exe firmware\vems12x12.hex < temppatch.hex > firmware\upload.hex
del temppatch.hex 

)) else ( echo Missing files)

if exist firmware\upload.hex (
tools\megaloader.exe firmware\upload.hex -wtE 38400 -c com1 

) else ( 
echo Patch Failed )
pause

