Code Monkey home page Code Monkey logo

arduino_c_scaffold's People

Contributors

gdamjan avatar jasonporritt avatar sw17ch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

arduino_c_scaffold's Issues

make MCU, PARTNO and F_CPU configurable

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.