This commit is contained in:
rebane 2016-08-22 14:28:21 +03:00
parent 0cf1ebbce2
commit 2b07e47fb8
3 changed files with 55 additions and 40 deletions

View file

@ -114,6 +114,19 @@ set rtl8710_flasher_auto_erase 0
set rtl8710_flasher_auto_verify 0
set rtl8710_flasher_auto_erase_sector 0xFFFFFFFF
proc array2file {a local_filename loc} {
for {set offset 0} {$offset < [array size a]} {set offset [expr {$offset + 1}]} {
append bindata [binary format c $a([expr $offset])]
}
set fp [open $local_filename "a+"]
close $fp
set fp [open $local_filename "r+"]
fconfigure $fp -translation binary
seek $fp $loc
puts -nonewline $fp $bindata
close $fp
}
proc rtl8710_flasher_init {} {
global rtl8710_flasher_firmware_ptr
global rtl8710_flasher_buffer
@ -138,21 +151,6 @@ proc rtl8710_flasher_init {} {
return ""
}
proc array2file {a local_filename loc} {
echo $a
echo [array size a]
for {set offset 0} {$offset < [array size a]} {set offset [expr {$offset + 1}]} {
append bindata [binary format c $a([expr $offset])]
}
set fp [open $local_filename "a+"]
close $fp
set fp [open $local_filename "r+"]
fconfigure $fp -translation binary
seek $fp $loc
puts -nonewline $fp $bindata
close $fp
}
proc rtl8710_flasher_mrw {reg} {
set value ""
mem2array value 32 $reg 1