throwtheswitch / arduino_c_scaffold Goto Github PK
View Code? Open in Web Editor NEWA scaffold project using Rake, avr-gcc, and avrdude to program the Arduino UNO in plain C.
License: MIT License
A scaffold project using Rake, avr-gcc, and avrdude to program the Arduino UNO in plain C.
License: MIT License
Here's a patch:
From a6cce5b42a531d08a8120a8451376911737c0d95 Mon Sep 17 00:00:00 2001
From: Damjan Georgievski <[email protected]>
Date: Mon, 17 Oct 2011 06:15:52 +0200
Subject: [PATCH 1/4] make MCU, PARTNO and F_CPU configurable
---
Rakefile | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Rakefile b/Rakefile
index 62f4106..b30b133 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,9 @@
require 'rake/clean'
require 'fileutils'
+MCU = ENV['MCU'] || 'atmega328p'
+PARTNO = ENV['PARTNO'] || MCU
+F_CPU = ENV['F_CPU'] || '16000000UL'
SERIAL_PORT = ENV['SERIAL_PORT']
PROG = 'scaffold'
SRCDIR = 'src'
@@ -23,8 +26,8 @@ TARGET = {
:compiler => 'avr-gcc',
:compiler_args => [
'-DTARGET',
- '-DF_CPU=16000000UL',
- '-mmcu=atmega328p',
+ "-DF_CPU=#{F_CPU}",
+ "-mmcu=#{MCU}",
'-Iinclude/',
'-Wall',
'-Os',
@@ -32,7 +35,7 @@ TARGET = {
],
:linker => 'avr-gcc',
:linker_args => [
- '-mmcu=atmega328p'
+ "-mmcu=#{MCU}"
],
:objcopy => 'avr-objcopy'
}
@@ -90,11 +93,11 @@ namespace :target do
desc "Program the Arduino over the serial port."
task :program => [:convert, :serial_port] do
- sh "avrdude -F -V -c arduino -p ATMEGA328P -P #{SERIAL_PORT} -b 115200 -U flash:w:#{PROG}.hex"
+ sh "avrdude -F -V -c arduino -p #{PARTNO} -P #{SERIAL_PORT} -b 115200 -U flash:w:#{PROG}.hex"
end
desc "Make a backup hex image of the flash contents."
task :backup, [:backup_name] => :serial_port do |t, args|
- sh "avrdude -F -V -c arduino -p ATMEGA328P -P #{SERIAL_PORT} -b 115200 -U flash:r:#{args.backup_name}:i"
+ sh "avrdude -F -V -c arduino -p #{PARTNO} -P #{SERIAL_PORT} -b 115200 -U flash:r:#{args.backup_name}:i"
end
end
--
1.7.7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.