avburn 0.2.1 → 0.5.0

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.
data/Rakefile CHANGED
@@ -1,50 +1,34 @@
1
- require 'rubygems'
2
1
  require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'rake'
11
-
12
- require 'jeweler'
13
- Jeweler::Tasks.new do |gem|
14
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
- gem.name = "avburn"
16
- gem.homepage = "http://github.com/nofxx/avburn"
17
- gem.license = "MIT"
18
- gem.summary = %Q{Shoes based GUI for AVRDUDE}
19
- gem.description = %Q{Shoes based GUI for AVRDUDE, burn fuses, bootloaders}
20
- gem.email = "x@nofxx.com"
21
- gem.authors = ["Marcos Piccinini"]
22
- # Include your dependencies below. Runtime dependencies are required when using your gem,
23
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
- # gem.add_development_dependency 'rspec', '> 1.2.3'
26
- end
27
- Jeweler::RubygemsDotOrgTasks.new
2
+ Bundler.setup
28
3
 
29
- require 'rspec/core'
30
- require 'rspec/core/rake_task'
31
- RSpec::Core::RakeTask.new(:spec) do |spec|
32
- spec.pattern = FileList['spec/**/*_spec.rb']
4
+ require "rspec"
5
+ require "rspec/core/rake_task"
6
+
7
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
8
+ require "avburn/version"
9
+
10
+ desc "Builds the gem"
11
+ task :gem => :build
12
+ task :build do
13
+ system "gem build avburn.gemspec"
14
+ Dir.mkdir("pkg") unless Dir.exists?("pkg")
15
+ system "mv avburn-#{Avburn::VERSION}.gem pkg/"
33
16
  end
34
17
 
35
- RSpec::Core::RakeTask.new(:rcov) do |spec|
36
- spec.pattern = 'spec/**/*_spec.rb'
37
- spec.rcov = true
18
+ task :install => :build do
19
+ system "sudo gem install pkg/avburn-#{Avburn::VERSION}.gem"
38
20
  end
39
21
 
40
- task :default => :spec
22
+ desc "Release the gem - Gemcutter"
23
+ task :release => :build do
24
+ system "git tag -a v#{Avburn::VERSION} -m 'Tagging #{Avburn::VERSION}'"
25
+ system "git push --tags"
26
+ system "gem push pkg/avburn-#{Avburn::VERSION}.gem"
27
+ end
41
28
 
42
- require 'rake/rdoctask'
43
- Rake::RDocTask.new do |rdoc|
44
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
29
 
46
- rdoc.rdoc_dir = 'rdoc'
47
- rdoc.title = "avburn #{version}"
48
- rdoc.rdoc_files.include('README*')
49
- rdoc.rdoc_files.include('lib/**/*.rb')
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = "spec/**/*_spec.rb"
50
32
  end
33
+
34
+ task :default => [:spec]
@@ -1,22 +1,28 @@
1
- :attinyx5:
1
+ :tx5: &attinyx5
2
2
  :hfuse:
3
3
  - RSTDISBL
4
4
  - DWEN
5
5
  - SPIEN
6
6
  - WDTON
7
7
  - EESAVE
8
- - BOOTSZ0
9
- - BOOTSZ1
10
- - BOOTRST
8
+ - BODLEVEL2
9
+ - BODLEVEL1
10
+ - BODLEVEL0
11
11
  :lfuse:
12
12
  - CKDIB8
13
13
  - CKOUT
14
14
  - SUT1
15
15
  - SUT0
16
- - CKSEL0
17
- - CKSEL1
18
- - CKSEL2
19
16
  - CKSEL3
17
+ - CKSEL2
18
+ - CKSEL1
19
+ - CKSEL0
20
+ :efuse:
21
+ - SELFPRGEN
22
+
23
+ :t25: *attinyx5
24
+ :t45: *attinyx5
25
+ :t85: *attinyx5
20
26
 
21
27
  :atmega8:
22
28
  :hfuse:
@@ -0,0 +1,3 @@
1
+ module Avburn
2
+ VERSION = '0.5.0'
3
+ end
metadata CHANGED
@@ -1,148 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: avburn
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 1
9
- version: 0.2.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Marcos Piccinini
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-01-01 00:00:00 -02:00
18
- default_executable: avburn
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rspec
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 3
30
- - 0
31
- version: 2.3.0
32
- type: :development
33
- prerelease: false
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: bundler
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ~>
41
- - !ruby/object:Gem::Version
42
- segments:
43
- - 1
44
- - 0
45
- - 0
46
- version: 1.0.0
47
- type: :development
48
- prerelease: false
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: jeweler
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ~>
56
- - !ruby/object:Gem::Version
57
- segments:
58
- - 1
59
- - 5
60
- - 2
61
- version: 1.5.2
62
- type: :development
63
- prerelease: false
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: rcov
67
- requirement: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- segments:
73
- - 0
74
- version: "0"
75
- type: :development
76
- prerelease: false
77
- version_requirements: *id004
78
- description: Shoes based GUI for AVRDUDE, burn fuses, bootloaders
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Read/Write AVR Microcontrollers fuses and memory
79
15
  email: x@nofxx.com
