avburn 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/avburn +20 -6
  3. data/lib/avburn.rb +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/bin/avburn CHANGED
@@ -274,7 +274,10 @@ Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
274
274
  # Methods
275
275
  #
276
276
  def run_hex_comm(c)
277
- run_comm "#{@memory}:#{c}:#{ENV['HOME']}/#{AvbHex}/#{@hexfile}"
277
+ Thread.new do
278
+ run_comm("#{@memory}:#{c}:#{AvbHex}/#{@hexfile}") # { alert "Done!" }
279
+ dialog
280
+ end
278
281
  end
279
282
 
280
283
  def print_fuses
@@ -284,7 +287,11 @@ Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
284
287
  Fuses.each do |fuse|
285
288
  next unless all = fuse_ary[fuse]
286
289
  flow do
287
- button("w") { write_fuse(fuse) }
290
+ cw = check
291
+ cw.click do |c|
292
+ @write_fuses[fuse] = c.checked?
293
+ end
294
+
288
295
  button("r") { read_from_chip fuse }
289
296
  ftxt = edit_line @fuses_store["#{fuse}hex"], :width => "25px" do |line|
290
297
  @fuses_store.set(fuse, line.text)
@@ -307,6 +314,7 @@ Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
307
314
 
308
315
  end
309
316
  end
317
+ button("Write Marked") { write_fuses }
310
318
  # button("Clear") { @log.text = "" }
311
319
  end
312
320
  end
@@ -320,10 +328,15 @@ Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
320
328
  @log.text += txt + "\n" #+ @log.text
321
329
  end
322
330
 
323
- def write_fuse(fu)
324
- hex = @fuses_store["#{fu}hex"].upcase
325
- comm = "#{fu}:w:0x#{hex}:m"
326
- run_comm comm if confirm("Command: #{comm}")
331
+ def write_fuses
332
+ comm = ""
333
+ @write_fuses.each do |fuse, w|
334
+ next unless w
335
+ hex = @fuses_store["#{fuse}hex"].upcase
336
+ comm << "-U #{fuse}:w:0x#{hex}:m "
337
+ end
338
+ return if comm.empty?
339
+ run_comm comm if confirm("Execute #{comm}")
327
340
  end
328
341
 
329
342
  def changed(obj)
@@ -333,6 +346,7 @@ Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
333
346
 
334
347
  def read_dir
335
348
  @fuses_store = FuseStore.new
349
+ @write_fuses ||= {}
336
350
  Fuses.each { |f| @fuses_store.set(f, "FF") }
337
351
 
338
352
  # Dir['./*'].each do |file|
@@ -55,7 +55,7 @@ module Avburn
55
55
  comm << "-F " if Conf[:override_sig]
56
56
  comm << "-D " if Conf[:dont_erase_flash]
57
57
  comm << "-e " if Conf[:chip_erase]
58
- comm << "#{@cmd_opts} -U #{c}"
58
+ comm << "#{@cmd_opts} #{'-U' unless c =~ /-U/} #{c}"
59
59
  log "> Running #{comm}"
60
60
  @status.clear
61
61
  @status.append { image("../lib/avburn/img/clock.png") }
@@ -144,7 +144,7 @@ class FuseStore < Hash
144
144
  hex = "0#{hex}" if hex.size == 1
145
145
  hex = hex[0,2]
146
146
  self[fuse.to_sym] = Integer("0x#{hex}").to_s(2).rjust(8, "0").split(//)
147
- self["#{fuse}hex"] = hex
147
+ self["#{fuse}hex"] = hex.upcase
148
148
  end
149
149
 
150
150
  def set_bit(fuse, bit, bool)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Marcos Piccinini
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - ">="
126
126
  - !ruby/object:Gem::Version
127
- hash: -2133168550269331055
127
+ hash: -1143364932424996770
128
128
  segments:
129
129
  - 0
130
130
  version: "0"