summaryrefslogtreecommitdiffstats
path: root/ruby/micronucleus.rb
diff options
context:
space:
mode:
authorBluebie <a@creativepony.com>2013-10-07 11:11:53 +1100
committerBluebie <a@creativepony.com>2013-10-07 11:11:53 +1100
commit4d2fe558400b5c9d3028a0a5a6800740448d87e5 (patch)
treeeb4c61810b484b5815fe7378809046ebe1da4666 /ruby/micronucleus.rb
parentbedfbdda7da712b8795d66d5c65cce18650f3d76 (diff)
downloadmicronucleus-4d2fe558400b5c9d3028a0a5a6800740448d87e5.tar.gz
micronucleus-4d2fe558400b5c9d3028a0a5a6800740448d87e5.tar.bz2
micronucleus-4d2fe558400b5c9d3028a0a5a6800740448d87e5.zip
ruby library updated - still seems buggy though
Diffstat (limited to 'ruby/micronucleus.rb')
-rw-r--r--ruby/micronucleus.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/ruby/micronucleus.rb b/ruby/micronucleus.rb
index 95ddb2f..4b63af2 100644
--- a/ruby/micronucleus.rb
+++ b/ruby/micronucleus.rb
@@ -56,9 +56,10 @@ class Micronucleus
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