80
- executables:
81
- - avburn
16
+ executables: []
82
17
  extensions: []
83
-
84
- extra_rdoc_files:
85
- - README.md
86
- files:
87
- - .document
88
- - .rspec
89
- - Gemfile
90
- - Gemfile.lock
91
- - README.md
92
- - Rakefile
93
- - VERSION
94
- - bin/avburn
95
- - lib/avburn.rb
96
- - lib/avburn/fuses.yml
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/avburn/img/down.png
21
+ - lib/avburn/img/wrench.png
22
+ - lib/avburn/img/tick.png
23
+ - lib/avburn/img/lightning.png
97
24
  - lib/avburn/img/burn.png
98
25
  - lib/avburn/img/clock.png
99
- - lib/avburn/img/down.png
100
26
  - lib/avburn/img/err.png
101
- - lib/avburn/img/hex.png
102
- - lib/avburn/img/lightning.png
103
- - lib/avburn/img/lock.png
104
- - lib/avburn/img/lock_unlock.png
105
- - lib/avburn/img/target.png
106
- - lib/avburn/img/tick.png
107
27
  - lib/avburn/img/up.png
28
+ - lib/avburn/img/lock_unlock.png
108
29
  - lib/avburn/img/warn.png
109
- - lib/avburn/img/wrench.png
110
- - media/ss.png
111
- - spec/avburn_spec.rb
30
+ - lib/avburn/img/lock.png
31
+ - lib/avburn/img/target.png
32
+ - lib/avburn/img/hex.png
33
+ - lib/avburn/version.rb
34
+ - lib/avburn/fuses.yml
35
+ - lib/avburn.rb
112
36
  - spec/spec_helper.rb
113
- has_rdoc: true
37
+ - spec/avburn_spec.rb
38
+ - README.md
39
+ - Rakefile
114
40
  homepage: http://github.com/nofxx/avburn
115
- licenses:
116
- - MIT
41
+ licenses: []
117
42
  post_install_message:
118
43
  rdoc_options: []
119
-
120
- require_paths:
44
+ require_paths:
121
45
  - lib
122
- required_ruby_version: !ruby/object:Gem::Requirement
46
+ required_ruby_version: !ruby/object:Gem::Requirement
123
47
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- hash: -1143364932424996770
128
- segments:
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ segments:
129
53
  - 0
130
- version: "0"
131
- required_rubygems_version: !ruby/object:Gem::Requirement
54
+ hash: -240967970924154119
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
56
  none: false
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- segments:
137
- - 0
138
- version: "0"
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
139
61
  requirements: []
140
-
141
62
  rubyforge_project:
142
- rubygems_version: 1.3.7
63
+ rubygems_version: 1.8.23
143
64
  signing_key:
144
65
  specification_version: 3
