Skip to content

Commit

Permalink
ruby library updated - still seems buggy though
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluebie committed Oct 7, 2013
1 parent bedfbdd commit 4d2fe55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ruby/micronucleus.rb
Expand Up @@ -56,9 +56,10 @@ def program= bytestring
info = self.info
raise "Program too long!" if bytestring.bytesize > info[:flash_length]
bytes = bytestring.bytes.to_a

bytes.push(0xFF) while bytes.length < info[:flash_length]

erase!

address = 0
bytes.each_slice(info[:page_size]) do |slice|
slice.push(0xFF) while slice.length < info[:page_size] # ensure every slice is one page_size long - pad out if needed
Expand Down

0 comments on commit 4d2fe55

Please sign in to comment.