Module: Avburn
- Defined in:
- lib/avburn.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#avr_bool(bit) ⇒ Object
40 41 42 |
# File 'lib/avburn.rb', line 40 def avr_bool(bit) bit.to_i.zero? end |
#dump_stamp(n) ⇒ Object
44 45 46 |
# File 'lib/avburn.rb', line 44 def dump_stamp(n) "/tmp/#{n}-#{Time.now.to_i}" end |
#run_comm(c) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/avburn.rb', line 48 def run_comm(c) @log.text = "" comm = "#{Avrdude} -c #{Conf[:prog]} -p #{Conf[:platform]} " comm << "-P #{@port} " if @port comm << "#{@cmd_opts} -U #{c}" log "> Running #{comm}" if block_given? Thread.new do Kernel.system "#{comm} &> output" log File.read("output") yield end else Kernel.system "#{comm} &> output" log File.read("output") end end |
#set_footer(bool) ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/avburn.rb', line 66 def bool p "OUT #{bool}" img = bool ? "tick" : "err" @status.clear @status.append { image("../lib/avburn/img/#{img}.png") } end |