145
- summary: Shoes based GUI for AVRDUDE
146
- test_files:
147
- - spec/avburn_spec.rb
148
- - spec/spec_helper.rb
66
+ summary: Read/Write AVR MCU fuses and memory
67
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/.rspec DELETED
@@ -1 +0,0 @@
1
- --color
data/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
-
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
8
- group :development do
9
- gem "rspec", "~> 2.3.0"
10
- gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.5.2"
12
- gem "rcov", ">= 0"
13
- end
@@ -1,28 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- diff-lcs (1.1.2)
5
- git (1.2.5)
6
- jeweler (1.5.2)
7
- bundler (~> 1.0.0)
8
- git (>= 1.2.5)
9
- rake
10
- rake (0.8.7)
11
- rcov (0.9.9)
12
- rspec (2.3.0)
13
- rspec-core (~> 2.3.0)
14
- rspec-expectations (~> 2.3.0)
15
- rspec-mocks (~> 2.3.0)
16
- rspec-core (2.3.1)
17
- rspec-expectations (2.3.0)
18
- diff-lcs (~> 1.1.2)
19
- rspec-mocks (2.3.0)
20
-
21
- PLATFORMS
22
- ruby
23
-
24
- DEPENDENCIES
25
- bundler (~> 1.0.0)
26
- jeweler (~> 1.5.2)
27
- rcov
28
- rspec (~> 2.3.0)
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.1
data/bin/avburn DELETED
@@ -1,389 +0,0 @@
1
- #!/usr/bin/env shoes
2
- require 'rubygems'
3
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
-
5
- # Distribute as rubygem
6
- exec "shoes #{__FILE__}" unless Object.const_defined? "Shoes"
7
-
8
- require 'avburn'
9
- include Avburn
10
-
11
-
12
- Shoes.app :title => "AVbuRn", :width => 1050, :height => 730 do
13
- background gradient(rgb(245, 245, 245), rgb(190,190,190))
14
- # background "#e0e0e0"
15
-
16
- flow do
17
- background "#881010"
18
- # background_gradient(rgb(138, 10, 10), rgb(190,30,30))
19
- # title "AVRb", :margin_top => 30, :color => "#ffffff"
20
- stack :width => '90%' do
21
- banner "AVbuRn", :margin_left => 15, :margin_top => 17, :variant => 'smallcaps', :size => 'large', :stroke => "#fff", :weight => "bold"
22
- end
23
- stack :margin_top => 17, :width => '-5%' do
24
- @fuse_stack = stack do
25
- @fuse_btn = button("FUSE") do |btn|
26
- @fuse_stack.hide
27
- @hex_stack.show
28
-
29
- @hex.hide
30
- @fuses.show
31
- end
32
- end
33
- @fuse_stack.hide
34
- @hex_stack = stack do
35
- # @fuse_btn.toggle
36
- @hex_btn = button("HEX") do |btn|
37
- @fuse_stack.show
38
- @hex_stack.hide
39
- @hex.show
40
- @fuses.hide
41
- end
42
- end
43
- end
44
- end
45
-
46
- stack :margin => 10, :margin_top => 2 do
47
- flow do
48
- stack do #:width => '50%' do
49
- border "#fff"
50
- flow do
51
- para " Programmer: ", :weight => "bold"
52
- @prog_list = list_box :items => Prog.all, :width => 120, :choose => Conf[:prog] do |list|
53
- @prog = list.text
54
- changed(list)
55
- end
56
- para " Platform: ", :weight => "bold"
57
- @platform_list = list_box :items => Part.all, :text => "Select..", :width => 120, :choose => @platform ||= Conf[:platform] do |list|
58
- # @platform_list = list_box :items => [1,2], :width => 120 do |list|
59
- @platform = list.text
60
- changed(list)
61
- print_fuses()
62
- end
63
- para " Memory: ", :weight => "bold"
64
- @memory_list = list_box :items => Memory, :width => 120, :choose => Conf[:memory] do |list|
65
- @memory = list.text
66
- changed(list)
67
- end
68
-
69
- image "../lib/avburn/img/down.png", :margin => 7
70
- button "Read" do
71
- fname = ask_save_file
72
- run_comm "#{@memory}:r:#{fname}:#{@format||'i'}"
73
- end
74
- para " "
75
- image "../lib/avburn/img/wrench.png", :margin => 7
76
- button "Config" do
77
- @config_dlg = dialog "Config", :width => 300, :height => 280 do
78
- flow do
79
- background "#881010"
80
- # title "AVRb", :margin_top => 30, :color => "#ffffff"
81
- stack :width => '100%' do
82
- banner "Config", :margin_left => 15, :margin_top => 20, :variant => 'smallcaps', :size => 'large', :stroke => "#fff", :weight => "bold"
83
- end
84
- end
85
- stack :margin => 15 do
86
- {
87
- :dont_erase_flash => "Disable auto erase for flash",
88
- :override_sig => "Override invalid signature check",
89
- :chip_erase => "Perform chip erase",
90
- :no_verify => "Do not verify"
91
- }.each do |key, val|
92
- flow do
93
- ch = check :checked => Conf[key]
94
- ch.click { |c| Conf[key] = c.checked?; Avburn.write_conf }
95
- para val
96
- end
97
- end
98
-
99
- end
100
- stack :margin_left => 110 do
101
- button "Close" do
102
- close
103
- end
104
- end
105
- end
106
-
107
- end
108
- end
109
-
110
-
111
- flow do
112
- para " Port: ", :weight => "bold"
113
- edit_line do |l|
114
- @port = l.text
115
- end
116
-
117
- para " CMD Opts: ", :weight => "bold"
118
- edit_line do |l|
119
- @cmd_opts = l.text
120
- end
121
-
122
- para " Format: ", :weight => "bold"
123
- @format_list = list_box :items => Format.values, :width => 120, :choose => Conf[:format] do |l|
124
- @format = Format.keys[Format.values.index(l.text)]
125
- changed(l)
126
- end
127
-
128
- para " "
129
- button "About" do
130
- @config_dlg = dialog "About", :width => 300, :height => 280 do
131
- flow do
132
- background "#881010"
133
- # title "AVRb", :margin_top => 30, :color => "#ffffff"
134
- stack :width => '100%' do
135
- banner "About", :margin_left => 15, :margin_top => 20, :variant => 'smallcaps', :size => 'large', :stroke => "#fff", :weight => "bold"
136
- end
137
- end
138
- stack :margin => 15 do
139
- para "AVbuRn version v0.2", :weight => "bold", :align => "center"
140
- para "http://github.com/nofxx/avburn", :align => "center"
141
- para "Running with shoes! Ruby #{RUBY_VERSION}"
142
- link "Source", :click => lambda { visit "http://github.com" }
143
- end
144
- stack :margin_left => 110 do
145
- button "Close" do
146
- close
147
- end
148
- end
149
-
150
- end
151
-
152
- end
153
-
154
- end
155
-
156
- end
157
- end
158
-
159
- @fuses = stack :margin_top => 8 do
160
- flow do
161
- stack :width => "50%" do
162
- caption "Fuses"
163
- flow do
164
- #para "Name: ", :weight => "bold"
165
- edit_line do |l|
166
- @fuse_name = l.text
167
- end
168
- button "Save" do |btn|
169
- data = {}
170
- for fuse in FuseLabel[@platform.to_sym].keys
171
- data.merge!({ fuse => @fuses_store["#{fuse}hex"] })
172
- end
173
- filename = "/#{@fuse_name}_#{@platform}.yml"
174
- File.open(AvbFuse + filename, "w") { |f| f << data.to_yaml }
175
- @fuses_list.items = Fuse.all
176
- end
177
- end
178
- end
179
-
180
- flow :width => "-50%" do
181
- caption "Load"
182
- @fuses_list = list_box :items => Fuse.all, :width => 320, :choose => Conf[:fuse] do |l|
183
- @fusefile = l.text
184
- YAML.load(File.read("#{AvbFuse}/#{l.text}")).each do |fuse, val|
185
- @fuses_store.set(fuse, val)
186
- end
187
- print_fuses
188
- end
189
-
190
- end
191
- end
192
-
193
- @fuses_checks = stack(:margin_top => 20) { }
194
- end
195
-
196
-
197
- @hex = stack :margin_top => 20 do
198
- flow do
199
- image "../lib/avburn/img/burn.png", :margin => 5
200
- caption "Burn"
201
- end
202
- flow do
203
- para " Hexfile: ", :weight => "bold"
204
- @hex_list = list_box :items => Hex.all, :width => 420, :choose => Conf[:hex] do |list|
205
- @hexfile = list.text
206
- check_hex_enabled
207
- end
208
- para " "
209
- @verify_btn = button("Verify", :state => "disabled") { run_hex_comm :v }
210
- para " "
211
- @burn_btn = button("Burn!", :state => "disabled") { run_hex_comm :w if confirm("Burn Hex to Chip?") }
212
- end
213
-
214
- flow :margin_top => 25 do
215
- flow do
216
- image "../lib/avburn/img/hex.png", :margin => 5
217
- caption "Add Hex"
218
- end
219
- para " Name: ", :weight => "bold"
220
- @name_edit = edit_line :width => 220 do |le|
221
- @proj_name = le.text
222
- @dump_btn.state = @file_btn.state = le.text.size > 0 ? nil : "disabled"
223
- end
224
- para " "
225
- @dump_btn = button "From Chip", :state => "disabled" do |btn|
226
- btn.state = "disabled"
227
- Thread.new do
228
- ds = dump_stamp(@memory)
229
- run_comm "#{@memory}:r:#{ds}:i"
230
- data = File.read(ds)
231
- filename = "/#{@proj_name}_#{@platform}_#{@memory}.hex"
232
- File.open(AvbHex + filename, "w") { |f| f << data }
233
- @hex_list.items = Hex.all
234
- end
235
- end
236
- para " "
237
- @file_btn = button "From File", :state => "disabled" do |btn|
238
- file = ask_open_file
239
- File.open(AvbHex + "/#{@proj_name}.hex", "w") { |f| f << File.read(file) }
240
- @hex_list.items = Hex.all
241
- @name_edit.text = ""
242
- end
243
- end
244
-
245
- end
246
- @hex.hide
247
- # print_fuses
248
-
249
-
250
- flow do
251
- flow(:width => "3%", :margin => 5) do
252
- @status = flow {}
253
-
254
- end
255
- flow(:width => "-97%") do
256
- background "#ccc"
257
-
258
- @footer = para "AVRburn v0.1"
259
- end
260
- end
261
-
262
- stack(:margin_top => 5, :width => "100%") do#, :height => 350, :scroll => true) do
263
- flow do
264
- caption "Log "
265
- button("Clear") { @log.text = "" }
266
- end
267
- @log = para "", :family => "Inconsolata;monospace;monospaced"
268
- end
269
-
270
- end
271
-
272
- #
273
- #
274
- # Methods
275
- #
276
- def run_hex_comm(c)
277
- Thread.new do
278
- run_comm("#{@memory}:#{c}:#{AvbHex}/#{@hexfile}") # { alert "Done!" }
279
- dialog
280
- end
281
- end
282
-
283
- def print_fuses
284
- @fuses_checks.clear
285
- return unless @platform && fuse_ary = FuseLabel[@platform.to_sym]
286
- @fuses_checks.append do
287
- Fuses.each do |fuse|
288
- next unless all = fuse_ary[fuse]
289
- flow do
290
- cw = check
291
- cw.click do |c|
292
- @write_fuses[fuse] = c.checked?
293
- end
294
-
295
- button("r") { read_from_chip fuse }
296
- ftxt = edit_line @fuses_store["#{fuse}hex"], :width => "25px" do |line|
297
- @fuses_store.set(fuse, line.text)
298
- print_fuses if line.text.size > 1
299
- end
300
- instance_variable_set("@#{fuse}_txt".to_sym, ftxt)
301
- all.unshift nil until all.size == 8 # Fix for fuses LSB
302
- all.each_with_index do |label, i|
303
- next unless label
304
- lbl = para label
305
- ch = check :checked => avr_bool(@fuses_store[fuse][i])
306
- ch.click do |c|
307
- @fuses_list.choose(nil) unless @fuses_list.text.nil?
308
- instance_variable_get("@#{fuse}_txt").text = @fuses_store.set_bit(fuse, i, c.checked?)
309
- end
310
- para "|", :stroke => "#aaa"
311
- # lbl.click { ch.checked = ch.checked? ? false : true } #TODO nice to click on labels... =/
312
- end
313
- para " #{@fuses_store[fuse].join.scan(/\d{4}/).join(' ')} "
314
-
315
- end
316
- end
317
- button("Write Marked") { write_fuses }
318
- # button("Clear") { @log.text = "" }
319
- end
320
- end
321
-
322
- def toggle_mode
323
- @toggle_btn.text = @toggle_btn.text == "HEX" ? "FUSES" : "HEX"
324
- end
325
-
326
- def log(txt)
327
- @footer.text = txt.split("\n")[-1]
328
- @log.text += txt + "\n" #+ @log.text
329
- end
330
-
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}")
340
- end
341
-
342
- def changed(obj)
343
- Conf.merge!({ :platform => @platform, :prog => @prog, :memory => @memory, :format => @format })
344
- Avburn.write_conf
345
- end
346
-
347
- def read_dir
348
- @fuses_store = FuseStore.new
349
- @write_fuses ||= {}
350
- Fuses.each { |f| @fuses_store.set(f, "FF") }
351
-
352
- # Dir['./*'].each do |file|
353
- # case file
354
- # when /\wfuse/ then read_fuse(file)
355
- # # when /\.hex/ then add_hex(file) TODO
356
- # end
357
- # end
358
- end
359
- read_dir
360
-
361
- # #{Conf[:memory]}
362
- def read_from_chip(fuse)
363
- run_comm "#{fuse}:r:/tmp/#{fuse}:h"
364
- name = (fuse =~ /\// ? fuse.split("/")[1] : fuse)
365
- data = File.read("/tmp/#{fuse}").chomp
366
- log "Data: #{data}"
367
- @fuses_store.set(name, Integer(data).to_s(16))
368
- print_fuses
369
- end
370
-
371
- def check_hex_enabled
372
- state = @hexfile ? nil : "disabled"
373
- @verify_btn.state = state
374
- @burn_btn.state = state
375
- end
376
- end
377
-
378
- # stack :margin => 10 do
379
- # button "Start" do
380
- # @time = Time.now
381
- # @label.replace "Stop watch started at #@time"
382
- # end
383
- # button "Stop" do
384
- # @label.replace "Stopped, ", strong("#{Time.now - @time}"), " seconds elapsed."
385
- # end
386
- # @label = para "Press ", strong("start"), " to begin timing."
387
- # end
388
- # end
389
-
Binary file