diff options
author | Bluebie <a@creativepony.com> | 2013-11-17 17:33:42 +1100 |
---|---|---|
committer | Bluebie <a@creativepony.com> | 2013-11-17 17:33:42 +1100 |
commit | 086906f916b0e6faf5a41656fba70fa29986b906 (patch) | |
tree | a84043a0f901b485a5c8a88fc3f790adb1b22ac7 | |
parent | 0a4f48c2cbcf20f93fc9531b3f57974cb4b6364d (diff) | |
parent | b220fc49f4beaf200cfbf088721c09823b274905 (diff) | |
download | micronucleus-086906f916b0e6faf5a41656fba70fa29986b906.tar.gz micronucleus-086906f916b0e6faf5a41656fba70fa29986b906.tar.bz2 micronucleus-086906f916b0e6faf5a41656fba70fa29986b906.zip |
Merge branch 'testing' of github.com:Bluebie/micronucleus-t85 into cpldcpu-testing
-rw-r--r-- | ruby/micronucleus.rb | 5 |
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 |