~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to Flintrock/bistro-hd/flashany_attiny45.bat

  • Committer: Selene Scriven
  • Date: 2014-07-22 23:45:40 UTC
  • Revision ID: ubuntu@toykeeper.net-20140722234540-7jkvx6or9mow8dze
Moved my sources into ToyKeeper/ directory to keep things a little cleaner.
By default, I'll put my personal firmware there to indicate it might not be
as useful for general-purpose use, it's just something I made.
(can move or copy some again later if they end up being interesting to others)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
@echo off
2
 
REM ************* EDIT HERE ******************
3
 
 
4
 
rem #low C2, D2, E2 for 0ms, 4ms and 64ms startup. > nul
5
 
rem #fuses: high DD disabled DE 1.8V DF 2.7V  > nul
6
 
 
7
 
 
8
 
SET lfuse=0xD2
9
 
SET hfuse=0xDE
10
 
SET efuse=0xff
11
 
SET mcu=attiny45
12
 
 
13
 
REM ********************** DON'T EDIT BELOW HERE*********************
14
 
 
15
 
 
16
 
if ["%~1%"]==[""]  (
17
 
  assoc .hex=hexfile
18
 
  echo assoc %0
19
 
  reg import "%~dp0clearhexassoc.reg"
20
 
  reg add HKEY_CLASSES_ROOT\Applications\%~n0.bat\shell\open\command /ve /d "%~0 ""%%1""" /t REG_SZ /f
21
 
  reg add HKEY_CLASSES_ROOT\.hex /ve /d "hexfile" /t REG_SZ /f
22
 
  reg add HKEY_CLASSES_ROOT\hexfile\Shell\Open\Command /ve /d "%~0" /t REG_SZ /f
23
 
  reg add HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.hex /ve /d "hexfile" /t REG_SZ /f
24
 
  reg add HKEY_LOCAL_MACHINE\SOFTWARE\Classes\hexfile\Shell\Open\Command /ve /d "%~0 ""%%1""" /t REG_SZ /f
25
 
  reg add HKEY_CURRENT_USER\SOFTWARE\Classes\.hex /ve /d "hexfile" /t REG_SZ /f
26
 
  reg add HKEY_CURRENT_USER\SOFTWARE\Classes\hexfile\Shell\Open\Command /ve /d "%~0 ""%%1""" /t REG_SZ /f
27
 
rem  reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.hex\UserChoice /v "ProgId" /d "Applications\%~n0.bat" /t REG_SZ /f
28
 
  ftype hexfile=%0 "%1" 
29
 
 
30
 
@echo on
31
 
@ECHO.
32
 
@ECHO.
33
 
@ECHO Hex files associated.  Double click any hex to flash
34
 
@ECHO.
35
 
@ECHO.
36
 
 
37
 
goto end
38
 
)
39
 
 
40
 
 
41
 
SET width=180
42
 
SET height=40
43
 
SET bufheight=500
44
 
SET bufwidth=500
45
 
 
46
 
mode con: cols=%width% lines=%height%
47
 
powershell -command "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.width=%bufwidth%;$B.height=%bufheight%;$W.buffersize=$B;}"
48
 
 
49
 
SET file=%~d1%~p1%~n1.hex
50
 
 
51
 
REM Reconstruct the elf file:
52
 
 
53
 
del tmp.elf tmp.bin tmp.hex > nul
54
 
avr-objcopy -I ihex -O elf32-avr "%file%" tmp.elf > nul
55
 
avr-objcopy -I ihex -O binary "%file%" tmp.bin > nul
56
 
avr-objcopy -I binary -O elf32-avr tmp.bin tmp.elf > nul
57
 
 
58
 
copy "%file%" tmp.hex > nul
59
 
 
60
 
@echo on
61
 
avrdude -p %mcu% -c usbasp -u -e
62
 
avrdude -c usbasp -p %mcu% -U lfuse:w:%lfuse%:m -U hfuse:w:%hfuse%:m -U efuse:w:%efuse%:m 
63
 
avrdude -c usbasp -p %mcu% -U flash:w:tmp.hex
64
 
avr-size -C --mcu=%mcu% tmp.elf
65
 
 
66
 
@del tmp.elf tmp.bin tmp.hex 
67
 
 
68
 
:end
69
 
@ECHO This window will self destruct in 45 seconds:
70
 
@ECHO.
71
 
@ECHO.
72
 
 
73
 
@ping -n 45 127.0.0.1 > nul