summaryrefslogtreecommitdiffstats
path: root/ruby
diff options
context:
space:
mode:
authorBluebie <a@creativepony.com>2012-10-05 10:13:04 +1000
committerBluebie <a@creativepony.com>2012-10-05 10:13:04 +1000
commit0633fe8a35080bb3f6c8d60364df00e1cb70b7d0 (patch)
tree533138f20ae4d5eda002484b4d3d0ac3d39a6211 /ruby
parent9e61bd70f3f794fc8849a004ca13208de98d8225 (diff)
downloadmicronucleus-0633fe8a35080bb3f6c8d60364df00e1cb70b7d0.tar.gz
micronucleus-0633fe8a35080bb3f6c8d60364df00e1cb70b7d0.tar.bz2
micronucleus-0633fe8a35080bb3f6c8d60364df00e1cb70b7d0.zip
ruby: a little hex-to-bin converter because I was too lazy to find out how to make avr-gcc stuff do it.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/hex-to-bin.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/ruby/hex-to-bin.rb b/ruby/hex-to-bin.rb
new file mode 100644
index 0000000..528a50f
--- /dev/null
+++ b/ruby/hex-to-bin.rb
@@ -0,0 +1,9 @@
+require_relative "../ruby/micronucleus.rb"
+
+# just converts a hex file to a binary file
+program = HexProgram.new open ARGV.first
+
+File.open ARGV.first.split('/').last.sub(/\.hex$/, '') + '.raw', 'w' do |file|
+ file.write program.binary
+ file.close
+end