diff --git a/.gitmodules b/.gitmodules index d9b3458..187d9e6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "Servo"] path = arduino/lib/Servo url = https://github.com/arduino-libraries/Servo.git +[submodule "arduino/Arduino-Makefile"] + path = arduino/Arduino-Makefile + url = https://github.com/sudar/Arduino-Makefile.git diff --git a/arduino/Arduino-Makefile b/arduino/Arduino-Makefile new file mode 160000 index 0000000..0809b54 --- /dev/null +++ b/arduino/Arduino-Makefile @@ -0,0 +1 @@ +Subproject commit 0809b5460617f2217d8b4b0f9a57758e220c429c diff --git a/arduino/Arduino-Makefile/.gitignore b/arduino/Arduino-Makefile/.gitignore deleted file mode 100644 index 2fa5764..0000000 --- a/arduino/Arduino-Makefile/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.o -build-cli -/.project -build-* diff --git a/arduino/Arduino-Makefile/.travis.yml b/arduino/Arduino-Makefile/.travis.yml deleted file mode 100644 index f97a4ea..0000000 --- a/arduino/Arduino-Makefile/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: c -compiler: - - gcc -script: tests/script/runtests.sh -before_install: tests/script/bootstrap.sh diff --git a/arduino/Arduino-Makefile/Arduino.mk b/arduino/Arduino-Makefile/Arduino.mk deleted file mode 100644 index 9554f35..0000000 --- a/arduino/Arduino-Makefile/Arduino.mk +++ /dev/null @@ -1,1602 +0,0 @@ -######################################################################## -# -# Makefile for compiling Arduino sketches from command line -# System part (i.e. project independent) -# -# Copyright (C) 2012 Sudar , based on -# M J Oldfield work: https://github.com/mjoldfield/Arduino-Makefile -# -# Copyright (C) 2010,2011,2012 Martin Oldfield , based on -# work that is copyright Nicholas Zambetti, David A. Mellis & Hernando -# Barragan. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of the -# License, or (at your option) any later version. -# -# Adapted from Arduino 0011 Makefile by M J Oldfield -# -# Original Arduino adaptation by mellis, eighthave, oli.keller -# -# Current version: 1.5.2 -# -# Refer to HISTORY.md file for complete history of changes -# -######################################################################## -# -# PATHS YOU NEED TO SET UP -# -# We need to worry about three different sorts of files: -# -# 1. The directory where the *.mk files are stored -# => ARDMK_DIR -# -# 2. Things which are always in the Arduino distribution e.g. -# boards.txt, libraries, etc. -# => ARDUINO_DIR -# -# 3. Things which might be bundled with the Arduino distribution, but -# might come from the system. Most of the toolchain is like this: -# on Linux it is supplied by the system. -# => AVR_TOOLS_DIR -# -# Having set these three variables, we can work out the rest assuming -# that things are canonically arranged beneath the directories defined -# above. -# -# On the Mac with IDE 1.0 you might want to set: -# -# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -# ARDMK_DIR = /usr/local -# -# On the Mac with IDE 1.5+ you might want to set: -# -# ARDUINO_DIR = /Applications/Arduino.app/Contents/Java -# ARDMK_DIR = /usr/local -# -# On Linux, you might prefer: -# -# ARDUINO_DIR = /usr/share/arduino -# ARDMK_DIR = /usr/share/arduino -# AVR_TOOLS_DIR = /usr -# -# On Windows declare this environmental variables using the windows -# configuration options. Control Panel > System > Advanced system settings -# Also take into account that when you set them you have to add '\' on -# all spaces and special characters. -# ARDUINO_DIR and AVR_TOOLS_DIR have to be relative and not absolute. -# This are just examples, you have to adapt this variables accordingly to -# your system. -# -# ARDUINO_DIR =../../../../../Arduino -# AVR_TOOLS_DIR =../../../../../Arduino/hardware/tools/avr -# ARDMK_DIR = /cygdrive/c/Users/"YourUser"/Arduino-Makefile -# -# On Windows it is highly recommended that you create a symbolic link directory -# for avoiding using the normal directories name of windows such as -# c:\Program Files (x86)\Arduino -# For this use the command mklink on the console. -# -# -# You can either set these up in the Makefile, or put them in your -# environment e.g. in your .bashrc -# -# If you don't specify these, we can try to guess, but that might not work -# or work the way you want it to. -# -# If you'd rather not see the configuration output, define ARDUINO_QUIET. -# -######################################################################## -# -# DEPENDENCIES -# -# to reset a board the (python) pySerial program is used. -# please install it prior to continue. -# -######################################################################## -# -# STANDARD ARDUINO WORKFLOW -# -# Given a normal sketch directory, all you need to do is to create -# a small Makefile which defines a few things, and then includes this one. -# -# For example: -# -# ARDUINO_LIBS = Ethernet SPI -# BOARD_TAG = uno -# MONITOR_PORT = /dev/cu.usb* -# -# include /usr/share/arduino/Arduino.mk -# -# Hopefully these will be self-explanatory but in case they're not: -# -# ARDUINO_LIBS - A list of any libraries used by the sketch (we -# assume these are in $(ARDUINO_DIR)/hardware/libraries -# or your sketchbook's libraries directory) -# -# MONITOR_PORT - The port where the Arduino can be found (only needed -# when uploading) -# -# BOARD_TAG - The tag for the board e.g. uno or mega -# 'make show_boards' shows a list -# -# If you have your additional libraries relative to your source, rather -# than in your "sketchbook", also set USER_LIB_PATH, like this example: -# -# USER_LIB_PATH := $(realpath ../../libraries) -# -# If you've added the Arduino-Makefile repository to your git repo as a -# submodule (or other similar arrangement), you might have lines like this -# in your Makefile: -# -# ARDMK_DIR := $(realpath ../../tools/Arduino-Makefile) -# include $(ARDMK_DIR)/Arduino.mk -# -# In any case, once this file has been created the typical workflow is just -# -# $ make upload -# -# All of the object files are created in the build-{BOARD_TAG} subdirectory -# All sources should be in the current directory and can include: -# - at most one .pde or .ino file which will be treated as C++ after -# the standard Arduino header and footer have been affixed. -# - any number of .c, .cpp, .s and .h files -# -# Included libraries are built in the build-{BOARD_TAG}/libs subdirectory. -# -# Besides make upload, there are a couple of other targets that are available. -# Do make help to get the complete list of targets and their description -# -######################################################################## -# -# SERIAL MONITOR -# -# The serial monitor just invokes the GNU screen program with suitable -# options. For more information see screen (1) and search for -# 'character special device'. -# -# The really useful thing to know is that ^A-k gets you out! -# -# The fairly useful thing to know is that you can bind another key to -# escape too, by creating $HOME{.screenrc} containing e.g. -# -# bindkey ^C kill -# -# If you want to change the baudrate, just set MONITOR_BAUDRATE. If you -# don't set it, it tries to read from the sketch. If it couldn't read -# from the sketch, then it defaults to 9600 baud. -# -######################################################################## -# -# ARDUINO WITH ISP -# -# You need to specify some details of your ISP programmer and might -# also need to specify the fuse values: -# -# ISP_PROG = stk500v2 -# ISP_PORT = /dev/ttyACM0 -# -# You might also need to set the fuse bits, but typically they'll be -# read from boards.txt, based on the BOARD_TAG variable: -# -# ISP_LOCK_FUSE_PRE = 0x3f -# ISP_LOCK_FUSE_POST = 0xcf -# ISP_HIGH_FUSE = 0xdf -# ISP_LOW_FUSE = 0xff -# ISP_EXT_FUSE = 0x01 -# -# You can specify to also upload the EEPROM file: -# ISP_EEPROM = 1 -# -# I think the fuses here are fine for uploading to the ATmega168 -# without bootloader. -# -# To actually do this upload use the ispload target: -# -# make ispload -# -# -######################################################################## -# -# ALTERNATIVE CORES -# -# To use alternative cores for platforms such as ATtiny, you need to -# specify a few more variables, depending on the core in use. -# -# The HLT (attiny-master) core can be used just by specifying -# ALTERNATE_CORE, assuming your core is in your ~/sketchbook/hardware -# directory. For example: -# -# ISP_PORT = /dev/ttyACM0 -# BOARD_TAG = attiny85 -# ALTERNATE_CORE = attiny-master -# -# To use the more complex arduino-tiny and TinyCore2 cores, you must -# also set ARDUINO_CORE_PATH and ARDUINO_VAR_PATH to the core -# directory, as these cores essentially replace the main Arduino core. -# For example: -# -# ISP_PORT = /dev/ttyACM0 -# BOARD_TAG = attiny85at8 -# ALTERNATE_CORE = arduino-tiny -# ARDUINO_VAR_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny -# ARDUINO_CORE_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny -# -# or.... -# -# ISP_PORT = /dev/ttyACM0 -# BOARD_TAG = attiny861at8 -# ALTERNATE_CORE = tiny2 -# ARDUINO_VAR_PATH = ~/sketchbook/hardware/tiny2/cores/tiny -# ARDUINO_CORE_PATH = ~/sketchbook/hardware/tiny2/cores/tiny -# -######################################################################## - -arduino_output = -# When output is not suppressed and we're in the top-level makefile, -# running for the first time (i.e., not after a restart after -# regenerating the dependency file), then output the configuration. -ifndef ARDUINO_QUIET - ifeq ($(MAKE_RESTARTS),) - ifeq ($(MAKELEVEL),0) - arduino_output = $(info $(1)) - endif - endif -endif - -######################################################################## -# Makefile distribution path - -ifndef ARDMK_DIR - # presume it's the same path to our own file - ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) -else - # show_config_variable macro is defined in Common.mk file and is not available yet. - # Let's define a variable to know that user specified ARDMK_DIR - ARDMK_DIR_MSG = USER -endif - -# include Common.mk now we know where it is -include $(ARDMK_DIR)/Common.mk - -# show_config_variable macro is available now. So let's print config details for ARDMK_DIR -ifndef ARDMK_DIR_MSG - $(call show_config_variable,ARDMK_DIR,[COMPUTED],(relative to $(notdir $(lastword $(MAKEFILE_LIST))))) -else - $(call show_config_variable,ARDMK_DIR,[USER]) -endif - -######################################################################## -# Default TARGET to pwd (ex Daniele Vergini) - -ifndef TARGET - space := - space += - TARGET = $(notdir $(subst $(space),_,$(CURDIR))) -endif - -######################################################################## -# Arduino version number - -ifndef ARDUINO_VERSION - # Remove all the decimals, remove anything before/including ":", remove anything after/including "+" and finally grab the last 5 bytes. - # Works for 1.0 and 1.0.1 and 1.6.10 and debian-style 2:1.0.5+dfsg2-4 - VERSION_FILE := $(ARDUINO_DIR)/lib/version.txt - AUTO_ARDUINO_VERSION := $(shell [ -e $(VERSION_FILE) ] && cat $(VERSION_FILE) | sed -e 's/^[0-9]://g' -e 's/[.]//g' -e 's/\+.*//g' | head -c5) - ifdef AUTO_ARDUINO_VERSION - ARDUINO_VERSION = $(AUTO_ARDUINO_VERSION) - $(call show_config_variable,ARDUINO_VERSION,[AUTODETECTED]) - else - ARDUINO_VERSION = 100 - $(call show_config_variable,ARDUINO_VERSION,[DEFAULT]) - endif -else - $(call show_config_variable,ARDUINO_VERSION,[USER]) -endif - -######################################################################## -# 1.5.x architecture - avr or sam for arduino vendor -ifndef ARCHITECTURE - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1) - # default to avr for 1.5 - ARCHITECTURE = avr - ARDUINO_ARCH_FLAG = -DARDUINO_ARCH_AVR - else - # unset for 1.0 - ARCHITECTURE = - endif - $(call show_config_variable,ARCHITECTURE,[DEFAULT]) -else - $(call show_config_variable,ARCHITECTURE,[USER]) - - #avoid using shell for known architectures - ifeq ($(ARCHITECTURE),avr) - ARDUINO_ARCH_FLAG = -DARDUINO_ARCH_AVR - else - ifeq ($(ARCHITECTURE),sam) - ARDUINO_ARCH_FLAG = -DARDUINO_ARCH_SAM - else - ARDUINO_ARCH_FLAG = -DARDUINO_ARCH_$(shell echo $(ARCHITECTURE) | tr '[:lower:]' '[:upper:]') - endif - endif -endif - -######################################################################## -# 1.5.x vendor - defaults to arduino -ifndef ARDMK_VENDOR - ARDMK_VENDOR = arduino - $(call show_config_variable,ARDMK_VENDOR,[DEFAULT]) -else - $(call show_config_variable,ARDMK_VENDOR,[USER]) -endif - -######################################################################## -# Arduino Sketchbook folder - -ifndef ARDUINO_SKETCHBOOK - ifndef ARDUINO_PREFERENCES_PATH - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1) - AUTO_ARDUINO_PREFERENCES := $(firstword \ - $(call dir_if_exists,$(HOME)/.arduino15/preferences.txt) \ - $(call dir_if_exists,$(HOME)/Library/Arduino15/preferences.txt) ) - else - AUTO_ARDUINO_PREFERENCES := $(firstword \ - $(call dir_if_exists,$(HOME)/.arduino/preferences.txt) \ - $(call dir_if_exists,$(HOME)/Library/Arduino/preferences.txt) ) - endif - - ifdef AUTO_ARDUINO_PREFERENCES - ARDUINO_PREFERENCES_PATH = $(AUTO_ARDUINO_PREFERENCES) - $(call show_config_variable,ARDUINO_PREFERENCES_PATH,[AUTODETECTED]) - endif - - else - $(call show_config_variable,ARDUINO_PREFERENCES_PATH,[USER]) - endif - - ifneq ($(ARDUINO_PREFERENCES_PATH),) - ARDUINO_SKETCHBOOK := $(shell grep --max-count=1 --regexp='sketchbook.path=' \ - $(ARDUINO_PREFERENCES_PATH) | \ - sed -e 's/sketchbook.path=//' ) - endif - - ifneq ($(ARDUINO_SKETCHBOOK),) - $(call show_config_variable,ARDUINO_SKETCHBOOK,[AUTODETECTED],(from arduino preferences file)) - else - ARDUINO_SKETCHBOOK := $(firstword \ - $(call dir_if_exists,$(HOME)/sketchbook) \ - $(call dir_if_exists,$(HOME)/Documents/Arduino) ) - $(call show_config_variable,ARDUINO_SKETCHBOOK,[DEFAULT]) - endif -else - $(call show_config_variable,ARDUINO_SKETCHBOOK,[USER]) -endif - -######################################################################## -# Arduino and system paths - -ifndef CC_NAME -CC_NAME = avr-gcc -endif - -ifndef CXX_NAME -CXX_NAME = avr-g++ -endif - -ifndef OBJCOPY_NAME -OBJCOPY_NAME = avr-objcopy -endif - -ifndef OBJDUMP_NAME -OBJDUMP_NAME = avr-objdump -endif - -ifndef SIZE_NAME -SIZE_NAME = avr-size -endif - -ifndef NM_NAME -NM_NAME = avr-nm -endif - -ifndef AVR_TOOLS_DIR - - BUNDLED_AVR_TOOLS_DIR := $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/avr) - - ifdef BUNDLED_AVR_TOOLS_DIR - AVR_TOOLS_DIR = $(BUNDLED_AVR_TOOLS_DIR) - $(call show_config_variable,AVR_TOOLS_DIR,[BUNDLED],(in Arduino distribution)) - - # In Linux distribution of Arduino, the path to avrdude and avrdude.conf are different - # More details at https://github.com/sudar/Arduino-Makefile/issues/48 and - # https://groups.google.com/a/arduino.cc/d/msg/developers/D_m97jGr8Xs/uQTt28KO_8oJ - ifeq ($(CURRENT_OS),LINUX) - - ifndef AVRDUDE - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 157), 1) - # 1.5.8 has different location than all prior versions! - AVRDUDE = $(AVR_TOOLS_DIR)/bin/avrdude - else - AVRDUDE = $(AVR_TOOLS_DIR)/../avrdude - endif - endif - - ifndef AVRDUDE_CONF - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 157), 1) - AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf - else - AVRDUDE_CONF = $(AVR_TOOLS_DIR)/../avrdude.conf - endif - endif - - else - - ifndef AVRDUDE_CONF - AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf - endif - - endif - - else - - SYSTEMPATH_AVR_TOOLS_DIR := $(call dir_if_exists,$(abspath $(dir $(shell which $(CC_NAME)))/..)) - ifdef SYSTEMPATH_AVR_TOOLS_DIR - AVR_TOOLS_DIR = $(SYSTEMPATH_AVR_TOOLS_DIR) - $(call show_config_variable,AVR_TOOLS_DIR,[AUTODETECTED],(found in $$PATH)) - else - echo $(error No AVR tools directory found) - endif # SYSTEMPATH_AVR_TOOLS_DIR - - endif # BUNDLED_AVR_TOOLS_DIR - -else - $(call show_config_variable,AVR_TOOLS_DIR,[USER]) - - # ensure we can still find avrdude.conf - ifndef AVRDUDE_CONF - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 157), 1) - AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf - else - AVRDUDE_CONF = $(AVR_TOOLS_DIR)/../avrdude.conf - endif - endif - -endif #ndef AVR_TOOLS_DIR - -ifndef AVR_TOOLS_PATH - AVR_TOOLS_PATH = $(AVR_TOOLS_DIR)/bin -endif - -ifndef ARDUINO_LIB_PATH - ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries - $(call show_config_variable,ARDUINO_LIB_PATH,[COMPUTED],(from ARDUINO_DIR)) -else - $(call show_config_variable,ARDUINO_LIB_PATH,[USER]) -endif - -# 1.5.x platform dependent libs path -ifndef ARDUINO_PLATFORM_LIB_PATH - ifeq ($(shell expr $(ARDUINO_VERSION) '>' 150), 1) - # only for 1.5 - ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/libraries - $(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR)) - endif -else - $(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[USER]) -endif - -# Third party hardware and core like ATtiny or ATmega 16 -ifdef ALTERNATE_CORE - $(call show_config_variable,ALTERNATE_CORE,[USER]) - - ifndef ALTERNATE_CORE_PATH - ALTERNATE_CORE_PATH = $(ARDUINO_SKETCHBOOK)/hardware/$(ALTERNATE_CORE)/$(ARCHITECTURE) - endif -endif - -ifdef ALTERNATE_CORE_PATH - - ifdef ALTERNATE_CORE - $(call show_config_variable,ALTERNATE_CORE_PATH,[COMPUTED], (from ARDUINO_SKETCHBOOK and ALTERNATE_CORE)) - else - $(call show_config_variable,ALTERNATE_CORE_PATH,[USER]) - endif - - ifndef ARDUINO_VAR_PATH - ARDUINO_VAR_PATH = $(ALTERNATE_CORE_PATH)/variants - $(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH)) - endif - - ifndef BOARDS_TXT - BOARDS_TXT = $(ALTERNATE_CORE_PATH)/boards.txt - $(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ALTERNATE_CORE_PATH)) - endif - -else - - ifndef ARDUINO_VAR_PATH - ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/variants - $(call show_config_variable,ARDUINO_VAR_PATH,[COMPUTED],(from ARDUINO_DIR)) - else - $(call show_config_variable,ARDUINO_VAR_PATH,[USER]) - endif - - ifndef BOARDS_TXT - BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/boards.txt - $(call show_config_variable,BOARDS_TXT,[COMPUTED],(from ARDUINO_DIR)) - else - $(call show_config_variable,BOARDS_TXT,[USER]) - endif - -endif - -######################################################################## -# Miscellaneous - -ifndef USER_LIB_PATH - USER_LIB_PATH = $(ARDUINO_SKETCHBOOK)/libraries - $(call show_config_variable,USER_LIB_PATH,[DEFAULT],(in user sketchbook)) -else - $(call show_config_variable,USER_LIB_PATH,[USER]) -endif - -ifndef PRE_BUILD_HOOK - PRE_BUILD_HOOK = pre-build-hook.sh - $(call show_config_variable,PRE_BUILD_HOOK,[DEFAULT]) -else - $(call show_config_variable,PRE_BUILD_HOOK,[USER]) -endif - -######################################################################## -# boards.txt parsing - -ifdef BOARD_SUB - BOARD_SUB := $(strip $(BOARD_SUB)) - $(call show_config_variable,BOARD_SUB,[USER]) -endif - -ifndef BOARD_TAG - BOARD_TAG = uno - $(call show_config_variable,BOARD_TAG,[DEFAULT]) -else - # Strip the board tag of any extra whitespace, since it was causing the makefile to fail - # https://github.com/sudar/Arduino-Makefile/issues/57 - BOARD_TAG := $(strip $(BOARD_TAG)) - $(call show_config_variable,BOARD_TAG,[USER]) -endif - -ifndef PARSE_BOARD - # result = $(call READ_BOARD_TXT, 'boardname', 'parameter') - PARSE_BOARD = $(shell grep -Ev '^\#' $(BOARDS_TXT) | grep -E "^[ \t]*$(1).$(2)=" | cut -d = -f 2 | cut -d : -f 2) -endif - -# If NO_CORE is set, then we don't have to parse boards.txt file -# But the user might have to define MCU, F_CPU etc -ifeq ($(strip $(NO_CORE)),) - - # Select a core from the 'cores' directory. Two main values: 'arduino' or - # 'robot', but can also hold 'tiny', for example, if using - # https://code.google.com/p/arduino-tiny alternate core. - ifndef CORE - CORE = $(call PARSE_BOARD,$(BOARD_TAG),build.core) - $(call show_config_variable,CORE,[COMPUTED],(from build.core)) - else - $(call show_config_variable,CORE,[USER]) - endif - - # Which variant ? This affects the include path - ifndef VARIANT - VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.variant) - ifndef VARIANT - VARIANT := $(call PARSE_BOARD,$(BOARD_TAG),build.variant) - endif - $(call show_config_variable,VARIANT,[COMPUTED],(from build.variant)) - else - $(call show_config_variable,VARIANT,[USER]) - endif - - # see if we are a caterina device like leonardo or micro - CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.file)) - ifndef CATERINA - # 1.5+ method if not a submenu - CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.file)) - endif - ifndef CATERINA - # 1.0 method uses deprecated bootloader.path - CATERINA := $(findstring caterina,$(call PARSE_BOARD,$(BOARD_TAG),bootloader.path)) - endif - - # processor stuff - ifndef MCU - MCU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.mcu) - ifndef MCU - MCU := $(call PARSE_BOARD,$(BOARD_TAG),build.mcu) - endif - endif - - ifndef F_CPU - F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).build.f_cpu) - ifndef F_CPU - F_CPU := $(call PARSE_BOARD,$(BOARD_TAG),build.f_cpu) - endif - endif - - ifneq ($(CATERINA),) - # USB IDs for the caterina devices like leonardo or micro - ifndef USB_VID - USB_VID = $(call PARSE_BOARD,$(BOARD_TAG),build.vid) - endif - - ifndef USB_PID - USB_PID = $(call PARSE_BOARD,$(BOARD_TAG),build.pid) - endif - endif - - # normal programming info - ifndef AVRDUDE_ARD_PROGRAMMER - AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.protocol) - ifndef AVRDUDE_ARD_PROGRAMMER - AVRDUDE_ARD_PROGRAMMER := $(call PARSE_BOARD,$(BOARD_TAG),upload.protocol) - endif - endif - - ifndef AVRDUDE_ARD_BAUDRATE - AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.speed) - ifndef AVRDUDE_ARD_BAUDRATE - AVRDUDE_ARD_BAUDRATE := $(call PARSE_BOARD,$(BOARD_TAG),upload.speed) - endif - endif - - # fuses if you're using e.g. ISP - ifndef ISP_LOCK_FUSE_PRE - ISP_LOCK_FUSE_PRE = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.unlock_bits) - endif - - ifndef ISP_HIGH_FUSE - ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.high_fuses) - ifndef ISP_HIGH_FUSE - ISP_HIGH_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.high_fuses) - endif - endif - - ifndef ISP_LOW_FUSE - ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.low_fuses) - ifndef ISP_LOW_FUSE - ISP_LOW_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.low_fuses) - endif - endif - - ifndef ISP_EXT_FUSE - ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.extended_fuses) - ifndef ISP_EXT_FUSE - ISP_EXT_FUSE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.extended_fuses) - endif - endif - - ifndef BOOTLOADER_PATH - BOOTLOADER_PATH = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.path) - endif - - ifndef BOOTLOADER_FILE - BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).bootloader.file) - ifndef BOOTLOADER_FILE - BOOTLOADER_FILE := $(call PARSE_BOARD,$(BOARD_TAG),bootloader.file) - endif - endif - - ifndef ISP_LOCK_FUSE_POST - ISP_LOCK_FUSE_POST = $(call PARSE_BOARD,$(BOARD_TAG),bootloader.lock_bits) - endif - - ifndef HEX_MAXIMUM_SIZE - HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),menu.(chip|cpu).$(BOARD_SUB).upload.maximum_size) - ifndef HEX_MAXIMUM_SIZE - HEX_MAXIMUM_SIZE := $(call PARSE_BOARD,$(BOARD_TAG),upload.maximum_size) - endif - endif - -endif - -# Everything gets built in here (include BOARD_TAG now) -ifndef OBJDIR - OBJDIR = build-$(BOARD_TAG) - ifdef BOARD_SUB - OBJDIR = build-$(BOARD_TAG)-$(BOARD_SUB) - endif - $(call show_config_variable,OBJDIR,[COMPUTED],(from BOARD_TAG)) -else - $(call show_config_variable,OBJDIR,[USER]) -endif - -# Now that we have ARDUINO_DIR, ARDMK_VENDOR, ARCHITECTURE and CORE, -# we can set ARDUINO_CORE_PATH. -ifndef ARDUINO_CORE_PATH - ifeq ($(strip $(CORE)),) - ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/arduino - $(call show_config_variable,ARDUINO_CORE_PATH,[DEFAULT]) - else - ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(CORE) - ifeq ($(wildcard $(ARDUINO_CORE_PATH)),) - ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/cores/$(CORE) - $(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ARDUINO_DIR, BOARD_TAG and boards.txt)) - else - $(call show_config_variable,ARDUINO_CORE_PATH,[COMPUTED],(from ALTERNATE_CORE_PATH, BOARD_TAG and boards.txt)) - endif - endif -else - $(call show_config_variable,ARDUINO_CORE_PATH,[USER]) -endif - -######################################################################## -# Reset - -ifndef RESET_CMD - ARD_RESET_ARDUINO := $(shell which ard-reset-arduino 2> /dev/null) - ifndef ARD_RESET_ARDUINO - # same level as *.mk in bin directory when checked out from git - # or in $PATH when packaged - ARD_RESET_ARDUINO = $(ARDMK_DIR)/bin/ard-reset-arduino - endif - ifneq ($(CATERINA),) - ifneq (,$(findstring CYGWIN,$(shell uname -s))) - RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(DEVICE_PATH) - else - RESET_CMD = $(ARD_RESET_ARDUINO) --caterina $(ARD_RESET_OPTS) $(call get_monitor_port) - endif - else - ifneq (,$(findstring CYGWIN,$(shell uname -s))) - RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(DEVICE_PATH) - else - RESET_CMD = $(ARD_RESET_ARDUINO) $(ARD_RESET_OPTS) $(call get_monitor_port) - endif - endif -endif - -ifneq ($(CATERINA),) - ERROR_ON_CATERINA = $(error On $(BOARD_TAG), raw_xxx operation is not supported) -else - ERROR_ON_CATERINA = -endif - -######################################################################## -# Local sources - -LOCAL_C_SRCS ?= $(wildcard *.c) -LOCAL_CPP_SRCS ?= $(wildcard *.cpp) -LOCAL_CC_SRCS ?= $(wildcard *.cc) -LOCAL_PDE_SRCS ?= $(wildcard *.pde) -LOCAL_INO_SRCS ?= $(wildcard *.ino) -LOCAL_AS_SRCS ?= $(wildcard *.S) -LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \ - $(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \ - $(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS) -LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.c.o) $(LOCAL_CPP_SRCS:.cpp=.cpp.o) \ - $(LOCAL_CC_SRCS:.cc=.cc.o) $(LOCAL_PDE_SRCS:.pde=.pde.o) \ - $(LOCAL_INO_SRCS:.ino=.ino.o) $(LOCAL_AS_SRCS:.S=.S.o) -LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES)) - -ifeq ($(words $(LOCAL_SRCS)), 0) - $(error At least one source file (*.ino, *.pde, *.cpp, *c, *cc, *.S) is needed) -endif - -# CHK_SOURCES is used by flymake -# flymake creates a tmp file in the same directory as the file under edition -# we must skip the verification in this particular case -ifeq ($(strip $(CHK_SOURCES)),) - ifeq ($(strip $(NO_CORE)),) - - # Ideally, this should just check if there are more than one file - ifneq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) - ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 0) - $(call show_config_info,No .pde or .ino files found. If you are compiling .c or .cpp files then you need to explicitly include Arduino header files) - else - #TODO: Support more than one file. https://github.com/sudar/Arduino-Makefile/issues/49 - $(error Need exactly one .pde or .ino file. This makefile doesn't support multiple .ino/.pde files yet) - endif - endif - - endif -endif - -# core sources -ifeq ($(strip $(NO_CORE)),) - ifdef ARDUINO_CORE_PATH - CORE_C_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.c) - CORE_C_SRCS += $(wildcard $(ARDUINO_CORE_PATH)/avr-libc/*.c) - CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp) - CORE_AS_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.S) - - ifneq ($(strip $(NO_CORE_MAIN_CPP)),) - CORE_CPP_SRCS := $(filter-out %main.cpp, $(CORE_CPP_SRCS)) - $(call show_config_info,NO_CORE_MAIN_CPP set so core library will not include main.cpp,[MANUAL]) - endif - - CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.c.o) $(CORE_CPP_SRCS:.cpp=.cpp.o) $(CORE_AS_SRCS:.S=.S.o) - CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \ - $(OBJDIR)/core/%,$(CORE_OBJ_FILES)) - endif -else - $(call show_config_info,NO_CORE set so core library will not be built,[MANUAL]) -endif - - -######################################################################## -# Determine ARDUINO_LIBS automatically - -ifndef ARDUINO_LIBS - # automatically determine included libraries - ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_DIR)/libraries/*)), \ - $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS))) - ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), \ - $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS))) - ARDUINO_LIBS += $(filter $(notdir $(wildcard $(USER_LIB_PATH)/*)), \ - $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS))) - ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_PLATFORM_LIB_PATH)/*)), \ - $(shell sed -ne 's/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p' $(LOCAL_SRCS))) -endif - -######################################################################## -# Serial monitor (just a screen wrapper) - -# Quite how to construct the monitor command seems intimately tied -# to the command we're using (here screen). So, read the screen docs -# for more information (search for 'character special device'). - -ifeq ($(strip $(NO_CORE)),) - ifndef MONITOR_BAUDRATE - ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) - SPEED = $(shell egrep -h 'Serial.begin *\([0-9]+\)' $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS) | sed -e 's/[^0-9]//g'| head -n1) - MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200) - endif - - ifeq ($(MONITOR_BAUDRATE),) - MONITOR_BAUDRATE = 9600 - $(call show_config_variable,MONITOR_BAUDRATE,[ASSUMED]) - else - $(call show_config_variable,MONITOR_BAUDRATE,[DETECTED], (in sketch)) - endif - else - $(call show_config_variable,MONITOR_BAUDRATE, [USER]) - endif - - ifndef MONITOR_CMD - MONITOR_CMD = screen - endif -endif - -######################################################################## -# Include Arduino Header file - -ifndef ARDUINO_HEADER - # We should check for Arduino version, not just the file extension - # because, a .pde file can be used in Arduino 1.0 as well - ifeq ($(shell expr $(ARDUINO_VERSION) '<' 100), 1) - ARDUINO_HEADER=WProgram.h - else - ARDUINO_HEADER=Arduino.h - endif -endif - -######################################################################## -# Rules for making stuff - -# The name of the main targets -TARGET_HEX = $(OBJDIR)/$(TARGET).hex -TARGET_ELF = $(OBJDIR)/$(TARGET).elf -TARGET_EEP = $(OBJDIR)/$(TARGET).eep -CORE_LIB = $(OBJDIR)/libcore.a - -# Names of executables - chipKIT needs to override all to set paths to PIC32 -# tools, and we can't use "?=" assignment because these are already implicitly -# defined by Make (e.g. $(CC) == cc). -ifndef OVERRIDE_EXECUTABLES - CC = $(AVR_TOOLS_PATH)/$(CC_NAME) - CXX = $(AVR_TOOLS_PATH)/$(CXX_NAME) - AS = $(AVR_TOOLS_PATH)/$(AS_NAME) - OBJCOPY = $(AVR_TOOLS_PATH)/$(OBJCOPY_NAME) - OBJDUMP = $(AVR_TOOLS_PATH)/$(OBJDUMP_NAME) - AR = $(AVR_TOOLS_PATH)/$(AR_NAME) - SIZE = $(AVR_TOOLS_PATH)/$(SIZE_NAME) - NM = $(AVR_TOOLS_PATH)/$(NM_NAME) -endif - -REMOVE = rm -rf -MV = mv -f -CAT = cat -ECHO = printf -MKDIR = mkdir -p - -# recursive wildcard function, call with params: -# - start directory (finished with /) or empty string for current dir -# - glob pattern -# (taken from http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html) -rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) - -# functions used to determine various properties of library -# called with library path. Needed because of differences between library -# layouts in arduino 1.0.x and 1.5.x. -# Assuming new 1.5.x layout when there is "src" subdirectory in main directory -# and library.properties file - -# Gets include flags for library -get_library_includes = $(if $(and $(wildcard $(1)/src), $(wildcard $(1)/library.properties)), \ - -I$(1)/src, \ - $(addprefix -I,$(1) $(wildcard $(1)/utility))) - -# Gets all sources with given extension (param2) for library (path = param1) -# for old (1.0.x) layout looks in . and "utility" directories -# for new (1.5.x) layout looks in src and recursively its subdirectories -get_library_files = $(if $(and $(wildcard $(1)/src), $(wildcard $(1)/library.properties)), \ - $(call rwildcard,$(1)/src/,*.$(2)), \ - $(wildcard $(1)/*.$(2) $(1)/utility/*.$(2))) - -# General arguments -USER_LIBS := $(sort $(wildcard $(patsubst %,$(USER_LIB_PATH)/%,$(ARDUINO_LIBS)))) -USER_LIB_NAMES := $(patsubst $(USER_LIB_PATH)/%,%,$(USER_LIBS)) - -# Let user libraries override system ones. -SYS_LIBS := $(sort $(wildcard $(patsubst %,$(ARDUINO_LIB_PATH)/%,$(filter-out $(USER_LIB_NAMES),$(ARDUINO_LIBS))))) -SYS_LIB_NAMES := $(patsubst $(ARDUINO_LIB_PATH)/%,%,$(SYS_LIBS)) - -ifdef ARDUINO_PLATFORM_LIB_PATH - PLATFORM_LIBS := $(sort $(wildcard $(patsubst %,$(ARDUINO_PLATFORM_LIB_PATH)/%,$(filter-out $(USER_LIB_NAMES),$(ARDUINO_LIBS))))) - PLATFORM_LIB_NAMES := $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%,%,$(PLATFORM_LIBS)) -endif - - -# Error here if any are missing. -LIBS_NOT_FOUND = $(filter-out $(USER_LIB_NAMES) $(SYS_LIB_NAMES) $(PLATFORM_LIB_NAMES),$(ARDUINO_LIBS)) -ifneq (,$(strip $(LIBS_NOT_FOUND))) - ifdef ARDUINO_PLATFORM_LIB_PATH - $(error The following libraries specified in ARDUINO_LIBS could not be found (searched USER_LIB_PATH, ARDUINO_LIB_PATH and ARDUINO_PLATFORM_LIB_PATH): $(LIBS_NOT_FOUND)) - else - $(error The following libraries specified in ARDUINO_LIBS could not be found (searched USER_LIB_PATH and ARDUINO_LIB_PATH): $(LIBS_NOT_FOUND)) - endif -endif - -SYS_INCLUDES := $(foreach lib, $(SYS_LIBS), $(call get_library_includes,$(lib))) -USER_INCLUDES := $(foreach lib, $(USER_LIBS), $(call get_library_includes,$(lib))) -LIB_C_SRCS := $(foreach lib, $(SYS_LIBS), $(call get_library_files,$(lib),c)) -LIB_CPP_SRCS := $(foreach lib, $(SYS_LIBS), $(call get_library_files,$(lib),cpp)) -LIB_AS_SRCS := $(foreach lib, $(SYS_LIBS), $(call get_library_files,$(lib),S)) -USER_LIB_CPP_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),cpp)) -USER_LIB_C_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),c)) -USER_LIB_AS_SRCS := $(foreach lib, $(USER_LIBS), $(call get_library_files,$(lib),S)) -LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.c,$(OBJDIR)/libs/%.c.o,$(LIB_C_SRCS)) \ - $(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.cpp.o,$(LIB_CPP_SRCS)) \ - $(patsubst $(ARDUINO_LIB_PATH)/%.S,$(OBJDIR)/libs/%.S.o,$(LIB_AS_SRCS)) -USER_LIB_OBJS = $(patsubst $(USER_LIB_PATH)/%.cpp,$(OBJDIR)/userlibs/%.cpp.o,$(USER_LIB_CPP_SRCS)) \ - $(patsubst $(USER_LIB_PATH)/%.c,$(OBJDIR)/userlibs/%.c.o,$(USER_LIB_C_SRCS)) \ - $(patsubst $(USER_LIB_PATH)/%.S,$(OBJDIR)/userlibs/%.S.o,$(USER_LIB_AS_SRCS)) - -ifdef ARDUINO_PLATFORM_LIB_PATH - PLATFORM_INCLUDES := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_includes,$(lib))) - PLATFORM_LIB_CPP_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),cpp)) - PLATFORM_LIB_C_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),c)) - PLATFORM_LIB_AS_SRCS := $(foreach lib, $(PLATFORM_LIBS), $(call get_library_files,$(lib),S)) - PLATFORM_LIB_OBJS := $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp,$(OBJDIR)/platformlibs/%.cpp.o,$(PLATFORM_LIB_CPP_SRCS)) \ - $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.c,$(OBJDIR)/platformlibs/%.c.o,$(PLATFORM_LIB_C_SRCS)) \ - $(patsubst $(ARDUINO_PLATFORM_LIB_PATH)/%.S,$(OBJDIR)/platformlibs/%.S.o,$(PLATFORM_LIB_AS_SRCS)) - -endif - -# Dependency files -DEPS = $(LOCAL_OBJS:.o=.d) $(LIB_OBJS:.o=.d) $(PLATFORM_OBJS:.o=.d) $(USER_LIB_OBJS:.o=.d) $(CORE_OBJS:.o=.d) - -# Optimization level for the compiler. -# You can get the list of options at http://www.nongnu.org/avr-libc/user-manual/using_tools.html#gcc_optO -# Also read http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_optflags -ifndef OPTIMIZATION_LEVEL - OPTIMIZATION_LEVEL=s - $(call show_config_variable,OPTIMIZATION_LEVEL,[DEFAULT]) -else - $(call show_config_variable,OPTIMIZATION_LEVEL,[USER]) -endif - -ifndef DEBUG_FLAGS - DEBUG_FLAGS = -O0 -g -endif - -# SoftwareSerial requires -Os (some delays are tuned for this optimization level) -%SoftwareSerial.cpp.o : OPTIMIZATION_FLAGS = -Os - -ifndef MCU_FLAG_NAME - MCU_FLAG_NAME = mmcu - $(call show_config_variable,MCU_FLAG_NAME,[DEFAULT]) -else - $(call show_config_variable,MCU_FLAG_NAME,[USER]) -endif - -# Using += instead of =, so that CPPFLAGS can be set per sketch level -CPPFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) $(ARDUINO_ARCH_FLAG) -D__PROG_TYPES_COMPAT__ \ - -I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \ - $(SYS_INCLUDES) $(PLATFORM_INCLUDES) $(USER_INCLUDES) -Wall -ffunction-sections \ - -fdata-sections - -ifdef DEBUG -OPTIMIZATION_FLAGS= $(DEBUG_FLAGS) -else -OPTIMIZATION_FLAGS = -O$(OPTIMIZATION_LEVEL) -endif - -CPPFLAGS += $(OPTIMIZATION_FLAGS) - -# USB IDs for the Caterina devices like leonardo or micro -ifneq ($(CATERINA),) - CPPFLAGS += -DUSB_VID=$(USB_VID) -DUSB_PID=$(USB_PID) -endif - -# avr-gcc version that we can do maths on -CC_VERNUM = $(shell $(CC) -dumpversion | sed 's/\.//g') - -# moved from above so we can find version-dependant ar -ifndef AR_NAME - ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - AR_NAME = avr-gcc-ar - else - AR_NAME = avr-ar - endif -endif - -ifndef CFLAGS_STD - ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects - else - CFLAGS_STD = - endif - $(call show_config_variable,CFLAGS_STD,[DEFAULT]) -else - $(call show_config_variable,CFLAGS_STD,[USER]) -endif - -ifndef CXXFLAGS_STD - ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto - else - CXXFLAGS_STD = - endif - $(call show_config_variable,CXXFLAGS_STD,[DEFAULT]) -else - $(call show_config_variable,CXXFLAGS_STD,[USER]) -endif - -CFLAGS += $(CFLAGS_STD) -CXXFLAGS += -fpermissive -fno-exceptions $(CXXFLAGS_STD) -ASFLAGS += -x assembler-with-cpp -ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - ASFLAGS += -flto -endif -LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL) -ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1) - LDFLAGS += -flto -fuse-linker-plugin -endif -SIZEFLAGS ?= --mcu=$(MCU) -C - -# for backwards compatibility, grab ARDUINO_PORT if the user has it set -# instead of MONITOR_PORT -MONITOR_PORT ?= $(ARDUINO_PORT) - -ifneq ($(strip $(MONITOR_PORT)),) - ifeq ($(CURRENT_OS), WINDOWS) - # Expect MONITOR_PORT to be '1' or 'com1' for COM1 in Windows. Split it up - # into the two styles required: /dev/ttyS* for ard-reset-arduino and com* - # for avrdude. This also could work with /dev/com* device names and be more - # consistent, but the /dev/com* is not recommended by Cygwin and doesn't - # always show up. - COM_PORT_ID = $(subst com,,$(MONITOR_PORT)) - COM_STYLE_MONITOR_PORT = com$(COM_PORT_ID) - DEVICE_PATH = /dev/ttyS$(shell awk 'BEGIN{ print $(COM_PORT_ID) - 1 }') - else - # set DEVICE_PATH based on user-defined MONITOR_PORT or ARDUINO_PORT - DEVICE_PATH = $(MONITOR_PORT) - endif - $(call show_config_variable,DEVICE_PATH,[COMPUTED],(from MONITOR_PORT)) -else - # If no port is specified, try to guess it from wildcards. - # Will only work if the Arduino is the only/first device matched. - DEVICE_PATH = $(firstword $(wildcard \ - /dev/ttyACM? /dev/ttyUSB? /dev/tty.usbserial* /dev/tty.usbmodem* /dev/tty.wchusbserial*)) - $(call show_config_variable,DEVICE_PATH,[AUTODETECTED]) -endif - -ifndef FORCE_MONITOR_PORT - $(call show_config_variable,FORCE_MONITOR_PORT,[DEFAULT]) -else - $(call show_config_variable,FORCE_MONITOR_PORT,[USER]) -endif - -ifdef FORCE_MONITOR_PORT - # Skips the DEVICE_PATH existance check. - get_monitor_port = $(DEVICE_PATH) -else - # Returns the Arduino port (first wildcard expansion) if it exists, otherwise it errors. - ifeq ($(CURRENT_OS), WINDOWS) - get_monitor_port = $(COM_STYLE_MONITOR_PORT) - else - get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!)) - endif -endif - -# Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors. -get_isp_port = $(if $(wildcard $(ISP_PORT)),$(firstword $(wildcard $(ISP_PORT))),$(if $(findstring Xusb,X$(ISP_PORT)),$(ISP_PORT),$(error ISP port $(ISP_PORT) not found!))) - -# Command for avr_size: do $(call avr_size,elffile,hexfile) -ifneq (,$(findstring AVR,$(shell $(SIZE) --help))) - # We have a patched version of binutils that mentions AVR - pass the MCU - # and the elf to get nice output. - avr_size = $(SIZE) $(SIZEFLAGS) --format=avr $(1) - $(call show_config_info,Size utility: AVR-aware for enhanced output,[AUTODETECTED]) -else - # We have a plain-old binutils version - just give it the hex. - avr_size = $(SIZE) $(2) - $(call show_config_info,Size utility: Basic (not AVR-aware),[AUTODETECTED]) -endif - -ifneq (,$(strip $(ARDUINO_LIBS))) - $(call arduino_output,-) - $(call show_config_info,ARDUINO_LIBS =) -endif - -ifneq (,$(strip $(USER_LIB_NAMES))) - $(foreach lib,$(USER_LIB_NAMES),$(call show_config_info, $(lib),[USER])) -endif - -ifneq (,$(strip $(SYS_LIB_NAMES))) - $(foreach lib,$(SYS_LIB_NAMES),$(call show_config_info, $(lib),[SYSTEM])) -endif - -ifneq (,$(strip $(PLATFORM_LIB_NAMES))) - $(foreach lib,$(PLATFORM_LIB_NAMES),$(call show_config_info, $(lib),[PLATFORM])) -endif - -# either calculate parent dir from arduino dir, or user-defined path -ifndef BOOTLOADER_PARENT - BOOTLOADER_PARENT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/$(ARCHITECTURE)/bootloaders - $(call show_config_variable,BOOTLOADER_PARENT,[COMPUTED],(from ARDUINO_DIR)) -else - $(call show_config_variable,BOOTLOADER_PARENT,[USER]) -endif - -######################################################################## -# Tools version info -ARDMK_VERSION = 1.5 -$(call show_config_variable,ARDMK_VERSION,[COMPUTED]) - -CC_VERSION := $(shell $(CC) -dumpversion) -$(call show_config_variable,CC_VERSION,[COMPUTED],($(CC_NAME))) - -# end of config output -$(call show_separator) - -# Implicit rules for building everything (needed to get everything in -# the right directory) -# -# Rather than mess around with VPATH there are quasi-duplicate rules -# here for building e.g. a system C++ file and a local C++ -# file. Besides making things simpler now, this would also make it -# easy to change the build options in future - -# library sources -$(OBJDIR)/libs/%.c.o: $(ARDUINO_LIB_PATH)/%.c - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(OBJDIR)/libs/%.cpp.o: $(ARDUINO_LIB_PATH)/%.cpp - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/libs/%.S.o: $(ARDUINO_LIB_PATH)/%.S - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -$(OBJDIR)/platformlibs/%.c.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.c - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(OBJDIR)/platformlibs/%.cpp.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/platformlibs/%.S.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.S - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -$(OBJDIR)/userlibs/%.cpp.o: $(USER_LIB_PATH)/%.cpp - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/userlibs/%.c.o: $(USER_LIB_PATH)/%.c - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(OBJDIR)/userlibs/%.S.o: $(USER_LIB_PATH)/%.S - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -ifdef COMMON_DEPS - COMMON_DEPS := $(COMMON_DEPS) $(MAKEFILE_LIST) -else - COMMON_DEPS := $(MAKEFILE_LIST) -endif - -# normal local sources -$(OBJDIR)/%.c.o: %.c $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(OBJDIR)/%.cc.o: %.cc $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/%.cpp.o: %.cpp $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/%.S.o: %.S $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -$(OBJDIR)/%.s.o: %.s $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CC) -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -# the pde -> o file -$(OBJDIR)/%.pde.o: %.pde $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -# the ino -> o file -$(OBJDIR)/%.ino.o: %.ino $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -# generated assembly -$(OBJDIR)/%.s: %.pde $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/%.s: %.ino $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -x c++ -include $(ARDUINO_HEADER) -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/%.s: %.cpp $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -x c++ -MMD -S -fverbose-asm $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -# core files -$(OBJDIR)/core/%.c.o: $(ARDUINO_CORE_PATH)/%.c $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@ - -$(OBJDIR)/core/%.cpp.o: $(ARDUINO_CORE_PATH)/%.cpp $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ - -$(OBJDIR)/core/%.S.o: $(ARDUINO_CORE_PATH)/%.S $(COMMON_DEPS) | $(OBJDIR) - @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(ASFLAGS) $< -o $@ - -# various object conversions -$(OBJDIR)/%.hex: $(OBJDIR)/%.elf $(COMMON_DEPS) - @$(MKDIR) $(dir $@) - $(OBJCOPY) -O ihex -R .eeprom $< $@ - @$(ECHO) '\n' - $(call avr_size,$<,$@) -ifneq ($(strip $(HEX_MAXIMUM_SIZE)),) - @if [ `$(SIZE) $@ | awk 'FNR == 2 {print $$2}'` -le $(HEX_MAXIMUM_SIZE) ]; then touch $@.sizeok; fi -else - @$(ECHO) "Maximum flash memory of $(BOARD_TAG) is not specified. Make sure the size of $@ is less than $(BOARD_TAG)\'s flash memory" - @touch $@.sizeok -endif - -$(OBJDIR)/%.eep: $(OBJDIR)/%.elf $(COMMON_DEPS) - @$(MKDIR) $(dir $@) - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom='alloc,load' \ - --no-change-warnings --change-section-lma .eeprom=0 -O ihex $< $@ - -$(OBJDIR)/%.lss: $(OBJDIR)/%.elf $(COMMON_DEPS) - @$(MKDIR) $(dir $@) - $(OBJDUMP) -h --source --demangle --wide $< > $@ - -$(OBJDIR)/%.sym: $(OBJDIR)/%.elf $(COMMON_DEPS) - @$(MKDIR) $(dir $@) - $(NM) --size-sort --demangle --reverse-sort --line-numbers $< > $@ - -######################################################################## -# Avrdude - -# If avrdude is installed separately, it can find its own config file -ifndef AVRDUDE - AVRDUDE = $(AVR_TOOLS_PATH)/avrdude -endif - -# Default avrdude options -# -V Do not verify -# -q - suppress progress output -ifndef AVRDUDE_OPTS - AVRDUDE_OPTS = -q -V -endif - -# Decouple the mcu between the compiler options (-mmcu) and the avrdude options (-p). -# This is needed to be able to compile for attiny84a but specify the upload mcu as attiny84. -# We default to picking the -mmcu flag, but you can override this by setting -# AVRDUDE_MCU in your makefile. -ifndef AVRDUDE_MCU - AVRDUDE_MCU = $(MCU) -endif - -AVRDUDE_COM_OPTS = $(AVRDUDE_OPTS) -p $(AVRDUDE_MCU) -ifdef AVRDUDE_CONF - AVRDUDE_COM_OPTS += -C $(AVRDUDE_CONF) -endif - -# -D - Disable auto erase for flash memory -# Note: -D is needed for Mega boards. -# (See https://github.com/sudar/Arduino-Makefile/issues/114#issuecomment-25011005) -AVRDUDE_ARD_OPTS = -D -c $(AVRDUDE_ARD_PROGRAMMER) -b $(AVRDUDE_ARD_BAUDRATE) -P -ifeq ($(CURRENT_OS), WINDOWS) - # get_monitor_port checks to see if the monitor port exists, assuming it is - # a file. In Windows, avrdude needs the port in the format 'com1' which is - # not a file, so we have to add the COM-style port directly. - AVRDUDE_ARD_OPTS += $(COM_STYLE_MONITOR_PORT) -else - AVRDUDE_ARD_OPTS += $(call get_monitor_port) -endif - -ifndef ISP_PROG - ifneq ($(strip $(AVRDUDE_ARD_PROGRAMMER)),) - ISP_PROG = $(AVRDUDE_ARD_PROGRAMMER) - else - ISP_PROG = stk500v1 - endif -endif - -ifndef AVRDUDE_ISP_BAUDRATE - ifneq ($(strip $(AVRDUDE_ARD_BAUDRATE)),) - AVRDUDE_ISP_BAUDRATE = $(AVRDUDE_ARD_BAUDRATE) - else - AVRDUDE_ISP_BAUDRATE = 19200 - endif -endif - -# Fuse settings copied from Arduino IDE. -# https://github.com/arduino/Arduino/blob/master/app/src/processing/app/debug/AvrdudeUploader.java#L254 - -# Pre fuse settings -ifndef AVRDUDE_ISP_FUSES_PRE - ifneq ($(strip $(ISP_LOCK_FUSE_PRE)),) - AVRDUDE_ISP_FUSES_PRE += -U lock:w:$(ISP_LOCK_FUSE_PRE):m - endif - - ifneq ($(strip $(ISP_EXT_FUSE)),) - AVRDUDE_ISP_FUSES_PRE += -U efuse:w:$(ISP_EXT_FUSE):m - endif - - ifneq ($(strip $(ISP_HIGH_FUSE)),) - AVRDUDE_ISP_FUSES_PRE += -U hfuse:w:$(ISP_HIGH_FUSE):m - endif - - ifneq ($(strip $(ISP_LOW_FUSE)),) - AVRDUDE_ISP_FUSES_PRE += -U lfuse:w:$(ISP_LOW_FUSE):m - endif -endif - -# Bootloader file settings -ifndef AVRDUDE_ISP_BURN_BOOTLOADER - ifneq ($(strip $(BOOTLOADER_FILE)),) - AVRDUDE_ISP_BURN_BOOTLOADER += -U flash:w:$(BOOTLOADER_PARENT)/$(BOOTLOADER_PATH)/$(BOOTLOADER_FILE):i - endif -endif - -# Post fuse settings -ifndef AVRDUDE_ISP_FUSES_POST - ifneq ($(strip $(ISP_LOCK_FUSE_POST)),) - AVRDUDE_ISP_FUSES_POST += -U lock:w:$(ISP_LOCK_FUSE_POST):m - endif -endif - -# Note: setting -D to disable flash erase before programming may cause issues -# with some boards like attiny84a, making the program not "take", -# so we do not set it by default. -AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE) - -ifndef $(ISP_PORT) - ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio linuxgpio avrispmkii dragon_isp dragon_dw)) - AVRDUDE_ISP_OPTS += -P $(call get_isp_port) - endif -else - AVRDUDE_ISP_OPTS += -P $(call get_isp_port) -endif - -ifndef ISP_EEPROM - ISP_EEPROM = 0 -endif - -AVRDUDE_UPLOAD_HEX = -U flash:w:$(TARGET_HEX):i -AVRDUDE_UPLOAD_EEP = -U eeprom:w:$(TARGET_EEP):i -AVRDUDE_ISPLOAD_OPTS = $(AVRDUDE_UPLOAD_HEX) - -ifneq ($(ISP_EEPROM), 0) - AVRDUDE_ISPLOAD_OPTS += $(AVRDUDE_UPLOAD_EEP) -endif - -######################################################################## -# Explicit targets start here - -all: $(TARGET_EEP) $(TARGET_HEX) - -# Rule to create $(OBJDIR) automatically. All rules with recipes that -# create a file within it, but do not already depend on a file within it -# should depend on this rule. They should use a "order-only -# prerequisite" (e.g., put "| $(OBJDIR)" at the end of the prerequisite -# list) to prevent remaking the target when any file in the directory -# changes. -$(OBJDIR): pre-build - $(MKDIR) $(OBJDIR) - -pre-build: - $(call runscript_if_exists,$(PRE_BUILD_HOOK)) - -$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) - $(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) $(OTHER_LIBS) -lc -lm $(LINKER_SCRIPTS) - -$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS) - $(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS) - -error_on_caterina: - $(ERROR_ON_CATERINA) - - -# Use submake so we can guarantee the reset happens -# before the upload, even with make -j -upload: $(TARGET_HEX) verify_size - $(MAKE) reset - $(MAKE) do_upload - -raw_upload: $(TARGET_HEX) verify_size - $(MAKE) error_on_caterina - $(MAKE) do_upload - -do_upload: - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \ - $(AVRDUDE_UPLOAD_HEX) - -do_eeprom: $(TARGET_EEP) $(TARGET_HEX) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \ - $(AVRDUDE_UPLOAD_EEP) - -eeprom: $(TARGET_HEX) verify_size - $(MAKE) reset - $(MAKE) do_eeprom - -raw_eeprom: $(TARGET_HEX) verify_size - $(MAKE) error_on_caterina - $(MAKE) do_eeprom - -reset: - $(call arduino_output,Resetting Arduino...) - $(RESET_CMD) - -# stty on MacOS likes -F, but on Debian it likes -f redirecting -# stdin/out appears to work but generates a spurious error on MacOS at -# least. Perhaps it would be better to just do it in perl ? -reset_stty: - for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \ - do $$STTYF /dev/tty >/dev/null 2>&1 && break ; \ - done ; \ - $$STTYF $(call get_monitor_port) hupcl ; \ - (sleep 0.1 2>/dev/null || sleep 1) ; \ - $$STTYF $(call get_monitor_port) -hupcl - -ispload: $(TARGET_EEP) $(TARGET_HEX) verify_size - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) \ - $(AVRDUDE_ISPLOAD_OPTS) - -burn_bootloader: -ifneq ($(strip $(AVRDUDE_ISP_FUSES_PRE)),) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) -e $(AVRDUDE_ISP_FUSES_PRE) -endif -ifneq ($(strip $(AVRDUDE_ISP_BURN_BOOTLOADER)),) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) $(AVRDUDE_ISP_BURN_BOOTLOADER) -endif -ifneq ($(strip $(AVRDUDE_ISP_FUSES_POST)),) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) $(AVRDUDE_ISP_FUSES_POST) -endif - -set_fuses: -ifneq ($(strip $(AVRDUDE_ISP_FUSES_PRE)),) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) -e $(AVRDUDE_ISP_FUSES_PRE) -endif -ifneq ($(strip $(AVRDUDE_ISP_FUSES_POST)),) - $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ISP_OPTS) $(AVRDUDE_ISP_FUSES_POST) -endif - -clean:: - $(REMOVE) $(OBJDIR) - -size: $(TARGET_HEX) - $(call avr_size,$(TARGET_ELF),$(TARGET_HEX)) - -show_boards: - @$(CAT) $(BOARDS_TXT) | grep -E '^[a-zA-Z0-9_\-]+.name' | sort -uf | sed 's/.name=/:/' | column -s: -t - -show_submenu: - @$(CAT) $(BOARDS_TXT) | grep -E '[a-zA-Z0-9_\-]+.menu.(cpu|chip).[a-zA-Z0-9_\-]+=' | sort -uf | sed 's/.menu.\(cpu\|chip\)./:/' | sed 's/=/:/' | column -s: -t - -monitor: -ifeq ($(MONITOR_CMD), 'putty') - ifneq ($(strip $(MONITOR_PARAMS)),) - $(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE),$(MONITOR_PARAMS) $(call get_monitor_port) - else - $(MONITOR_CMD) -serial -sercfg $(MONITOR_BAUDRATE) $(call get_monitor_port) - endif -else ifeq ($(MONITOR_CMD), picocom) - $(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port) -else ifeq ($(MONITOR_CMD), cu) - $(MONITOR_CMD) -l $(call get_monitor_port) -s $(MONITOR_BAUDRATE) -else - $(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE) -endif - -disasm: $(OBJDIR)/$(TARGET).lss - @$(ECHO) "The compiled ELF file has been disassembled to $(OBJDIR)/$(TARGET).lss\n\n" - -symbol_sizes: $(OBJDIR)/$(TARGET).sym - @$(ECHO) "A symbol listing sorted by their size have been dumped to $(OBJDIR)/$(TARGET).sym\n\n" - -verify_size: -ifeq ($(strip $(HEX_MAXIMUM_SIZE)),) - @$(ECHO) "\nMaximum flash memory of $(BOARD_TAG) is not specified. Make sure the size of $(TARGET_HEX) is less than $(BOARD_TAG)\'s flash memory\n\n" -endif - @if [ ! -f $(TARGET_HEX).sizeok ]; then echo >&2 "\nThe size of the compiled binary file is greater than the $(BOARD_TAG)'s flash memory. \ -See http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it."; false; fi - -generate_assembly: $(OBJDIR)/$(TARGET).s - @$(ECHO) "Compiler-generated assembly for the main input source has been dumped to $(OBJDIR)/$(TARGET).s\n\n" - -generated_assembly: generate_assembly - @$(ECHO) "\"generated_assembly\" target is deprecated. Use \"generate_assembly\" target instead\n\n" - -help_vars: - @$(CAT) $(ARDMK_DIR)/arduino-mk-vars.md - -help: - @$(ECHO) "\nAvailable targets:\n\ - make - compile the code\n\ - make upload - upload\n\ - make ispload - upload using an ISP\n\ - make raw_upload - upload without first resetting\n\ - make eeprom - upload the eep file\n\ - make raw_eeprom - upload the eep file without first resetting\n\ - make clean - remove all our dependencies\n\ - make depends - update dependencies\n\ - make reset - reset the Arduino by tickling DTR or changing baud\n\ - rate on the serial port.\n\ - make show_boards - list all the boards defined in boards.txt\n\ - make show_submenu - list all board submenus defined in boards.txt\n\ - make monitor - connect to the Arduino's serial port\n\ - make size - show the size of the compiled output (relative to\n\ - resources, if you have a patched avr-size).\n\ - make verify_size - verify that the size of the final file is less than\n\ - the capacity of the micro controller.\n\ - make symbol_sizes - generate a .sym file containing symbols and their\n\ - sizes.\n\ - make disasm - generate a .lss file that contains disassembly\n\ - of the compiled file interspersed with your\n\ - original source code.\n\ - make generate_assembly - generate a .s file containing the compiler\n\ - generated assembly of the main sketch.\n\ - make burn_bootloader - burn bootloader and fuses\n\ - make set_fuses - set fuses without burning bootloader\n\ - make help_vars - print all variables that can be overridden\n\ - make help - show this help\n\ -" - @$(ECHO) "Please refer to $(ARDMK_DIR)/Arduino.mk for more details.\n" - -.PHONY: all upload raw_upload raw_eeprom error_on_caterina reset reset_stty ispload \ - clean depends size show_boards monitor disasm symbol_sizes generated_assembly \ - generate_assembly verify_size burn_bootloader help pre-build - -# added - in the beginning, so that we don't get an error if the file is not present --include $(DEPS) diff --git a/arduino/Arduino-Makefile/CONTRIBUTING.md b/arduino/Arduino-Makefile/CONTRIBUTING.md deleted file mode 100644 index ff63b49..0000000 --- a/arduino/Arduino-Makefile/CONTRIBUTING.md +++ /dev/null @@ -1,36 +0,0 @@ -# Contributing To Arduino Makefile - -Community made patches, localizations, bug reports, documentation and contributions are always welcome and are crucial to the success of this project. - -When contributing please ensure you follow the guidelines below so that we can keep on top of things. - -## Getting Started - -Submit a ticket for your issue, assuming one does not already exist. - -- Raise it on our [Issue Tracker](https://github.com/sudar/Arduino-Makefile/issues) -- Clearly describe the issue including steps to reproduce the bug. -- Make sure you fill in the earliest version that you know has the issue as well as the following - - Your operating system (Mac, Linux/Unix, Windows) - - Your Arduino IDE version - - Snippet of your makefile - -## Making Changes - -- Fork the repository on GitHub -- Make the changes to your forked repository -- Update the [changelog file](HISTORY.md) and add a note about your change. If possible prefix it with either Fix, Tweak or New -- If you are adding or changing the behavior of any variable, then update the corresponding documentation in the [arduino-mk-vars.md](arduino-mk-vars.md) file as well -- When committing, reference your issue (if present) and include a note about the fix - - If possible (and if makes sense) do atomic commits - - Try to follow [this guideline](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) while choosing the git commit message - - If it makes sense then add a unit test case for the changes that you are making -- Push the changes to your fork and submit a pull request to the 'master' branch of the this repository - -At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary. - -# Additional Resources - -- [General GitHub Documentation](http://help.github.com/) -- [GitHub Pull Request documentation](http://help.github.com/send-pull-requests/) -- [Guide about contributing code in GitHub](http://sudarmuthu.com/blog/contributing-to-project-hosted-in-github) diff --git a/arduino/Arduino-Makefile/Common.mk b/arduino/Arduino-Makefile/Common.mk deleted file mode 100644 index 7eda5ea..0000000 --- a/arduino/Arduino-Makefile/Common.mk +++ /dev/null @@ -1,87 +0,0 @@ -# Useful functions -# Returns the first argument (typically a directory), if the file or directory -# named by concatenating the first and optionally second argument -# (directory and optional filename) exists -dir_if_exists = $(if $(wildcard $(1)$(2)),$(1)) - -# Run a shell script if it exists. Stops make on error. -runscript_if_exists = \ - $(if $(wildcard $(1)), \ - $(if $(findstring 0, \ - $(lastword $(shell $(abspath $(wildcard $(1))); echo $$?))), \ - $(info Info: $(1) success), \ - $(error ERROR: $(1) failed))) - -# For message printing: pad the right side of the first argument with spaces to -# the number of bytes indicated by the second argument. -space_pad_to = $(shell echo $(1) " " | head -c$(2)) - -# Call with some text, and a prefix tag if desired (like [AUTODETECTED]), -show_config_info = $(call arduino_output,- $(call space_pad_to,$(2),20) $(1)) - -# Call with the name of the variable, a prefix tag if desired (like [AUTODETECTED]), -# and an explanation if desired (like (found in $$PATH) -show_config_variable = $(call show_config_info,$(1) = $($(1)) $(3),$(2)) - -# Just a nice simple visual separator -show_separator = $(call arduino_output,-------------------------) - -$(call show_separator) -$(call arduino_output,Arduino.mk Configuration:) - -######################################################################## -# -# Detect OS -ifeq ($(OS),Windows_NT) - CURRENT_OS = WINDOWS -else - UNAME_S := $(shell uname -s) - ifeq ($(UNAME_S),Linux) - CURRENT_OS = LINUX - endif - ifeq ($(UNAME_S),Darwin) - CURRENT_OS = MAC - endif -endif -$(call show_config_variable,CURRENT_OS,[AUTODETECTED]) - -######################################################################## -# -# Travis-CI -ifneq ($(TEST),) - DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies - - DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_DIR)/mpide-0023-linux64-20130817-test - ifeq ($(MPIDE_DIR),) - MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) - endif - - DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6 - ifeq ($(ARDUINO_DIR),) - ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) - endif -endif - -######################################################################## -# Arduino Directory - -ifndef ARDUINO_DIR - AUTO_ARDUINO_DIR := $(firstword \ - $(call dir_if_exists,/usr/share/arduino) \ - $(call dir_if_exists,/Applications/Arduino.app/Contents/Resources/Java) \ - $(call dir_if_exists,/Applications/Arduino.app/Contents/Java) ) - ifdef AUTO_ARDUINO_DIR - ARDUINO_DIR = $(AUTO_ARDUINO_DIR) - $(call show_config_variable,ARDUINO_DIR,[AUTODETECTED]) - else - echo $(error "ARDUINO_DIR is not defined") - endif -else - $(call show_config_variable,ARDUINO_DIR,[USER]) -endif - -ifeq ($(CURRENT_OS),WINDOWS) - ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) - echo $(error On Windows, ARDUINO_DIR must be a relative path) - endif -endif diff --git a/arduino/Arduino-Makefile/HISTORY.md b/arduino/Arduino-Makefile/HISTORY.md deleted file mode 100644 index 51d9d56..0000000 --- a/arduino/Arduino-Makefile/HISTORY.md +++ /dev/null @@ -1,323 +0,0 @@ -A Makefile for Arduino Sketches -=============================== - -The following is the rough list of changes that went into different versions. -I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list. - -### In Development -- Fix: Do not include the Arduino header when calling generate_assembly on .cpp files. (https://github.com/Batchyx) -- Fix: Auto-detect F_CPU on Teensy from boards.txt (https://github.com/DaWelter) -- Fix: params typo in PuTTY section (issue #487) (https://github.com/ericdand) -- Fix: Fixed sed expression to properly format show_submenu (issue #488) (https://github.com/cbosdo) -- New: Add support for good old cu as monitor command (issue #492) (https://github.com/mwm) - -### 1.5.2 (2017-01-11) - -- New: Add LTO support for users with avr-gcc > 4.9 (issue #446 & #456) (https://github.com/sej7278) -- Tweak: Updated Linux instructions and sync documentation from the old blog(), README.md and Arduino.mk (https://github.com/az-z) -- Tweak: Documentation for Windows updated to include installation of PySerial (https://github.com/sovcik) -- Fix: Updated CXXFLAGS_STD to match upstream 1.6 (issue #424) (https://github.com/calvinli) -- Fix: Added support for attiny core's use of chip instead of cpu in submenus (https://github.com/straccio) -- Fix: ARDUINO_VERSION can cope with the longer 1.6.10 version string (issue #444) (https://github.com/sej7278) -- Fix: Changed PARSE_BOARD to handle colons in e.g. CORE or VARIANT (issue #461) (https://github.com/sej7278) -- Fix: Changed Teensy.mk to support Arduino 1.6.12 and Teensyduino 1.30 (issues #383 , #431) (https://github.com/georgeharker) - -### 1.5.1 (Debian version: 1.5-3) (2016-02-22) - -- New: Add show_submenu target (https://github.com/drewhutchison) -- New: Add AVR Dragon to list of ISP's without a port (https://github.com/mtnocean) -- New: Add more board examples to Blink demo (https://github.com/sej7278) -- New: Add option to split avrdude MCU from avr-gcc MCU (Issue #357) (https://github.com/hhgarnes) -- New: Add support for /dev/tty.wchusbserial* (comes with cheap clones - DCCduino) (https://github.com/biesiad) -- New: Add support for picocom as serial monitor (https://github.com/biesiad) -- Tweak: Add support for Adafruit trinket3/trinket5/protrinket3/protrinket5 by improved BOARDS_TXT parsing (Issue #393) (https://github/com/zabereer) -- Tweak: Looks for submenu items first when parsing BOARDS_TXT (Issue #347) (https://github.com/sej7278) -- Tweak: Various spelling/grammar/typo fixes (https://github.com/dcousens) -- Tweak: Clarified some 1.5+ issues in docs (Issue #352) (https://github.com/sej7278) -- Tweak: Added some more Continuous Integration tests (https://github.com/sej7278) -- Tweak: Updated Fedora instructions (https://github.com/sej7278) -- Fix: Preserve original extension for object files, support asm sources in core, fixes pulseInASM (Issue #255, #364) (https://github.com/sej7278) -- Fix: Make sure TARGET is set correctly when CURDIR contains spaces (https://github.com/svendahlstrand) -- Fix: Ensure AVRDUDE_CONF is set when AVR_TOOLS_DIR is, not just on Windows (Issue #381) (https://github.com/sej7278) -- Fix: Rename VENDOR to ARDMK_VENDOR to workaround tcsh issue (Issue #386) (https://github.com/sej7278) -- Fix: Document OSX 1.0/1.6 ARDUINO_DIR differences (https://github.com/thomaskilian) -- Fix: Fix regex to support BOARD_TAGs with hyphens e.g. attiny44-20 (https://github.com/sej7278) -- Fix: Remove check for BOOTLOADER_PATH, just check for BOOTLOADER_FILE (Issue #402) (https://github.com/sej7278) -- Fix: Port ard-reset-arduino to pyserial 3.0 (#407, #408) (https://github.com/gauteh) - -### 1.5 (2015-04-07) -- New: Add support for new 1.5.x library layout (Issue #275) (https://github.com/lukasz-e) -- New: Add support for 1.5.x vendor/hardware architecture library location (Issue #276) (https://github.com/lukasz-e) -- New: Added test suite and integration with travis CI. (https://github.com/peplin) -- New: Add information about `Bare-Arduino–Project` in README. (https://github.com/ladislas) -- New: Add information about reporting bugs to the correct project (Issue #231). (https://github.com/sej7278) -- New: Add documentation about CFLAGS_STD and CXXFLAGS_STD (Issue #234) (https://github.com/ladislas) -- New: Allow "make clean" target to be extended (Issue #239). (https://github.com/sej7278) -- New: Add makefile and gcc version info to config output. (https://github.com/sej7278) -- New: Support for Teensy 3.x (https://github.com/stepcut) -- New: Support for PuTTY under Windows (https://github.com/PeterMosmans) -- New: Add support for installation using homebrew(https://github.com/ladislas) -- New: Add support and example for flashing on a remote RPi. (https://github.com/Gaboose) -- Tweak: Update Makefile-example.mk with STD flags (https://github.com/ladislas) -- Tweak: Allow remove of any OBJDIR with `$(REMOVE) $(OBJDIR)`. (https://github.com/ladislas) -- Tweak: Add cpp to extensions supported by "make generate_assembly". (https://github.com/sej7278) -- Tweak: Update travis-ci to test against Arduino 1.0.6. (https://github.com/sej7278) -- Tweak: Updated package instructions for Arch/Fedora/Raspbian. (https://github.com/sej7278) -- Tweak: Remove $(EXTRA_XXX) variables (Issue #234) (https://github.com/ladislas) -- Tweak: Moved location of avrdude for 1.5.8 on Linux (Issue #301) (https://github.com/sej7278) -- Tweak: Allow 'build.core' param as found in [arduino-tiny](https://code.google.com/p/arduino-tiny/) Prospective Boards.txt. (https://github.com/Gaboose) -- Tweak: Replace CXX_NAME with CXX as per the Emacs Flymake Wiki (Issue #309) (https://github.com/sej7278) -- Tweak: Ability to override `USB_TYPE` in Teensy.md (Issue #313) (https://github.com/Poofjunior) -- Tweak: Integration instructions for CodeBlocks IDE (Issue #321) (https://github.com/fbielejec) -- Tweak: Add BOARD_SUB to OBJDIR if defined in 1.5+ (https://github.com/sej7278) -- Tweak: Add = to PARSE_BOARD regex to make it less greedy and not match vid.0, vid.1 and vid (https://github.com/sej7278) -- Tweak: Added note about clock submenu's being used as F_CPU (https://github.com/sej7278) -- Tweak: Better autodetection of ARDUINO_SKETCHBOOK and ARDUINO_DIR on OSX (https://github.com/sej7278) -- Fix: Improved Windows (Cygwin/MSYS) support (https://github.com/PeterMosmans) -- Fix: Change "tinyladi" username to "ladislas" in HISTORY.md. (https://github.com/ladislas) -- Fix: Make avr-g++ use CXXFLAGS instead of CFLAGS. (https://github.com/sej7278) -- Fix: Allow the use of CFLAGS_STD and CXXFLAGS_STD and set defaults (Issue #234) (https://github.com/ladislas) -- Fix: Update "make show_boards" regex to work with the Due in 1.5. (https://github.com/sej7278) -- Fix: Allow user libaries/sketches to have the same name as system libs. (Issue #244, #229). (https://github.com/sej7278) -- Fix: Remove impact of travis-ci from regular users. (Issue #258). (https://github.com/sej7278) -- Fix: objcopy quoting issue on Windows. (Issue #272). (https://github.com/sej7278) -- Fix: Add "avrispmkii" to the list of isp that don't have a port. (Issue #279). (https://github.com/sej7278) -- Fix: Make CXX compile .cpp files instead of CC. (Issue #285). (https://github.com/sej7278) -- Fix: Changed IDE download URL *again* for Travis-CI. (https://github.com/sej7278) -- Fix: Allow avrdude to erase the chip before programming during ispload (https://github.com/tchebb) -- Fix: Fix speed regression. Thanks ladislas (Issue #280) (https://github.com/sej7278) -- Fix: Removed some double quotes that were breaking variable expansion. (https://github.com/sej7278) -- Fix: Fixed PLATFORM_LIB support for 1.5+ and removed duplicate libs (https://github.com/sej7278) -- Fix: Added ARCHITECTURE to ALTERNATE_CORE_PATH to support 1.5+ cores like arduino-tiny (https://github.com/sej7278) -- Fix: Can now find IDE 1.5+ preferences.txt on Linux and Mac (https://github.com/sej7278) -- Fix: Added support for VARIANT being a submenu item in 1.6 cores like attiny (https://github.com/sej7278) -- Fix: Replaced copyright symbol causing sed problems on OSX (Issue #335). (https://github.com/sej7278) -- Fix: Fix issues with resetting Leonardo and Micro boards(Issue #340) (https://github.com/calvinli) - -### 1.3.4 (2014-07-12) -- Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav) -- Add: Add support for compiling assembler code. (Issue #195) (https://github.com/hrobeers) -- Add: Try to guess port from wildcards if not specified. (Issue #197) (https://github.com/tuzz) -- Fix: Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. (Issue #201 and #202) (https://github.com/sej7278) -- Add: List board name as well as tag in `make show_boards`. (Issue #204) (https://github.com/sej7278) -- Fix: Add missing newlines at end of some echo's (Issue #207) (https://github.com/sej7278) -- Fix: Add missing/reorder/reword targets in `make help` (https://github.com/sej7278) -- New: Arduino.mk is now compatible with Flymake mode (https://github.com/rbarzic) -- Fix: MONITOR_PORT detection (Issue #213, #215) (https://github.com/sej7278) -- Tweak: Audited regexes/quoting/wildcards (Issue #192) (https://github.com/sej7278) -- New: Build core objects in subdirectory (Issue #82) (https://github.com/sej7278) - -### 1.3.3 (2014-04-12) -- Fix: Make a new manpage for ard-reset-arduino. Fixes issue #188 (https://github.com/sej7278) - -### 1.3.2 (2014-04-11) -- Fix: Add arduino-mk-vars.md file to RPM SPECfile. (https://github.com/sej7278) -- Fix: Add avr-libc/malloc.c and realloc.c to included core files. Fixes issue #163 (https://github.com/sej7278) -- Fix: Add "gpio" to the list of isp that don't have a port. (Issue #165, #166) (https://github.com/sej7278) -- Fix: Add "-D__PROG_TYPES_COMPAT__" to the avr-g++ compiler flags to match IDE. (https://github.com/sej7278) -- New: Create `Makefile-example-mk`, a *real life* `Makefile` example, to be used as a reference. (https://github.com/ladislas) -- Tweak: Add `OBJDIR` to `arduino-mk-vars.md` (https://github.com/ladislas) -- Tweak: *Beautify* `arduino-mk-vars.md` with code blocks. (https://github.com/ladislas) -- Fix: AVR tools paths for chipKIT in Linux. (https://github.com/peplin) -- Fix: Consider usb or usb:... to be a valid ISP_PORT (https://github.com/geoffholden) -- Add: Add phony target to run pre-build hook script (https://github.com/jrid) -- Fix: Add BOOTLOADER_PARENT to `arduino-mk-vars.md` and fixed BOOTLOADER_PATH example. (https://github.com/sej7278) -- Tweak: Replace perl reset script with Python script. (https://github.com/sej7278) -- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin) -- Tweak: Simplified packaging dependencies. (https://github.com/sej7278) -- Tweak: Tweak AVRDUDE conf detection in windows. (https://github.com/EAGMnor) - -### 1.3.1 (2014-02-04) -- Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278) -- New: Document all variables that can be overridden. (https://github.com/sej7278) -- New: Add a new `help_vars` target to display information about variables that can be overridden. - -### 1.3.0 (2014-01-29) -- Fix: Use more reliable serial device naming in Windows. Fix issue #139 and #155 (https://github.com/peplin) -- Fix: Document that ARDUINO_DIR must be a relative path in Windows. Fix issue #156 (https://github.com/peplin) -- Tweak: Don't hard code MONITOR_PORT in examples, for more flexible testing. (Issue #157) (https://github.com/peplin) -- Tweak: Silence the stderr output from call to `which`. (Issue #158) (https://github.com/peplin) -- Fix: Override complete compiler tool paths for chipKIT. (Issue #159) (https://github.com/peplin) -- New: The makefile is compatible with Windows -- New: Update `README.md` file about usage and Windows compatibility - -### 1.2.0 (2014-01-14) -- Add: Add RPM SPECfile and new `package` directory to store package instructions and files (https://github.com/sej7278) -- Fix: Remove use of arduino-mk subdirectory in git. Fix issue #151, #152 and #147 (https://github.com/sej7278) -- Fix: Remove `arduino-mk` directory from all examples. Fix #154 - -### 1.1.0 (2013-12-26) -- Don't append port details to avrdude for usbasp. See #123 -- Ignore commented lines while parsing boards.txt file. See #124 -- In ISP mode, read baudrate and programmer from boards.txt. See #125 -- Add `burn_bootloader` target. See #85 -- Show correct path to `arduino.mk` file in help message. Fix #120 -- Change echo for printf. Fix #129 (https://github.com/thomassigurdsen) -- Add support for ChipKiT 2013. Fix #136 (https://github.com/peplin) -- Auto detect and include libraries specified in `USER_LIB_PATH`. Fix #135 (https://github.com/ladislas) -- Use `MAKEFILE_LIST` to get the name of the make file. Fix #130 (https://github.com/cantora) -- New: Add option to set fuses without burning a bootloader. Fix #141 (https://github.com/sej7278) -- Tweak: Don't append port details to avrdude for usbtiny. Fix #140 and #138 (https://github.com/PPvG) -- Fix: Handle relative paths of bootloader file while burning bootloaders. Fix #126 and #142 (https://github.com/sej7278) -- New: Add `CONTRIBUTING.md` explaining how to contribute to the project. -- New: Force -Os optimization for SoftwareSerial. Add `OPTIMIZATION_FLAGS` and `DEBUG_FLAGS`. (https://github.com/mahoy) -- Fix: Use `ARDUINO_HEADER` variable instead of hardcoded file names. Fix #131 - -### 1.0.1 (2013-09-25) -- Unconditionally add -D in avrdude options. See #114 - -### 1.0.0 (2013-09-22) -- Add $OBJDIR to the list of configuration that gets printed. Fix issue #77 -- Add support for specifying optimization level. Fix issue #81 -- Add support for reseting "Micro" Arduino. Fix issue #80 (https://github.com/sej7278) -- Remove "utility" from example makefiles. Fix issue #84 -- Auto detect alternate core path from sketchbook folder. Fix issue #86 -- Remove redundant checks for ARDUINO_DIR -- Improve avrdude and avrdude.conf path auto detection. Fix issue #48 -- Move binary sketch size verification logic inside makefile. Fix issue #54 -- Remove dependency on wait-connection-leonardo shell script. Fix issue #95 -- Add support for the Digilent chipKIT platform. (https://github.com/peplin) -- Implement ard-parse-boards with shell scripting instead of Perl (https://github.com/peplin) -- Compile with debugging symbols only when DEBUG=1 (https://github.com/peplin) -- Replace Leonardo detection with Caterina detection (https://github.com/sej7278) -- Autodetect baudrate only if either a .ino/.pde is present -- Allow building with Arduino core, without a .ino/.pde file -- Ability to support different Arduino cores (https://github.com/sej7278) - -### 0.12.0 (2013-06-20) -- Fix "generated_assembly" target, which got broken earlier. Fix issue #76 (https://github.com/matthijskooijman) -- Deprecate "generated_assembly" target in favour of "generate_assembly". Fix issue #79 - -### 0.11.0 (2013-06-15) -- Replace hardcoded executables with variable -- Fix whitespace issues -- Add a warning when HEX_MAXIMUM_SIZE is not specified -- Add the ability to configure avrdude options. Fix issue #53 -- Handle cases where certain fuse bits are not present. Fix issue #61 -- Add support for compiling plain AVR C files. Fix issue #63 -- Add an example to show how to compile AVR C files. Fix issue #73 - -### 0.10.6 (2013-06-14) -- Fix whitespace and add /dev/null redirection (https://github.com/sej7278) -- Change the way AUTO_ARDUINO_VERSION is computed (https://github.com/sej7278) -- Make serial monitor baudrate detection work in Mac as well(https://github.com/sej7278) -- Fix directory creation for library source files (https://github.com/matthijskooijman) -- Rewrite ard-leonardo-reset script in perl (https://github.com/sej7278) - -### 0.10.5 (2013-06-11) -- Add USB_VID and USB_PID to CPPFLAGS only if the board is Leonardo. -- Allow adding extra common dependencies (COMMON_DEPS) (https://github.com/gaftech) -- Added ifndef ARDUINO_VAR_PATH for compiling for the attiny (https://github.com/danielesteban) -- Strip extra whitespace from the `BOARD_TAG` variable -- Enhanced support for programming using Arduino as ISP -- Added example to show how to program using Arduino as ISP -- Add support for Leonardo boards. Took code from (https://github.com/guicho271828) - -### 0.10.4 (2013-05-31) @matthijskooijman -- Improved BAUD_RATE detection logic -- Added logic to check if there is only .ino or .pde file -- Compile .ino/.pde files directly -- Output configuration only once -- Try to read Version.txt file only if it is present -- Refactored dependency code - -### 0.10.3 16.xii 2012 gaftech -- Enabling creation of EEPROM file (.eep) -- EEPROM upload: eeprom and raw_eeprom targets -- Auto EEPROM upload with isp mode: ISP_EEPROM option. -- Allow custom OBJDIR - -### 0.10.2 15.xii.2012 Sudar -- Added sketch size verification. (https://github.com/fornellas) -- Show original line number for error messages (https://github.com/WizenedEE) -- Removed -w from CPPFLAGS to show warnings (https://github.com/gaftech) -- Changed shebang to use /usr/bin/env (https://github.com/anm) -- set USB_VID and USB_PID only for leonardo boards(https://github.com/alohr) -- Updated Readme (https://github.com/fr0sty1/) - -### 0.10.1 15.xii.2012 Sudar -- Merged all changes from Upstream and the following changes from https://github.com/rpavlik -- Allow passing extra flags -- Make listing files more useful -- Add knowledge of device-specific assembler -- Use variables instead of hardcoded commands -- Make disasm more helpful -- Change .sym output -- Provide symbol_sizes and generated_assembly targets. -- Be able to silence configuration output -- Make everybody depend on the makefile, in case cflags are changed, etc. -- Make the makefile error if the arduino port is not present. - -### 0.10 17.ix.12 M J Oldfield -- Added installation notes for Fedora (ex Rickard Lindberg). -- Changed size target so that it looks at the ELF object, - not the hexfile (ex Jared Szechy and Scott Howard). -- Fixed ARDUNIO typo in README.md (ex Kalin Kozhuharov). -- Tweaked OBJDIR handling (ex Matthias Urlichs and Scott Howard). -- Changed the name of the Debian/Ubuntu package (ex - Scott Howard). -- Only set AVRDUDE_CONF if it's not set (ex Tom Hall). -- Added support for USB_PID/VID used by the Leonardo (ex Dan - Villiom Podlaski Christiansen and Marc Plano-Lesay). - -### 0.9.3.2 10.ix.2012 Sudar -- Fixed a typo in README. Issue reported at upstream (https://github.com/mjoldfield/Arduino-Makefile/issues/21) - -### 0.9.3.1 18.viii.2012 jeffkowalski - -- Autodetect ARDUINO_LIBS from includes in LOCAL_SRCS -- Autodetect ARDUINO_SKETCHBOOK from file set by Arduino IDE -- Autodetect ARDMK_DIR based on location of this file -- Added support for utility directory within SYS and USER libraries - -### 0.9.3 13.vi.2012 - -- Auto detect ARDUINO_DIR, Arduino version (https://github.com/rpavlik/) -- Categorize libs into user and system (https://github.com/rpavlik/) -- Dump size at the end of the build (https://github.com/rpavlik/) -- Lots and lots of improvements (https://github.com/rpavlik/) -- Changed bytes option for the head shell command, so that it works in Mac as well -- Auto detect Serial Baud rate from sketch if possible - -### 0.9.2 06.vi.2012 - -- Allow user to choose source files (LOCAL_*_SRCS flags) (https://github.com/Gaftech) -- Modified "make size" behavior: using --mcu option and targeting .elf file instead of .hex file.(https://github.com/Gaftech) - -### 0.9.1 06.vi.2012 - -- Corrected the ubuntu package names -- Prevent the *file-not-found* error if the depends.mk file is not needed -- Delete the build-cli folder as well while doing make clean -- Added support for compiling .pde files in Arduino 1.0 environment -- Replaced = with += in CPPFLAGS assignment so that we can set CPPFLAGS per sketch if needed -- Changed AVRDUDE_CONF so it can be defined in per-project makefile (https://github.com/WizenedEE) -- Cleaner way to delete the build-cli directory when make clean is invoked -- The package name in Debian and Ubuntu is arduino-mk (https://github.com/maqifrnswa) - -### 2012-02-12, version 0.8 -- Patches for version 1.0 of the Arduino IDE. Older versions might still work, but I’ve not tested it. -- A change to the build process: rather than link all the system objects directly into the executable, bundle them in a library first. This should make the final executable smaller. -- If TARGET isn’t explicitly set, default to the current directory name. Thanks to Daniele Vergini for this patch. -- Add support for .c files in system libraries: Dirk-Willem van Gulik and Evan Goldenberg both reported this and provided patches in the same spirit. -- Added a size target as suggested by Alex Satrapa. - -### Unreleased, version 0.7 -- Added -lm to the linker options, and -F to stty. - -### 2011-06-23, version 0.6 -- Added ard-parse-boards. Mark Sproul suggested doing something like this ages ago, but I’ve only recently looked at it in detail. -- Fabien Le Lez reported that one needs to link with -lc to avoid [linker errors](http://forum.arduino.cc/index.php/topic,40215.0.html). - -### 2011-06-23, version 0.5 -- Imported changes from Debian/Ubuntu, which incorporate a patch from Stefan Tomanek so that libraries would be compiled too. - -Note: Many other people sent me similar patches, but I didn't get around to using them. In the end, I took the patch from Debian and Ubuntu: there seems merit in not forking the code and using a tested version. So, thanks and apologies to Nick Andrew, Leandro Coletto Biazon, Thibaud Chupin, Craig Hollabaugh, Johannes H. Jensen, Fabien Le Lez, Craig Leres, and Mark Sproul. - -### 2010-05-24, version 0.4 -Tweaked rules for the reset target on Philip Hands’ advice. - -### 2010-05-21, version 0.3 -- Tidied up the licensing, making it clear that it’s released under LGPL 2.1. -- [Philip Hands](http://hands.com/~phil/) sent me some code to reset the Arduino by dropping DTR for 100ms, and I added it. -- Tweaked the Makefile to handle version 0018 of the Arduino software which now includes main.cpp. Accordingly we don’t need to—and indeed must not—add main.cxx to the .pde sketch file. The paths seem to have changed a bit too. diff --git a/arduino/Arduino-Makefile/README.md b/arduino/Arduino-Makefile/README.md deleted file mode 100644 index 1947c6e..0000000 --- a/arduino/Arduino-Makefile/README.md +++ /dev/null @@ -1,415 +0,0 @@ -# A Makefile for Arduino Sketches [![Build Status](https://travis-ci.org/sudar/Arduino-Makefile.svg)](https://travis-ci.org/sudar/Arduino-Makefile) - -This is a very simple Makefile which knows how to build Arduino sketches. It defines entire workflows for compiling code, flashing it to Arduino and even communicating through Serial monitor. You don't need to change anything in the Arduino sketches. - -## Features - -- Very robust -- Highly customizable -- Supports all official AVR-based Arduino boards -- Supports chipKIT -- Supports Teensy 3.x (via Teensyduino) -- Works on all three major OS (Mac, Linux, Windows) -- Auto detects serial baud rate and libraries used -- Support for `*.ino` and `*.pde` sketches as well as raw `*.c` and `*.cpp` -- Support for Arduino Software versions 0.x, 1.0.x, 1.5.x and 1.6.x except 1.6.2. -We recommend 1.6.3 or above version of Arduino IDE. -- Automatic dependency tracking. Referred libraries are automatically included -in the build process. Changes in `*.h` files lead to recompilation of sources which include them - -## Installation - -### Through package - -#### Using apt-get (or aptitude) - -If you're using FreeBSD, Debian, Raspbian or Ubuntu, you can find this in the `arduino-mk` -package which can be installed using `apt-get` or `aptitude`. - -```sh -sudo apt-get install arduino-mk -``` - -#### homebrew (or linuxbrew) - -If you're using homebrew (or [linuxbrew](https://github.com/Homebrew/linuxbrew)) then you can find this in the -`arduino-mk` package which can be installed using the following commands. - -Also make sure you have the necessary dependencies installed. Refer to the [Requirements](#requirements) section below to install the dependencies. - -```sh -# add tap -$ brew tap sudar/arduino-mk - -# to install the last stable release -$ brew install arduino-mk - -# to install the development version -$ brew install --HEAD arduino-mk -``` - -#### Arch Linux - -Arch Linux users can use the unofficial AUR package [arduino-mk](https://aur.archlinux.org/packages/arduino-mk/). -It can be installed using the following command. - -```sh -yaourt -S arduino-mk -``` - -#### Fedora - -Fedora Linux users can use our packaging instructions [here](https://github.com/sudar/Arduino-Makefile/tree/master/packaging/fedora) -to build an RPM. - -### From source - -- Download the latest release -- Or clone it from Github using the command `git clone git@github.com:sudar/Arduino-Makefile.git` -- Check the [usage section](https://github.com/sudar/Arduino-Makefile#usage) in this readme about setting usage options - -## Requirements - -### Arduino IDE - -You need to have the Arduino IDE. You can either install it through the -installer or download the distribution zip file and extract it. - -### pySerial - -The Makefile also delegates resetting the board to a short Python program. -You'll need to install [`pySerial`](https://pypi.python.org/pypi/pyserial) to use it though. - -On most systems you should be able to install it using either `pip` or `easy_install`. - -```sh -pip install pyserial - -# or if you prefer easy_install - -easy_install -U pyserial -``` - -If you prefer to install it as a package, then you can do that as well. - -On Debian or Ubuntu: - -```sh -apt-get install python-serial -``` - -On Fedora: - -```sh -yum install pyserial - -# or on Fedora 22+ - -dnf install pyserial -``` - -On openSUSE: - -```sh -zypper install python-serial -``` - -On Mac using MacPorts: - -```sh -sudo port install py27-serial -``` - -On Windows: - -You need to install Cygwin and its packages for Make, Perl and the following Serial library. - -Assuming you included Python in your Cygwin installation: - -1. download PySerial source package from [https://pypi.python.org/pypi/pyserial](https://pypi.python.org/pypi/pyserial) -2. extract downloaded package running -```tar xvzf dowloaded_package_name.tar.gz``` -3. navigate to extracted package folder -4. build and install Python module: - -``` -python setup.py build -python setup.py install -``` - -## Usage - -Download a copy of this repo somewhere to your system or install it through a package by following the above installation instruction. - -Sample makefiles are provided in the `examples/` directory. E.g. [Makefile-example](examples/MakefileExample/Makefile-example.mk) demonstrates some of the more advanced options, -whilst [Blink](examples/Blink/Makefile) demonstrates the minimal settings required for various boards like the Uno, Nano, Mega, Teensy, ATtiny etc. - -MAC: - -On the Mac with IDE 1.0 you might want to set: - -```make - ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java - ARDMK_DIR = /usr/local - AVR_TOOLS_DIR = /usr - MONITOR_PORT = /dev/ttyACM0 - BOARD_TAG = mega2560 -``` - -On the Mac with IDE 1.5+ it's like above but with - -``` - ARDUINO_DIR = /Applications/Arduino.app/Contents/Java -``` -LINUX: - -You can either declare following variables in your project's makefile or set them as environmental variables. - - ARDUINO_DIR – Directory where Arduino is installed - ARDMK_DIR – Directory where you have copied the makefile - AVR_TOOLS_DIR – Directory where avr tools are installed - -Keep in mind, that Arduino 1.5.x+ comes with it's own copy of avr tools which you can leverage in your build process here. - -Example of ~/.bashrc file: - - export ARDUINO_DIR=/home/sudar/apps/arduino-1.0.5 - export ARDMK_DIR=/home/sudar/Dropbox/code/Arduino-Makefile - export AVR_TOOLS_DIR=/usr/include - -Example of the project's make file: - -```make - BOARD_TAG = mega2560 - MONITOR_PORT = /dev/ttyACM0 -``` - -WINDOWS: - -On Windows (using cygwin), you might want to set: - -```make - ARDUINO_DIR = ../../arduino - ARDMK_DIR = path/to/mkfile - MONITOR_PORT = com3 - BOARD_TAG = mega2560 -``` - -On Windows (using MSYS and PuTTY), you might want to set the following extra parameters: - -```make - MONITOR_CMD = putty - MONITOR_PARMS = 8,1,n,N -``` - -On Arduino 1.5+ installs, you should set the architecture to either `avr` or `sam` and if using a submenu CPU type, then also set that: - -```make - ARCHITECTURE = avr - BOARD_TAG = atmegang - BOARD_SUB = atmega168 -``` - -It is recommended in Windows that you create a symbolic link to avoid problems with file naming conventions on Windows. For example, if your your Arduino directory is in: - - c:\Program Files (x86)\Arduino - -You will get problems with the special characters on the directory name. More details about this can be found in [issue #94](https://github.com/sudar/Arduino-Makefile/issues/94) - -To create a symbolic link, you can use the command “mklink” on Windows, e.g. - -```sh - mklink /d c:\Arduino c:\Program Files (x86)\Arduino -``` - -After which, the variables should be: - -```make - ARDUINO_DIR=../../../../../Arduino -``` - -Instead of: - -```make - ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino -``` - -Usefull Variables: - -The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file. - -- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards` -- `MONITOR_PORT` - The port where your Arduino is plugged in, usually `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux or Mac OS X and `com3`, `com4`, etc. in Windows. -- `ARDUINO_DIR` - Path to Arduino installation. In Cygwin in Windows this path must be - relative, not absolute (e.g. "../../arduino" and not "/c/cygwin/Arduino"). -- `ARDMK_DIR` - Path where the `*.mk` are present. If you installed the package, then it is usually `/usr/share/arduino` -- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you are going to use the binaries that came with Arduino installation, then you don't have to set it. Otherwise set it realtive and not absolute. - - - -## Including Libraries - -You can specify space separated list of libraries that are needed for your sketch in the variable `ARDUINO_LIBS`. - -```make - ARDUINO_LIBS = Wire SoftwareSerial -``` - -The libraries will be searched for in the following places in the following order. - -- `/libraries` directory inside your sketchbook directory. Sketchbook directory will be auto detected from your Arduino preference file. You can also manually set it through `ARDUINO_SKETCHBOOK`. -- `/libraries` directory inside your Arduino directory, which is read from `ARDUINO_DIR`. - -The libraries inside user directories will take precedence over libraries present in Arduino core directory. - -The makefile can autodetect the libraries that are included from your sketch and can include them automatically. But it can't detect libraries that are included from other libraries. (see [issue #93](https://github.com/sudar/Arduino-Makefile/issues/93)) - -## avrdude - -To upload compiled files, `avrdude` is used. This Makefile tries to find `avrdude` and it's config (`avrdude.conf`) below `ARDUINO_DIR`. If you like to use the one installed on your system instead of the one which came with Arduino, you can try to set the variables `AVRDUDE` and `AVRDUDE_CONF`. On a typical Linux system these could be set to - -```make - AVRDUDE = /usr/bin/avrdude - AVRDUDE_CONF = /etc/avrdude.conf -``` - -## Teensy 3.x - -For Teensy 3.x support you must first install [Teensyduino](http://www.pjrc.com/teensy/teensyduino.html). - -See examples/BlinkTeensy for example usage. - -## Versioning - -The current version of the makefile is `1.5.2`. You can find the full history in the [HISTORY.md](HISTORY.md) file - -This project adheres to Semantic [Versioning 2.0](http://semver.org/). - -## License - -This makefile and the related documentation and examples are free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - -## Contribution - -All contributions (even documentation) are welcome :) Open a pull request and I would be happy to merge them. -Also checkout the [contribution guide](CONTRIBUTING.md) for more details. - -If you are looking for ideas to work on, then check out the following TODO items or the [issue tracker](https://github.com/sudar/Arduino-Makefile/issues/). - -## Limitations / Know Issues / TODO's - -- Doesn't support SAM boards yet. -- Since it doesn't do any pre processing like Arduino IDE, you have to declare all methods before you use them ([issue #59](https://github.com/sudar/Arduino-Makefile/issues/59)) -- More than one .ino or .pde file is not supported yet ([issue #49](https://github.com/sudar/Arduino-Makefile/issues/49)) -- When you compile for the first time, it builds all libs inside Arduino directory even if it is not needed. But while linking only the relevant files are linked. ([issue #29](https://github.com/sudar/Arduino-Makefile/issues/29)). Even Arduino IDE does the same thing though. -- This makefile doesn't support boards or IDE from Arduino.org. - -If you find an issue or have an idea for a feature then log them in the [issue tracker](https://github.com/sudar/Arduino-Makefile/issues/) - -## Interfacing with other projects/frameworks/IDE's - -### Colorgcc - -It is possible to use [`colorgcc`](https://github.com/colorgcc/colorgcc) with this makefile. Check out [this comment](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile#comment-1408) to find usage instructions. - -### Emacs/Flymake support - -On-the-fly syntax checking in Emacs using the [Flymake](http://www.emacswiki.org/emacs/FlyMake) minor mode is now possible. - -First, the flymake mode must be configured to recognize ino files : - -Edit the flymake configuration : - -``` - M-x customize-option RET - flymake-allowed-file-name-masks RET -``` - -Add the line : - -``` - ("\\.ino\\'" flymake-simple-make-init) -``` - -Then click on "Apply and Save" button - -Then, the following line must be added to the project Makefile : - -```make - check-syntax: - $(CXX) -c -include Arduino.h -x c++ $(CXXFLAGS) $(CPPFLAGS) -fsyntax-only $(CHK_SOURCES) -``` - -### Code:Blocks integration - -In Code:Blocks open Project -> Properties -> Project settings tab -> check "This is custom Makefile". - -Now go to Settings -> Environment -> Environment variables -> Add - -Add three keys with paths as values, using full paths (!): - -```make - ARDUINO_DIR=/full/path/to/arduino-1.0.6 - ARDMK_DIR=/full/path/to/sketchbook - AVR_TOOLS_DIR=/usr -``` - -Now to set DEBUG target (this will compile the project) go to Build options -> Debug -> "Make" commands - -In Build Project/Target remove $target: - -```sh -$make -f $makefile -``` - -In Clean Project/Target remove $target: - -```sh -$make -f $makefile clean -``` - -To set the RELEASE target (which will compile and upload) go to Build options -> Release -> "Make" commands - -In Build Project/Target put: - -```sh -$make -f $makefile upload -``` - -In Clean Project/Target remove $target: - -```sh -$make -f $makefile clean -``` - -## Test Suite - -This project includes a suite of example Makefiles and small Arduino and chipKIT -programs to assist the maintainers of the Makefile. Run -`tests/script/bootstrap.sh` to attempt to automatically install the dependencies -(Arduino IDE, MPIDE, etc.). Run `tests/script/runtests.sh` to attempt to compile -all of the examples. The bootstrap script is primarily intended for use by a -continuous integration server, specifically Travis CI. It is not intended for -normal users. - -### Bare-Arduino–Project - -If you are planning on using this makefile in a larger/professional project, you might want to take a look at the [Bare-Arduino–Project](https://github.com/WeAreLeka/Bare-Arduino-Project) framework. - -Similar to HTML frameworks, [Bare-Arduino–Project](https://github.com/WeAreLeka/Bare-Arduino-Project) aims at providing a basic `tree` organization, `Makefile` configurations for both OS X and Linux and a handful of instruction on how to get started with a robust Arduino project architecture. - -Further information are available in the [README.md](https://github.com/WeAreLeka/Bare-Arduino-Project/blob/master/README.md) as well as in the [use/installation procedure](https://github.com/WeAreLeka/Bare-Arduino-Project/blob/master/INSTALL.md). - -Please be sure to report issues to [Bare-Arduino–Project](https://github.com/WeAreLeka/Bare-Arduino-Project/issues) if you use it instead of this project. - -## Credits - -This makefile was originally created by [Martin Oldfield](http://mjo.tc/atelier/2009/02/arduino-cli.html) and he maintained it till v0.10.2. -From May 2013, it is maintained by [Sudar Muthu](http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile) and [Simon John](https://github.com/sej7278) with the help of [40+ contributors](https://github.com/sudar/Arduino-Makefile/graphs/contributors). - -## Similar works -- It's not a derivative of this, but Alan Burlison has written a [similar thing](http://bleaklow.com/2010/06/04/a_makefile_for_arduino_sketches.html). -- Alan's Makefile was used in a [Pragmatic Programmer's article](http://pragprog.com/magazines/2011-04/advanced-arduino-hacking). -- Rei Vilo wrote to tell me that he's using the Makefile ina Xcode 4 template called [embedXcode](http://embedxcode.weebly.com/). Apparently it supports many platforms and boards, including AVR-based Arduino, AVR-based Wiring, PIC32-based chipKIT, MSP430-based LaunchPad and ARM3-based Maple. diff --git a/arduino/Arduino-Makefile/Teensy.mk b/arduino/Arduino-Makefile/Teensy.mk deleted file mode 100644 index 8bd822b..0000000 --- a/arduino/Arduino-Makefile/Teensy.mk +++ /dev/null @@ -1,213 +0,0 @@ -######################################################################## -# -# Support for Teensy 3.x boards -# -# https://www.pjrc.com/teensy/ -# -# You must install teensyduino for this Makefile to work: -# -# http://www.pjrc.com/teensy/teensyduino.html -# -# Copyright (C) 2014 Jeremy Shaw based on -# work that is copyright Sudar, Nicholas Zambetti, David A. Mellis -# & Hernando Barragan. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of the -# License, or (at your option) any later version. -# -# Adapted from Arduino 0011 Makefile by M J Oldfield -# -# Original Arduino adaptation by mellis, eighthave, oli.keller -# -# Refer to HISTORY.md file for complete history of changes -# -######################################################################## - - -ifndef ARDMK_DIR - ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) -endif - -# include Common.mk now we know where it is -include $(ARDMK_DIR)/Common.mk - -ARDMK_VENDOR = teensy -ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/avr/cores/teensy3 -BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/boards.txt - - -ifndef PARSE_TEENSY - # result = $(call READ_BOARD_TXT, 'boardname', 'parameter') - PARSE_TEENSY = $(shell grep -v "^\#" "$(BOARDS_TXT)" | grep $(1).$(2) | cut -d = -f 2- ) -endif - - -ifndef F_CPU - ifndef BOARD_SUB - SPEEDS := $(call PARSE_TEENSY,"$(BOARD_TAG),menu.speed.*.build.fcpu") # Obtain sequence of supported frequencies. - SPEEDS := $(shell printf "%d\n" $(SPEEDS) | sort -g) # Sort it, just in case. Printf to re-append newlines so that sort works. - F_CPU := $(lastword $(SPEEDS)) # List is sorted in ascending order. Take the fastest speed. - #$(info "speeds is " $(SPEEDS)) # Good for debugging - else - F_CPU := $(call PARSE_TEENSY,$(BOARD_TAG),menu.speed.$(BOARD_SUB).build.fcpu) - endif -endif - -# if boards.txt gets modified, look there, else hard code it -ARCHITECTURE = $(call PARSE_TEENSY,$(BOARD_TAG),build.architecture) -ifeq ($(strip $(ARCHITECTURE)),) - ARCHITECTURE = arm -endif - -AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTURE)) - -# define plaform lib dir ignoring teensy's oversight on putting it all in avr -ifndef ARDUINO_PLATFORM_LIB_PATH - ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARDMK_VENDOR)/avr/libraries - $(call show_config_variable,ARDUINO_PLATFORM_LIB_PATH,[COMPUTED],(from ARDUINO_DIR)) -endif - -######################################################################## -# command names - -ifndef CC_NAME - CC_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.gcc) - ifndef CC_NAME - CC_NAME := arm-none-eabi-gcc - else - $(call show_config_variable,CC_NAME,[COMPUTED]) - endif -endif - -ifndef CXX_NAME - CXX_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.g++) - ifndef CXX_NAME - CXX_NAME := arm-none-eabi-g++ - else - $(call show_config_variable,CXX_NAME,[COMPUTED]) - endif -endif - -ifndef AS_NAME - AS_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.as) - ifndef AS_NAME - AS_NAME := arm-none-eabi-gcc-as - else - $(call show_config_variable,AS_NAME,[COMPUTED]) - endif -endif - -ifndef OBJCOPY_NAME - OBJCOPY_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objcopy) - ifndef OBJCOPY_NAME - OBJCOPY_NAME := arm-none-eabi-objcopy - else - $(call show_config_variable,OBJCOPY_NAME,[COMPUTED]) - endif -endif - -ifndef OBJDUMP_NAME - OBJDUMP_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objdump) - ifndef OBJDUMP_NAME - OBJDUMP_NAME := arm-none-eabi-objdump - else - $(call show_config_variable,OBJDUMP_NAME,[COMPUTED]) - endif -endif - -ifndef AR_NAME - AR_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.ar) - ifndef AR_NAME - AR_NAME := arm-none-eabi-ar - else - $(call show_config_variable,AR_NAME,[COMPUTED]) - endif -endif - -ifndef SIZE_NAME - SIZE_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.size) - ifndef SIZE_NAME - SIZE_NAME := arm-none-eabi-size - else - $(call show_config_variable,SIZE_NAME,[COMPUTED]) - endif -endif - -ifndef NM_NAME - NM_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.nm) - ifndef NM_NAME - NM_NAME := arm-none-eabi-gcc-nm - else - $(call show_config_variable,NM_NAME,[COMPUTED]) - endif -endif - -# processor stuff -ifndef MCU - MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) -endif - -ifndef MCU_FLAG_NAME - MCU_FLAG_NAME=mcpu -endif - -######################################################################## -# FLAGS -ifndef USB_TYPE - USB_TYPE = USB_SERIAL -endif - -CPPFLAGS += -DLAYOUT_US_ENGLISH -D$(USB_TYPE) - -CPPFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.option) - -CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.cppoption) -ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.gnu0x)","true") - CXXFLAGS_STD += -std=gnu++0x -endif - -ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.elide_constructors)", "true") - CXXFLAGS += -felide-constructors -endif - -CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) -CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) -CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) -CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpp) - -CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) -CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) -CFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) - -ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.common) -ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) -ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.defs) -ASFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.S) - -LDFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) - -AMCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) -LDFLAGS += -Wl,--gc-sections,--relax -LINKER_SCRIPTS = -T${ARDUINO_CORE_PATH}/${AMCU}.ld -OTHER_LIBS = $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.libs) - -CPUFLAGS = $(call PARSE_TEENSY,$(BOARD_TAG),build.flags.cpu) -# usually defined as per teensy31.build.mcu=mk20dx256 but that isn't valid switch -MCU := $(shell echo ${CPUFLAGS} | sed -n -e 's/.*-mcpu=\([a-zA-Z0-9_-]*\).*/\1/p') - -######################################################################## -# some fairly odd settings so that 'make upload' works -# -# may require additional patches for Windows support - -do_upload: override get_monitor_port="" -AVRDUDE=@true -RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot - -######################################################################## -# automatially include Arduino.mk for the user - -include $(ARDMK_DIR)/Arduino.mk - diff --git a/arduino/Arduino-Makefile/ard-reset-arduino.1 b/arduino/Arduino-Makefile/ard-reset-arduino.1 deleted file mode 100644 index 781afa9..0000000 --- a/arduino/Arduino-Makefile/ard-reset-arduino.1 +++ /dev/null @@ -1,48 +0,0 @@ -.TH ARD-RESET-ARDUINO "1" "January 2017" "ard-reset-arduino 1.5.2" "Arduino CLI Reset" - -.SH NAME -ard-reset-arduino - Reset Arduino board - -.SH SYNOPSIS -.B ard-reset-arduino -[OPTION]... [PORT] - -.SH DESCRIPTION -To reset Arduinos, we either pulse the DTR line or open the USB port -at 1200 baud and close it again. - -.SH OPTIONS -.B \-\-verbose -Watch what's going on on STDERR. - -.B \-\-period -Specify the DTR pulse width in seconds. - -.B \-\-caterina -Reset a Leonardo, Micro, Robot, LilyPadUSB or similar 32u4-based device. - -.SH EXAMPLES -ard-reset-arduino /dev/ttyACM0 -.PP -ard-reset-arduino \-\-verbose \-\-period=0.1 /dev/cu.usb* -.PP -ard-reset-arduino \-\-verbose \-\-caterina /dev/ttyUSB0 - -.SH BUGS -There are no known bugs in this application. Please report problems -to the author. Patches are welcome. - -.SH AUTHOR -Simon John, git@the-jedi.co.uk - -.SH LICENSE -Copyright (c) 2014, Simon John. All rights reserved. -.PP -This file is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. -.PP -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/arduino/Arduino-Makefile/arduino-mk-vars.md b/arduino/Arduino-Makefile/arduino-mk-vars.md deleted file mode 100644 index d52233b..0000000 --- a/arduino/Arduino-Makefile/arduino-mk-vars.md +++ /dev/null @@ -1,1419 +0,0 @@ -# Documentation of variables - -The following are the different variables that can be overwritten in the user makefiles. - -* [Global variables](#global-variables) -* [Installation/Directory variables](#installationdirectory-variables) -* [Arduino IDE variables](#arduino-ide-variables) -* [Sketch related variables](#sketch-related-variables) -* [ISP programming variables](#isp-programming-variables) -* [Compiler/Executable variables](#compilerexecutable-variables) -* [Avrdude setting variables](#avrdude-setting-variables) -* [Bootloader variables](#bootloader-variables) -* [ChipKIT variables](#chipkit-variables) - -## Global variables - -### ARDUINO_QUIET - -**Description:** - -Suppress printing of Arduino-Makefile configuration. - -Defaults to `0` (unset/disabled). - -**Example:** - -```Makefile -ARDUINO_QUIET = 1 -``` - -**Requirement:** *Optional* - ----- - -## Installation/Directory variables - -### ARDMK_DIR - -**Description:** - -Directory where the `*.mk` files are stored. - -Usually can be auto-detected as parent of `Arduino.mk`. - -**Example:** - -```Makefile -ARDMK_DIR = /usr/share/arduino -``` - -**Requirement:** *Optional* - ----- - -### AVR_TOOLS_DIR - -**Description:** - -Directory where tools such as `avrdude`, `avr-g++`, `avr-gcc`, etc. are stored in the `bin/` subdirectory. - -Usually can be auto-detected from `$PATH` as `SYSTEMPATH_AVR_TOOLS_DIR` or as `BUNDLED_AVR_TOOLS_DIR` within the Arduino distribution. - -**Example:** - -```Makefile -AVR_TOOLS_DIR = /usr -# or -AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr -``` - -**Requirement:** *Optional* - ----- - -### RESET_CMD - -**Description:** - -Command to reset the MCU. - -Defaults to `ard-reset-arduino` with the extra `--caterina` flag for atmega32u4 boards. - -**Example:** - -```Makefile -RESET_CMD = ~/gertduino/reset -``` - -**Requirement:** *Optional* - ----- - -## Arduino IDE variables - -### ARDUINO_DIR - -**Description:** - -Directory where the Arduino IDE and/or core files are stored. Usually can be auto-detected as `AUTO_ARDUINO_DIR`. - -**Example:** - -```Makefile -# Linux -ARDUINO_DIR = /usr/share/arduino -# Mac OS X -ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java -# Mac OSX with IDE 1.5+ -ARDUINO_DIR = /Applications/Arduino.app/Contents/Java -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_PLATFORM_LIB_PATH - -**Description:** - -Directory where the Arduino platform dependent libraries are stored. -(Used only for Arduino 1.5+) - -**Example:** - -```Makefile -ARDUINO_PLATFORM_LIB_PATH = /usr/share/arduino/hardware/arduino/avr/libraries -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_VERSION - -**Description:** - -Version string for Arduino IDE and/or core. - -Usually can be auto-detected as `AUTO_ARDUINO_VERSION` from `/usr/share/arduino/lib/version.txt` - -**Example:** - -```Makefile -ARDUINO_VERSION = 105 -``` - -**Requirement:** *Optional* - ----- - -### ARCHITECTURE - -**Description:** - -Architecture for Arduino 1.5+ - -Defaults to unset for 1.0 or `avr` for 1.5+ - -**Example:** - -```Makefile -ARCHITECTURE = sam -``` - -**Requirement:** *Optional* - ----- - -### ARDMK_VENDOR - -**Description:** - -Board vendor/maintainer. - -Defaults to `arduino` - -**Example:** - -```Makefile -ARDMK_VENDOR = sparkfun -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_SKETCHBOOK - -**Description:** - -Path to `sketchbook` directory. - -Usually can be auto-detected from the Arduino `preferences.txt` file or the default `~/sketchbook` - -**Example:** - -```Makefile -ARDUINO_SKETCHBOOK = ~/sketches -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_PREFERENCES_PATH - -**Description:** - -Path to Arduino `preferences.txt` file. - -Usually can be auto-detected as `AUTO_ARDUINO_PREFERENCES` from the defaults: - -* on Linux (1.0): `~/.arduino/preferences.txt` -* on Linux (1.5+): `~/.arduino15/preferences.txt` -* on Mac OS X (1.0): `~/Library/Arduino/preferences.txt` -* on Mac OS X (1.5+): `~/Library/Arduino15/preferences.txt` - -**Example:** - -```Makefile -ARDUINO_PREFERENCES_PATH = ~/sketches/preferences.txt -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_CORE_PATH - -**Description:** - -Path to standard Arduino core files. - -**Example:** - -```Makefile -ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino -``` - -**Requirement:** *Optional* - ----- - -## Sketch related variables - -### ARDUINO_LIBS - -**Description:** - -Any libraries you intend to include. - -Usually can be auto-detected from the sketch. Separated by spaces. If the library has a `/utility` folder (like `SD` or `Wire` library), then the utility folder should also be specified. - -**Example:** - -```Makefile -ARDUINO_LIBS = SD SD/utility Wire Wire/utility -``` - -**Requirement:** *Optional* - ----- - -### BOARD_TAG - -**Description:** - -Device type as listed in `boards.txt` or `make show_boards`. - -**Example:** - -```Makefile -BOARD_TAG = uno or mega2560 -``` - -**Requirement:** *Mandatory* - ----- - -### BOARD_SUB - -**Description:** - -1.5+ submenu as listed in `boards.txt` or `make show_submenu`. - -**Example:** - -```Makefile -# diecimila.name=Arduino Duemilanove or Diecimila -BOARD_TAG=diecimila - -# diecimila.menu.cpu.atmega168=ATmega168 -BOARD_SUB=atmega168 -``` - -**Requirement:** *Mandatory for 1.5+ if using a submenu CPU* - ----- - -### MONITOR_PORT - -**Description:** - -Path to serial (USB) device used for uploading/serial comms. - -**Example:** - -```Makefile -# Linux -MONITOR_PORT = /dev/ttyUSB0 -# or -MONITOR_PORT = /dev/ttyACM0 -# Mac OS X -MONITOR_PORT = /dev/cu.usb* -# Windows -MONITOR_PORT = com3 -``` - -**Requirement:** *Mandatory* - ----- - -### FORCE_MONITOR_PORT - -**Description:** - -Skip the MONITOR_PORT existance check. - -**Example:** - -```Makefile -# Enable -FORCE_MONITOR_PORT = true -# Disable (default) -undefine FORCE_MONITOR_PORT -``` - -**Requirement:** *Optional* - ----- - -### USER_LIB_PATH - -**Description:** - -Directory where additional libraries are stored. - -Defaults to `libraries` directory within user's sketchbook. - -**Example:** - -```Makefile -# Linux -USER_LIB_PATH = ~/sketchbook/libraries -# For a random project on *nix -USER_LIB_PATH = /path/to/my/project -``` - -**Requirement:** *Optional* - ----- - -### OBJDIR - -**Description:** - -Directory where binaries and compiled files are put. - -Defaults to `build-$(BOARD_TAG)` in your `Makefile` directory. - -**Example:** - -```Makefile -OBJDIR = /path/to/my/project-directory/bin -``` - -**Requirement:** *Optional* - ----- - -### TARGET - -**Description:** - -What name you would like for generated target files. - -Defaults to the name of your current working directory, but with underscores (_) instead of spaces. - -**Example:** - -```Makefile -TARGET = my-project -``` - -Will generate targets like `my-project.hex` and `my-project.elf`. - -**Requirement:** *Optional* - ----- - -### ALTERNATE_CORE - -**Description:** - -Non-standard core for Arduino-unsupported chips like the ATtiny. - -**Example:** - -```Makefile -# HLT core -ALTERNATE_CORE = attiny-master -# tiny core -ALTERNATE_CORE = arduino-tiny -# tiny core 2 -ALTERNATE_CORE = tiny2 -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_VAR_PATH - -**Description:** - -Path to non-standard core's variant files. - -**Example:** - -```Makefile -ARDUINO_VAR_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny -``` - -**Requirement:** *Optional* - ----- - -### CORE - -**Description:** - -Name of the core *inside* the ALTERNATE_CORE or the standard core. - -Usually can be auto-detected as `build.core` from `boards.txt`. - -**Example:** - -```Makefile -# standard Arduino core (undefine ALTERNATE_CORE) -CORE = arduino -# or -CORE = robot -# tiny core (ALTERNATE_CORE = arduino-tiny) -CORE = tiny -``` - -**Requirement:** *Optional* - ----- - -### VARIANT - -**Description:** - -Variant of a standard board design. - -Usually can be auto-detected as `build.variant` from `boards.txt`. - -**Example:** - -```Makefile -VARIANT = leonardo -``` - -**Requirement:** *Optional* - ----- - -### USB_TYPE - -**Description:** - -Define Teensy 3.1 usb device type. Default is USB_SERIAL - -**Example:** - -```Makefile -USB_TYPE = USB_SERIAL -# or -USB_TYPE = USB_HID -# or -USB_TYPE = USB_SERIAL_HID -# or -USB_TYPE = USB_MIDI -# or -USB_TYPE = USB_RAWHID -# or -USB_TYPE = USB_FLIGHTSIM -``` - -**Requirement:** *Optional* - ----- - -### USB_VID - -**Description:** - -Override `USB VID` for atmega32u4 boards. - -Usually can be auto-detected as `build.vid` from `boards.txt` - -**Example:** - -```Makefile -USB_VID = 0x2341 -``` - -**Requirement:** *Optional* - ----- - -### USB_PID - -**Description:** - -Override `USB PID` for atmega32u4 boards. - -Usually can be auto-detected as `build.pid` from `boards.txt` - -**Example:** - -```Makefile -USB_PID = 0x8039 -``` - -**Requirement:** *Optional* - ----- - -### F_CPU - -**Description:** - -CPU speed in Hz - -Usually can be auto-detected as `build.f_cpu` from `boards.txt`, except in -some 1.5+ cores like attiny where there is a clock submenu. - -**Example:** - -```Makefile -F_CPU = 8000000L -``` - -**Requirement:** *Optional* - ----- - -### HEX_MAXIMUM_SIZE - -**Description:** - -Maximum hex file size - -Usually can be auto-detected as `upload.maximum_size` from `boards.txt` - -**Example:** - -```Makefile -HEX_MAXIMUM_SIZE = 14336 -``` - -**Requirement:** *Optional* - ----- - -### MCU - -**Description:** - -Microcontroller model. - -Usually can be auto-detected as `build.mcu` from `boards.txt` - -**Example:** - -```Makefile -MCU = atmega32u4 -``` - -**Requirement:** *Optional* - ----- - -### MCU_FLAG_NAME - -**Description:** - -Override default MCU flags. - -Defaults to `mmcu` - -**Example:** - -```Makefile -MCU_FLAG_NAME = mprocessor -``` - -**Requirement:** *Optional* - ----- - -### MONITOR_BAUDRATE - -**Description:** - -Baudrate of the serial monitor. - -Defaults to `9600` if it can't find it in the sketch `Serial.begin()` - -**Example:** - -```Makefile -MONITOR_BAUDRATE = 57600 -``` - -**Requirement:** *Optional* - ----- - -## ISP programming variables - -### ISP_PROG - -**Description:** - -Type of ISP. Either a USB device or ArduinoISP protocol. - -**Example:** - -```Makefile -ISP_PROG = usbasp -# or -ISP_PROG = usbtiny -# or -ISP_PROG = stk500v2 -# or -ISP_PROG = stk500v1 -``` - -**Requirement:** *Optional* - ----- - -### ISP_PORT - -**Description:** - -Device path to ArduinoISP. Not needed for hardware ISP's. - -**Example:** - -```Makefile -# Linux -ISP_PORT = /dev/ttyACM0 -``` - -**Requirement:** *Optional* - ----- - -### ISP_LOCK_FUSE_PRE - -**Description:** - -Bootloader unlock bits. - -Usually can be auto-detected from `boards.txt` - -**Example:** - -```Makefile -ISP_LOCK_FUSE_PRE = 0x3f -``` - -**Requirement:** *Optional* - ----- - -### ISP_LOCK_FUSE_POST - -**Description:** - -Bootloader lock bits. - -Usually can be auto-detected from `boards.txt` - -**Example:** - -```Makefile -ISP_LOCK_FUSE_POST = 0xcf -``` - -**Requirement:** *Optional* - ----- - -### ISP_HIGH_FUSE - -**Description:** - -`ISP_LOW_FUSE/ISP_EXT_FUSE` - high/low/extended fuse bits. - -Usually can be auto-detected from `boards.txt` - -**Example:** - -```Makefile -ISP_HIGH_FUSE = 0xdf # or 0xff or 0x01 -``` - -**Requirement:** *Optional* - ----- - -### ISP_EEPROM - -**Description:** - -Whether to upload the EEPROM file or not. - -Defaults to `0` - -**Example:** - -```Makefile -ISP_EEPROM = 1 -``` - -**Requirement:** *Optional* - ----- - -## Compiler/Executable variables - -### CC_NAME - -**Description:** - -C compiler. - -Defaults to `avr-gcc` - -**Example:** - -```Makefile -CC_NAME = pic32-gcc -``` - -**Requirement:** *Optional* - ----- - -### CXX_NAME - -**Description:** - -C++ compiler. - -Defaults to `avr-g++` - -**Example:** - -```Makefile -CXX_NAME = pic32-g++ -``` - -**Requirement:** *Optional* - ----- - -### OBJCOPY_NAME - -**Description:** - -Objcopy utility. - -Defaults to `avr-objcopy` - -**Example:** - -```Makefile -OBJCOPY_NAME = pic32-objcopy -``` - -**Requirement:** *Optional* - ----- - -### OBJDUMP_NAME - -**Description:** - -Objdump utility. - -Defaults to `avr-objdump` - -**Example:** - -```Makefile -OBJDUMP_NAME = pic32-objdump -``` - -**Requirement:** *Optional* - ----- - -### AR_NAME - -**Description:** - -Archive utility. - -Defaults to `avr-ar` unless you're using toolchain > 4.9.0 in which case we use avr-gcc-ar. - -**Example:** - -```Makefile -AR_NAME = pic32-ar -``` - -**Requirement:** *Optional* - ----- - -### SIZE_NAME - -**Description:** - -Size utility. - -Defaults to `avr-size` - -**Example:** - -```Makefile -SIZE_NAME = pic32-size -``` - -**Requirement:** *Optional* - ----- - -### NM_NAME - -**Description:** - -Nm utility. - -Defaults to `avr-nm` - -**Example:** - -```Makefile -NM_NAME = pic32-nm -``` - -**Requirement:** *Optional* - ----- - -### OPTIMIZATION_LEVEL - -**Description:** - -Linker's `-O` flag - -Defaults to `s`, which shouldn't really be changed as it breaks `SoftwareSerial` and usually results in bigger hex files. - -**Example:** - -```Makefile -OPTIMIZATION_LEVEL = 3 -``` - -**Requirement:** *Optional* - ----- - -### OTHER_LIBS - -**Description:** - -Additional Linker lib flags, for platform support - -Defaults to "" - -**Example:** - -```Makefile -OTHER_LIBS = -lsomeplatformlib -``` - -**Requirement:** *Optional* - ----- - -### CFLAGS_STD - -**Description:** - -Controls, *exclusively*, which C standard is to be used for compilation. - -Defaults to `undefined` on 1.0.x or `-std=gnu11 -flto -fno-fat-lto-objects` on 1.5+ or if you install AVR toolchain > 4.9.0 - -Possible values: - -* With `avr-gcc 4.3`, shipped with the 1.0 Arduino IDE: - * `undefined` - * `-std=c99` - * `-std=gnu89` - This is the default for C code - * `-std=gnu99` -* With `avr-gcc 4.7, 4.8 or 4.9`, installed by you or 1.5+ IDE: - * `undefined` - * `-std=c99` - * `-std=c11` - * `-std=gnu89` - * `-std=gnu99` - * `-std=gnu11 -flto -fno-fat-lto-objects` - This is the default for C code - -For more information, please refer to the [Options Controlling C Dialect](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html) - -**Example:** - -```Makefile -CFLAGS_STD = = -std=gnu89 -``` - -**Requirement:** *Optional* - ----- - -### CXXFLAGS_STD - -**Description:** - -Controls, *exclusively*, which C++ standard is to be used for compilation. - -Defaults to `undefined` on 1.0 or `-std=gnu++11 -fno-threadsafe-statics -flto` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+) - -Possible values: - -* With `avr-gcc 4.3`, shipped with the 1.0 Arduino IDE: - * `undefined` - * `-std=c++98` - * `-std=c++0x` - * `-std=gnu++98` - This is the default for C code - * `-std=gnu++0x` -* With `avr-gcc 4.7, 4.8 or 4.9`, installed by you or 1.5+ IDE: - * `undefined` - * `-std=c++98` - * `-std=c++11` - * `-std=c++1y` - * `-std=c++14` - * `-std=gnu++98` - * `-std=gnu++11 -fno-threadsafe-statics -flto` - This is the default for C++ code - * `-std=gnu++1y` - * `-std=gnu++14` - -For more information, please refer to the [Options Controlling C Dialect](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html) - -**Example:** - -```Makefile -CXXFLAGS_STD = = -std=gnu++98 -``` - -**Requirement:** *Optional* - ----- - -### CFLAGS - -**Description:** - -Flags passed to compiler for files compiled as C. Add more flags to this -variable using `+=`. - -Defaults to all flags required for a typical build. - -**Example:** - -```Makefile -CFLAGS += -my-c-only-flag -``` - -**Requirement:** *Optional* - ----- - -### CXXFLAGS - -**Description:** - -Flags passed to the compiler for files compiled as C++. Add more flags to this -variable using `+=`. - -Defaults to `-fpermissive -fno-exceptions` - -**Example:** - -```Makefile -CXXFLAGS += -my-c++-onlyflag -``` - -**Requirement:** *Optional* - ----- - -### ASFLAGS - -**Description:** - -Flags passed to compiler for files compiled as assembly (e.g. `.S` files). Add -more flags to this variable using `+=`. - -Defaults to all flags required for a typical build. - -**Example:** - -```Makefile -ASFLAGS += -my-as-only-flag -``` - -**Requirement:** *Optional* - ----- - -### CPPFLAGS - -**Description:** - -Flags passed to the C pre-processor (for C, C++ and assembly source flies). Add -more flags to this variable using `+=`. - -Defaults to all flags required for a typical build. - -**Example:** - -```Makefile -CPPFLAGS += -DMY_DEFINE_FOR_ALL_SOURCE_TYPES -``` - -**Requirement:** *Optional* - ----- - -### OVERRIDE_EXECUTABLES - -**Description:** - -Override the default build tools. - -If set to `1`, each tool (`CC`, `CXX`, `AS`, `OBJCOPY`, `OBJDUMP`, `AR`, `SIZE`, `NM`) must have its path explicitly defined. See `chipKIT.mk`. - -**Example:** - -```Makefile -OVERRIDE_EXECUTABLES = 1 -``` - -**Requirement:** *Optional* - ----- - -### MONITOR_CMD - -**Description:** - -Command to run the serial monitor. - -Defaults to `screen` - -**Example:** - -```Makefile -MONITOR_CMD = minicom -``` - -**Requirement:** *Optional* - ----- - -### PRE_BUILD_HOOK - -**Description:** - -Path to shell script to be executed before build. Could be used to automatically -bump revision number for example. - -Defaults to `pre-build-hook.sh` - -**Example:** - -```Makefile -PRE_BUILD_HOOK = ~/bin/bump-revision.sh -``` - -**Requirement:** *Optional* - ----- - -## Avrdude setting variables - -### AVRDUDE - -**Description:** - -Path to `avrdude` utility - -Usually can be auto-detected within the parent of `AVR_TOOLS_DIR` or in the `$PATH` - -**Example:** - -```Makefile -AVRDUDE = /usr/bin/avrdude -``` - -**Requirement:** *Optional* - ----- - -### AVRDUDE_CONF - -**Description:** - -Path to `avrdude.conf` file - -Usually can be auto-detected within the parent of `AVR_TOOLS_DIR` - -**Example:** - -```Makefile -AVRDUDE_CONF = /etc/avrdude.conf -# or -AVRDUDE_CONF = /usr/share/arduino/hardware/tools/avrdude.conf -``` - -**Requirement:** *Optional* - ----- - -### AVR_TOOLS_PATH - -**Description:** - -Directory where tools such as `avrdude`, `avr-g++`, `avr-gcc` etc. are stored. - -Usually can be auto-detected from `AVR_TOOLS_DIR/bin` - -**Example:** - -```Makefile -AVR_TOOLS_PATH = /usr/bin -# or -AVR_TOOLS_PATH = /usr/share/arduino/hardware/tools/avr/bin -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_LIB_PATH - -**Description:** - -Directory where the standard Arduino libraries are stored. - -Defaults to `ARDUINO_DIR/libraries` - -**Example:** - -```Makefile -# Linux -ARDUINO_LIB_PATH = /usr/share/arduino/libraries -``` - -**Requirement:** *Optional* - ----- - -### ARDUINO_CORE_PATH - -**Description:** - -Directory where the standard Arduino cores are stored. - -Defaults to `ARDUINO_DIR/hardware/arduino/cores/arduino` - -**Example:** - -```Makefile -ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/robot -``` - -**Requirement:** *Optional* - ----- - -### ALTERNATE_CORE_PATH - -**Description:** - -Path to non-standard cores. - -Defaults to `ARDUINO_SKETCHBOOK/hardware/ALTERNATE_CORE` - -**Example:** - -```Makefile -ALTERNATE_CORE_PATH = ~/sketchbook/hardware/arduino-tiny/cores/tiny -``` - -**Requirement:** *Optional* - ----- - -### BOARDS_TXT - -**Description:** - -Path to `boards.txt` - -Defaults to `ARDUINO_DIR/hardware/arduino/boards.txt` - -**Example:** - -```Makefile -BOARD_TXT = ~/sketchbook/hardware/boards.txt -# or -BOARD_TXT = /usr/share/arduino/hardware/arduino/boards.txt -``` - -**Requirement:** *Optional* - ----- - -### AVRDUDE_ARD_BAUDRATE - -**Description:** - -Upload speed - -Usually can be auto-detected as `upload.speed` from `boards.txt` - -**Example:** - -```Makefile -AVRDUDE_ARD_BAUDRATE = 19200 -``` - -**Requirement:** *Optional* - ----- - -### AVRDUDE_ARD_PROGRAMMER - -**Description:** - -Upload protocol - -Usually can be auto-detected as `upload.protocol` from `boards.txt` - -**Example:** - -```Makefile -AVRDUDE_ARD_PROGRAMMER = stk500v1 -``` - -**Requirement:** *Optional* - ----- - -### AVRDUDE_ISP_BAUDRATE - -**Description:** - -ISP speed if different to `upload.speed` - -Defaults to same as `AVRDUDE_ARD_BAUDRATE` or `19200` - -**Example:** - -```Makefile -AVRDUDE_ISP_BAUDRATE = 19200 -``` - -**Requirement:** *Optional* - ----- - -### AVRDUDE_OPTS - -**Description:** - -Options to pass to `avrdude`. - -Defaults to `-q -V` (quiet, don't verify). User values are not *ANDed* to the defaults, you have to set each option you require. - -**Example:** - -```Makefile -AVRDUDE_OPTS = -v -``` - -**Requirement:** *Optional* - ----- - -## Bootloader variables - -### BOOTLOADER_FILE - -**Description:** - -File for bootloader. - -Usually can be auto-detected as `bootloader.file` from `boards.txt` - -**Example:** - -```Makefile -BOOTLOADER_FILE = optiboot_atmega328.hex -``` - -**Requirement:** *Optional* - ----- - -### BOOTLOADER_PATH - -**Description:** - -Relative path to bootloader directory. - -Usually can be auto-detected as a relative `bootloader.path` from `boards.txt` - -Deprecated in 1.5, now part of bootloader.file - -**Example:** - -```Makefile -BOOTLOADER_PATH = optiboot -# or -BOOTLOADER_PATH = arduino:atmega -``` - -**Requirement:** *Optional* - ----- - -### BOOTLOADER_PARENT - -**Description:** - -Absolute path to bootloader file's parent directory. - -Defaults to `/usr/share/arduino/hardware/arduino/bootloaders` (Linux) - -**Example:** - -```Makefile -BOOTLOADER_PARENT = ~/sketchbook/hardware/promicro/bootloaders -BOOTLOADER_PATH = caterina -BOOTLOADER_FILE = Caterina-promicro16.hex -``` - -Would result in an absolute path to the bootloader hex file of `~/sketchbook/hardware/promicro/bootloaders/caterina/Caterina-promicro16.hex` - -**Requirement:** *Optional, unless BOOTLOADER_FILE and/or BOOTLOADER_PATH are user-defined* - ----- - -## ChipKIT variables - -### MPIDE_DIR - -**Description:** - -Path to chipKIT MP IDE - -Usually can be auto-detected as `AUTO_MPIDE_DIR` from the defaults `/usr/share/mpide` (Linux) or `/Applications/Mpide.app/Contents/Resources/Java` (OSX) - -**Example:** - -```Makefile -MPIDE_DIR = ~/mpide -``` - -**Requirement:** *Optional* - ----- - -### MPIDE_PREFERENCES_PATH - -**Description:** - -Path to chipKIT `preferences.txt` file. - -Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `~/.mpide/preferences.txt` (Linux) or `~/Library/Mpide/preferences.txt` (OSX) - -**Example:** - -```Makefile -MPIDE_PREFERENCES_PATH = ~/chipkit/preferences.txt -``` - -**Requirement:** *Optional* diff --git a/arduino/Arduino-Makefile/bin/ard-reset-arduino b/arduino/Arduino-Makefile/bin/ard-reset-arduino deleted file mode 100644 index 1f2c7e9..0000000 --- a/arduino/Arduino-Makefile/bin/ard-reset-arduino +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -from __future__ import print_function -import serial -import os.path -import argparse -from time import sleep - -pyserial_version = None -try: - pyserial_version = int(serial.VERSION[0]) -except: - pyserial_version = 2 # less than 2.3 - -parser = argparse.ArgumentParser(description='Reset an Arduino') -parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.') -parser.add_argument('--verbose', action='store_true', help="Watch what's going on on STDERR.") -parser.add_argument('--period', default=0.1, help='Specify the DTR pulse width in seconds.') -parser.add_argument('port', nargs=1, help='Serial device e.g. /dev/ttyACM0') -args = parser.parse_args() - -if args.caterina: - if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0]) - ser = serial.Serial(args.port[0], 57600) - ser.close() - - if pyserial_version < 3: - ser.setBaudrate (1200) - else: - ser.baudrate = 1200 - - ser.open() - ser.setRTS(True) # RTS line needs to be held high and DTR low - ser.setDTR(False) # (see Arduino IDE source code) - ser.close() - sleep(1) - - while not os.path.exists(args.port[0]): - if args.verbose: print('Waiting for %s to come back' % args.port[0]) - sleep(1) - - if args.verbose: print('%s has come back after reset' % args.port[0]) -else: - if args.verbose: print('Setting DTR high on %s for %ss' % (args.port[0],args.period)) - ser = serial.Serial(args.port[0], 115200) - ser.setDTR(False) - sleep(args.period) - ser.setDTR(True) - ser.close() diff --git a/arduino/Arduino-Makefile/chipKIT.mk b/arduino/Arduino-Makefile/chipKIT.mk deleted file mode 100644 index 298ac96..0000000 --- a/arduino/Arduino-Makefile/chipKIT.mk +++ /dev/null @@ -1,121 +0,0 @@ -# -# chipKIT extensions for Arduino Makefile -# System part (i.e. project independent) -# -# Copyright (C) 2011, 2012, 2013 Christopher Peplin -# , based on work that is Copyright Martin -# Oldfield -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of the -# License, or (at your option) any later version. -# -# Modified by John Wallbank for Visual Studio -# -# Development changes, John Wallbank, -# -# - made inclusion of WProgram.h optional so that -# including it in the source doesn't mess up compile error line numbers -# - parameterised the routine used to reset the serial port -# - -######################################################################## -# Makefile distribution path -# - -# The show_config_variable is unavailable before we include the common makefile, -# so we defer logging the ARDMK_DIR info until it happens in Arduino.mk -ifndef ARDMK_DIR - # presume it's the same path to our own file - ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) -endif - -include $(ARDMK_DIR)/Common.mk - -ifndef MPIDE_DIR - AUTO_MPIDE_DIR := $(firstword \ - $(call dir_if_exists,/usr/share/mpide) \ - $(call dir_if_exists,/Applications/Mpide.app/Contents/Resources/Java) ) - ifdef AUTO_MPIDE_DIR - MPIDE_DIR = $(AUTO_MPIDE_DIR) - $(call show_config_variable,MPIDE_DIR,[autodetected]) - else - echo $(error "mpide_dir is not defined") - endif -else - $(call show_config_variable,MPIDE_DIR,[USER]) -endif - -ifeq ($(CURRENT_OS),WINDOWS) - ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) - echo $(error On Windows, MPIDE_DIR must be a relative path) - endif -endif - -ifndef MPIDE_PREFERENCES_PATH - AUTO_MPIDE_PREFERENCES_PATH := $(firstword \ - $(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \ - $(call dir_if_exists,$(HOME)/Library/Mpide/preferences.txt) ) - ifdef AUTO_MPIDE_PREFERENCES_PATH - MPIDE_PREFERENCES_PATH = $(AUTO_MPIDE_PREFERENCES_PATH) - $(call show_config_variable,MPIDE_PREFERENCES_PATH,[autodetected]) - endif -endif - -# The same as in Arduino, the Linux distribution contains avrdude and # -# avrdude.conf in a different location, but for chipKIT it's even slightly -# different than the Linux paths for Arduino, so we have to "double override". -ifeq ($(CURRENT_OS),LINUX) - AVRDUDE_DIR = $(ARDUINO_DIR)/hardware/tools - AVRDUDE = $(AVRDUDE_DIR)/avrdude - AVRDUDE_CONF = $(AVRDUDE_DIR)/avrdude.conf -endif - -PIC32_TOOLS_DIR = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools -PIC32_TOOLS_PATH = $(PIC32_TOOLS_DIR)/bin - -ALTERNATE_CORE = pic32 -ALTERNATE_CORE_PATH = $(MPIDE_DIR)/hardware/pic32 -ARDUINO_CORE_PATH = $(ALTERNATE_CORE_PATH)/cores/$(ALTERNATE_CORE) -ARDUINO_PREFERENCES_PATH = $(MPIDE_PREFERENCES_PATH) -ARDUINO_DIR = $(MPIDE_DIR) - -CORE_AS_SRCS = $(ARDUINO_CORE_PATH)/vector_table.S \ - $(ARDUINO_CORE_PATH)/cpp-startup.S \ - $(ARDUINO_CORE_PATH)/crti.S \ - $(ARDUINO_CORE_PATH)/crtn.S \ - $(ARDUINO_CORE_PATH)/pic32_software_reset.S - -ARDUINO_VERSION = 23 - -CC_NAME = pic32-gcc -CXX_NAME = pic32-g++ -AR_NAME = pic32-ar -OBJDUMP_NAME = pic32-objdump -OBJCOPY_NAME = pic32-objcopy -SIZE_NAME = pic32-size -NM_NAME = pic32-nm - -OVERRIDE_EXECUTABLES = 1 -CC = $(PIC32_TOOLS_PATH)/$(CC_NAME) -CXX = $(PIC32_TOOLS_PATH)/$(CXX_NAME) -AS = $(PIC32_TOOLS_PATH)/$(AS_NAME) -OBJCOPY = $(PIC32_TOOLS_PATH)/$(OBJCOPY_NAME) -OBJDUMP = $(PIC32_TOOLS_PATH)/$(OBJDUMP_NAME) -AR = $(PIC32_TOOLS_PATH)/$(AR_NAME) -SIZE = $(PIC32_TOOLS_PATH)/$(SIZE_NAME) -NM = $(PIC32_TOOLS_PATH)/$(NM_NAME) - -LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript) -LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT) - -MCU_FLAG_NAME=mprocessor -LDFLAGS += -mdebugger -mno-peripheral-libs -nostartfiles -Wl,--gc-sections -LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/$(LDSCRIPT) -LINKER_SCRIPTS += -T $(ARDUINO_CORE_PATH)/chipKIT-application-COMMON.ld -CPPFLAGS += -mno-smart-io -fno-short-double -fframe-base-loclist \ - -g3 -Wcast-align -D_BOARD_MEGA_ -CFLAGS_STD = - -include $(ARDMK_DIR)/Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/.gitignore b/arduino/Arduino-Makefile/examples/.gitignore deleted file mode 100644 index dd07bff..0000000 --- a/arduino/Arduino-Makefile/examples/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build-* diff --git a/arduino/Arduino-Makefile/examples/ATtinyBlink/ATtinyBlink.ino b/arduino/Arduino-Makefile/examples/ATtinyBlink/ATtinyBlink.ino deleted file mode 100644 index 1d1566d..0000000 --- a/arduino/Arduino-Makefile/examples/ATtinyBlink/ATtinyBlink.ino +++ /dev/null @@ -1,23 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - This example code is in the public domain. - */ - -// Connect a LED to Pin 3. It might be different in different ATtiny micro controllers -int led = 3; - -// the setup routine runs once when you press reset: -void setup() { - // initialize the digital pin as an output. - pinMode(led, OUTPUT); -} - -// the loop routine runs over and over again forever: -void loop() { - digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(led, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -} diff --git a/arduino/Arduino-Makefile/examples/ATtinyBlink/Makefile b/arduino/Arduino-Makefile/examples/ATtinyBlink/Makefile deleted file mode 100644 index b4e49be..0000000 --- a/arduino/Arduino-Makefile/examples/ATtinyBlink/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone. -ALTERNATE_CORE = attiny -# If not, you might have to include the full path. -#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/ - -BOARD_TAG = attiny85-8 -ISP_PORT = /dev/ttyACM* - -include $(ARDMK_DIR)/Arduino.mk - -# !!! Important. You have to use make ispload to upload when using ISP programmer diff --git a/arduino/Arduino-Makefile/examples/AnalogInOutSerial/AnalogInOutSerial.ino b/arduino/Arduino-Makefile/examples/AnalogInOutSerial/AnalogInOutSerial.ino deleted file mode 100644 index e142f69..0000000 --- a/arduino/Arduino-Makefile/examples/AnalogInOutSerial/AnalogInOutSerial.ino +++ /dev/null @@ -1,53 +0,0 @@ -/* - Analog input, analog output, serial output - - Reads an analog input pin, maps the result to a range from 0 to 255 - and uses the result to set the pulsewidth modulation (PWM) of an output pin. - Also prints the results to the serial monitor. - - The circuit: - * potentiometer connected to analog pin 0. - Center pin of the potentiometer goes to the analog pin. - side pins of the potentiometer go to +5V and ground - * LED connected from digital pin 9 to ground - - created 29 Dec. 2008 - modified 30 Aug 2011 - by Tom Igoe - - This example code is in the public domain. - - */ - -// These constants won't change. They're used to give names -// to the pins used: -const int analogInPin = A0; // Analog input pin that the potentiometer is attached to -const int analogOutPin = 9; // Analog output pin that the LED is attached to - -int sensorValue = 0; // value read from the pot -int outputValue = 0; // value output to the PWM (analog out) - -void setup() { - // initialize serial communications at 9600 bps: - Serial.begin(9600); -} - -void loop() { - // read the analog in value: - sensorValue = analogRead(analogInPin); - // map it to the range of the analog out: - outputValue = map(sensorValue, 0, 1023, 0, 255); - // change the analog out value: - analogWrite(analogOutPin, outputValue); - - // print the results to the serial monitor: - Serial.print("sensor = " ); - Serial.print(sensorValue); - Serial.print("\t output = "); - Serial.println(outputValue); - - // wait 10 milliseconds before the next loop - // for the analog-to-digital converter to settle - // after the last reading: - delay(10); -} diff --git a/arduino/Arduino-Makefile/examples/AnalogInOutSerial/Makefile b/arduino/Arduino-Makefile/examples/AnalogInOutSerial/Makefile deleted file mode 100644 index 3dea6c0..0000000 --- a/arduino/Arduino-Makefile/examples/AnalogInOutSerial/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = uno -ARDUINO_LIBS = - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/Blink/Blink.ino b/arduino/Arduino-Makefile/examples/Blink/Blink.ino deleted file mode 100644 index 6a8ba71..0000000 --- a/arduino/Arduino-Makefile/examples/Blink/Blink.ino +++ /dev/null @@ -1,18 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - This example code is in the public domain. - */ - -void setup() { - // initialize the digital pin as an output. - // Pin 13 has an LED connected on most Arduino boards: - pinMode(13, OUTPUT); -} - -void loop() { - digitalWrite(13, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(13, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/arduino/Arduino-Makefile/examples/Blink/Makefile b/arduino/Arduino-Makefile/examples/Blink/Makefile deleted file mode 100644 index c26b797..0000000 --- a/arduino/Arduino-Makefile/examples/Blink/Makefile +++ /dev/null @@ -1,130 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -BOARD_TAG = uno -include ../../Arduino.mk - - - -# --- leonardo (or pro micro w/leo bootloader) -#BOARD_TAG = leonardo -#MONITOR_PORT = /dev/ttyACM0 -#include /usr/share/arduino/Arduino.mk - -# --- mega2560 ide 1.0 -#BOARD_TAG = mega2560 -#ARDUINO_PORT = /dev/ttyACM0 -#include /usr/share/arduino/Arduino.mk - -# --- mega2560 ide 1.6 -#BOARD_TAG = mega -#BOARD_SUB = atmega2560 -#MONITOR_PORT = /dev/ttyACM0 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- nano ide 1.0 -#BOARD_TAG = nano328 -#MONITOR_PORT = /dev/ttyUSB0 -#include /usr/share/arduino/Arduino.mk - -# --- nano ide 1.6 -#BOARD_TAG = nano -#BOARD_SUB = atmega328 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- pro mini -#BOARD_TAG = pro5v328 -#MONITOR_PORT = /dev/ttyUSB0 -#include /usr/share/arduino/Arduino.mk - -# --- sparkfun pro micro -#BOARD_TAG = promicro16 -#ALTERNATE_CORE = promicro -#BOARDS_TXT = $(HOME)/arduino/hardware/promicro/boards.txt -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/promicro/bootloaders -#BOOTLOADER_PATH = caterina -#BOOTLOADER_FILE = Caterina-promicro16.hex -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- chipkit -#BOARD_TAG = mega_pic32 -#MPIDE_DIR = /where/you/installed/mpide-0023-linux64-20130817-test -#include /usr/share/arduino/chipKIT.mk - -# --- pinoccio -#BOARD_TAG = pinoccio256 -#ALTERNATE_CORE = pinoccio -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/pinoccio/bootloaders -#BOOTLOADER_PATH = STK500RFR2/release_0.51 -#BOOTLOADER_FILE = boot_pinoccio.hex -#CFLAGS_STD = -std=gnu99 -#CXXFLAGS_STD = -std=gnu++11 -#include /usr/share/arduino/Arduino.mk - -# --- fio -#BOARD_TAG = fio -#include /usr/share/arduino/Arduino.mk - -# --- atmega-ng ide 1.6 -#BOARD_TAG = atmegang -#BOARD_SUB = atmega168 -#MONITOR_PORT = /dev/ttyACM0 -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- arduino-tiny ide 1.0 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85at8 -#ALTERNATE_CORE = tiny -#ARDUINO_VAR_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny -#ARDUINO_CORE_PATH = $(HOME)/arduino/hardware/tiny/cores/tiny -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- arduino-tiny ide 1.6 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85at8 -#ALTERNATE_CORE = tiny -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- damellis attiny ide 1.0 -#ISP_PROG = usbasp -#BOARD_TAG = attiny85 -#ALTERNATE_CORE = attiny-master -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- damellis attiny ide 1.6 -#ISP_PROG = usbasp -#BOARD_TAG = attiny -#BOARD_SUB = attiny85 -#ALTERNATE_CORE = attiny -#F_CPU = 16000000L -#ARDUINO_DIR = /where/you/installed/arduino-1.6.5 -#include /usr/share/arduino/Arduino.mk - -# --- teensy3 -#BOARD_TAG = teensy31 -#ARDUINO_DIR = /where/you/installed/the/patched/teensy/arduino-1.0.6 -#include /usr/share/arduino/Teensy.mk - -# --- mighty 1284p -#BOARD_TAG = mighty_opt -#BOARDS_TXT = $(HOME)/arduino/hardware/mighty-1284p/boards.txt -#BOOTLOADER_PARENT = $(HOME)/arduino/hardware/mighty-1284p/bootloaders -#BOOTLOADER_PATH = optiboot -#BOOTLOADER_FILE = optiboot_atmega1284p.hex -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#include /usr/share/arduino/Arduino.mk - -# --- atmega328p on breadboard -#BOARD_TAG = atmega328bb -#ISP_PROG = usbasp -#AVRDUDE_OPTS = -v -#BOARDS_TXT = $(HOME)/arduino/hardware/breadboard/boards.txt -#include /usr/share/arduino/Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/BlinkChipKIT/BlinkChipKIT.pde b/arduino/Arduino-Makefile/examples/BlinkChipKIT/BlinkChipKIT.pde deleted file mode 100644 index 1953c39..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkChipKIT/BlinkChipKIT.pde +++ /dev/null @@ -1,19 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - This example code is in the public domain. - */ - -void setup() { - // initialize the digital pin as an output. - // Pin 13 has an LED connected on most Arduino boards: - pinMode(13, OUTPUT); -} - -void loop() { - digitalWrite(13, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(13, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/arduino/Arduino-Makefile/examples/BlinkChipKIT/Makefile b/arduino/Arduino-Makefile/examples/BlinkChipKIT/Makefile deleted file mode 100644 index 87a9f7d..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkChipKIT/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -BOARD_TAG = mega_pic32 -ARDUINO_LIBS = - -include ../../chipKIT.mk - diff --git a/arduino/Arduino-Makefile/examples/BlinkInAVRC/Makefile b/arduino/Arduino-Makefile/examples/BlinkInAVRC/Makefile deleted file mode 100644 index a4cd2e4..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkInAVRC/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# This sample Makefile, explains how you can compile plain AVR C file. -# -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -NO_CORE = Yes - -BOARD_TAG = atmega16 -MCU = atmega16 -F_CPU = 8000000L - -ISP_PROG = stk500v1 -AVRDUDE_ISP_BAUDRATE = 19200 - -include ../../Arduino.mk - -# !!! Important. You have to use make ispload to upload when using ISP programmer diff --git a/arduino/Arduino-Makefile/examples/BlinkInAVRC/blink.c b/arduino/Arduino-Makefile/examples/BlinkInAVRC/blink.c deleted file mode 100644 index 472a09c..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkInAVRC/blink.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (c) Anil Kumar Pugalia, 2010. Email: email@sarika-pugs.com - * - * ATmega48/88/168, ATmega16/32 - * - * Example Blink. Toggles all IO pins at 1Hz - */ - -#include -#include - -void init_io(void) -{ - // 1 = output, 0 = input - DDRB = 0b11111111; // All outputs - DDRC = 0b11111111; // All outputs - DDRD = 0b11111110; // PORTD (RX on PD0). Just for demo -} - -int main(void) -{ - init_io(); - - while (1) - { - PORTC = 0xFF; - PORTB = 0xFF; - PORTD = 0xFF; - _delay_ms(500); - - PORTC = 0x00; - PORTB = 0x00; - PORTD = 0x00; - _delay_ms(500); - } - - return 0; -} diff --git a/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/ATtinyBlink.ino b/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/ATtinyBlink.ino deleted file mode 100644 index 6e3c27d..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/ATtinyBlink.ino +++ /dev/null @@ -1,23 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - This example code is in the public domain. - */ - -// Connect a LED to Pin 3. It might be different in different ATtiny micro controllers -int led = 3; - -// the setup routine runs once when you press reset: -void setup() { - // initialize the digital pin as an output. - pinMode(led, OUTPUT); -} - -// the loop routine runs over and over again forever: -void loop() { - digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(led, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -} diff --git a/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/Makefile b/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/Makefile deleted file mode 100644 index 15e565e..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkNetworkRPi/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -# Tested and working with a linuxspi programmer on a remote Raspberry Pi -# Refer to https://github.com/kcuzner/avrdude for linuxspi. -# Should work with ISP as well if you replace $(AVRDUDE_ARD_OPTS) with -# $(AVRDUDE_ISP_OPTS) in the net_set_fuses rule. - -# Alternate core from https://code.google.com/p/arduino-tiny -ALTERNATE_CORE = tiny -BOARD_TAG = attiny85at8 - -# Avrdude config path on the remote Raspberry Pi -AVRDUDE_CONF=/usr/local/etc/avrdude.conf - -# Skip the monitor port existance check since it's not on our machine. -FORCE_MONITOR_PORT=true -MONITOR_PORT=/dev/spidev0.0 - -include ../../Arduino.mk - - -# Additional rules to use a remote Raspberry Pi programmer - -# Note that it's recommended not to use root for this task, -# but to setup spidev access on a normal user instead. -HOST = root@alarmpi -SSH_AVRDUDE = ssh $(HOST) /usr/local/bin/avrdude - -CAT_HEX = cat $(TARGET_HEX) -AVRDUDE_UPLOAD_PIPE = -U flash:w:-:i - -.PHONY: net_upload net_set_fuses - -net_upload: $(TARGET_HEX) verify_size - $(CAT_HEX) | $(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \ - $(AVRDUDE_UPLOAD_PIPE) - -net_set_fuses: -ifneq ($(strip $(AVRDUDE_ISP_FUSES_PRE)),) - $(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) -e \ - $(AVRDUDE_ISP_FUSES_PRE) -endif -ifneq ($(strip $(AVRDUDE_ISP_FUSES_POST)),) - $(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \ - $(AVRDUDE_ISP_FUSES_POST) -endif diff --git a/arduino/Arduino-Makefile/examples/BlinkTeensy/Blink.ino b/arduino/Arduino-Makefile/examples/BlinkTeensy/Blink.ino deleted file mode 100644 index f9a59a9..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkTeensy/Blink.ino +++ /dev/null @@ -1,19 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - This example code is in the public domain. - */ - -void setup() { - // initialize the digital pin as an output. - // Pin 13 has an LED connected on most Arduino boards: - pinMode(13, OUTPUT); -} - -void loop() { - digitalWrite(13, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(13, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/arduino/Arduino-Makefile/examples/BlinkTeensy/Makefile b/arduino/Arduino-Makefile/examples/BlinkTeensy/Makefile deleted file mode 100644 index 1d59ef2..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkTeensy/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = teensy31 -ARDUINO_LIBS = - -include ../../Teensy.mk diff --git a/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino deleted file mode 100644 index 0143571..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ /dev/null @@ -1,65 +0,0 @@ -/* Blink without Delay - - Turns on and off a light emitting diode(LED) connected to a digital - pin, without using the delay() function. This means that other code - can run at the same time without being interrupted by the LED code. - - The circuit: - * LED attached from pin 13 to ground. - * Note: on most Arduinos, there is already an LED on the board - that's attached to pin 13, so no hardware is needed for this example. - - - created 2005 - by David A. Mellis - modified 8 Feb 2010 - by Paul Stoffregen - - This example code is in the public domain. - - - http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay - */ - -// constants won't change. Used here to -// set pin numbers: -const int ledPin = 13; // the number of the LED pin - -// Variables will change: -int ledState = LOW; // ledState used to set the LED -long previousMillis = 0; // will store last time LED was updated - -// the follow variables is a long because the time, measured in miliseconds, -// will quickly become a bigger number than can be stored in an int. -long interval = 1000; // interval at which to blink (milliseconds) - -void setup() { - // set the digital pin as output: - pinMode(ledPin, OUTPUT); -} - -void loop() -{ - // here is where you'd put code that needs to be running all the time. - - // check to see if it's time to blink the LED; that is, if the - // difference between the current time and last time you blinked - // the LED is bigger than the interval at which you want to - // blink the LED. - unsigned long currentMillis = millis(); - - if(currentMillis - previousMillis > interval) { - // save the last time you blinked the LED - previousMillis = currentMillis; - - // if the LED is off turn it on and vice-versa: - if (ledState == LOW) - ledState = HIGH; - else - ledState = LOW; - - // set the LED with the ledState of the variable: - digitalWrite(ledPin, ledState); - } -} - diff --git a/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/Makefile b/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/Makefile deleted file mode 100644 index 3dea6c0..0000000 --- a/arduino/Arduino-Makefile/examples/BlinkWithoutDelay/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = uno -ARDUINO_LIBS = - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/Fade/Fade.ino b/arduino/Arduino-Makefile/examples/Fade/Fade.ino deleted file mode 100644 index b47bf43..0000000 --- a/arduino/Arduino-Makefile/examples/Fade/Fade.ino +++ /dev/null @@ -1,31 +0,0 @@ -/* - Fade - - This example shows how to fade an LED on pin 9 - using the analogWrite() function. - - This example code is in the public domain. - - */ -int brightness = 0; // how bright the LED is -int fadeAmount = 5; // how many points to fade the LED by - -void setup() { - // declare pin 9 to be an output: - pinMode(9, OUTPUT); -} - -void loop() { - // set the brightness of pin 9: - analogWrite(9, brightness); - - // change the brightness for next time through the loop: - brightness = brightness + fadeAmount; - - // reverse the direction of the fading at the ends of the fade: - if (brightness == 0 || brightness == 255) { - fadeAmount = -fadeAmount ; - } - // wait for 30 milliseconds to see the dimming effect - delay(30); -} diff --git a/arduino/Arduino-Makefile/examples/Fade/Makefile b/arduino/Arduino-Makefile/examples/Fade/Makefile deleted file mode 100644 index 3dea6c0..0000000 --- a/arduino/Arduino-Makefile/examples/Fade/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = uno -ARDUINO_LIBS = - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/HelloWorld/HelloWorld.ino b/arduino/Arduino-Makefile/examples/HelloWorld/HelloWorld.ino deleted file mode 100644 index e99957d..0000000 --- a/arduino/Arduino-Makefile/examples/HelloWorld/HelloWorld.ino +++ /dev/null @@ -1,58 +0,0 @@ -/* - LiquidCrystal Library - Hello World - - Demonstrates the use a 16x2 LCD display. The LiquidCrystal - library works with all LCD displays that are compatible with the - Hitachi HD44780 driver. There are many of them out there, and you - can usually tell them by the 16-pin interface. - - This sketch prints "Hello World!" to the LCD - and shows the time. - - The circuit: - * LCD RS pin to digital pin 12 - * LCD Enable pin to digital pin 11 - * LCD D4 pin to digital pin 5 - * LCD D5 pin to digital pin 4 - * LCD D6 pin to digital pin 3 - * LCD D7 pin to digital pin 2 - * LCD R/W pin to ground - * 10K resistor: - * ends to +5V and ground - * wiper to LCD VO pin (pin 3) - - Library originally added 18 Apr 2008 - by David A. Mellis - library modified 5 Jul 2009 - by Limor Fried (http://www.ladyada.net) - example added 9 Jul 2009 - by Tom Igoe - modified 22 Nov 2010 - by Tom Igoe - - This example code is in the public domain. - - http://www.arduino.cc/en/Tutorial/LiquidCrystal - */ - -// include the library code: -#include - -// initialize the library with the numbers of the interface pins -LiquidCrystal lcd(12, 11, 5, 4, 3, 2); - -void setup() { - // set up the LCD's number of columns and rows: - lcd.begin(16, 2); - // Print a message to the LCD. - lcd.print("hello, world!"); -} - -void loop() { - // set the cursor to column 0, line 1 - // (note: line 1 is the second row, since counting begins with 0): - lcd.setCursor(0, 1); - // print the number of seconds since reset: - lcd.print(millis()/1000); -} - diff --git a/arduino/Arduino-Makefile/examples/HelloWorld/Makefile b/arduino/Arduino-Makefile/examples/HelloWorld/Makefile deleted file mode 100644 index fb94fdd..0000000 --- a/arduino/Arduino-Makefile/examples/HelloWorld/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = uno -ARDUINO_LIBS = LiquidCrystal - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/MakefileExample/Makefile-example.mk b/arduino/Arduino-Makefile/examples/MakefileExample/Makefile-example.mk deleted file mode 100644 index 34c080f..0000000 --- a/arduino/Arduino-Makefile/examples/MakefileExample/Makefile-example.mk +++ /dev/null @@ -1,74 +0,0 @@ -### DISCLAIMER -### This is an example Makefile and it MUST be configured to suit your needs. -### For detailed explanations about all of the available options, please refer -### to https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md -### Original project where this Makefile comes from: https://github.com/WeAreLeka/Bare-Arduino-Project - -### PROJECT_DIR -### This is the path to where you have created/cloned your project -PROJECT_DIR = /Users/MyUserName/path/to/my/Project - -### ARDMK_DIR -### Path to the Arduino-Makefile directory. -ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile - -### ARDUINO_DIR -### Path to the Arduino application and resources directory. -### On OS X: -ARDUINO_DIR = /Applications/Arduino.app/Contents/Java -### or on Linux: (remove the one you don't want) -ARDUINO_DIR = /usr/share/arduino - -### USER_LIB_PATH -### Path to where the your project's libraries are stored. -USER_LIB_PATH := $(PROJECT_DIR)/lib - -### BOARD_TAG -### It must be set to the board you are currently using. (i.e uno, mega2560, etc.) -BOARD_TAG = uno - -### MONITOR_BAUDRATE -### It must be set to Serial baudrate value you are using. -MONITOR_BAUDRATE = 115200 - -### AVR_TOOLS_DIR -### Path to the AVR tools directory such as avr-gcc, avr-g++, etc. -### On OS X with `homebrew`: -AVR_TOOLS_DIR = /usr/local -### or on Linux: (remove the one you don't want) -AVR_TOOLS_DIR = /usr - -### AVRDUDE -### Path to avrdude directory. -### On OS X with `homebrew`: -AVRDUDE = /usr/local/bin/avrdude -### or on Linux: (remove the one you don't want) -AVRDUDE = /usr/bin/avrdude - -### CFLAGS_STD -### Set the C standard to be used during compilation. Documentation (https://github.com/WeAreLeka/Arduino-Makefile/blob/std-flags/arduino-mk-vars.md#cflags_std) -CFLAGS_STD = -std=gnu11 - -### CXXFLAGS_STD -### Set the C++ standard to be used during compilation. Documentation (https://github.com/WeAreLeka/Arduino-Makefile/blob/std-flags/arduino-mk-vars.md#cxxflags_std) -CXXFLAGS_STD = -std=gnu++11 - -### CXXFLAGS -### Flags you might want to set for debugging purpose. Comment to stop. -CXXFLAGS += -pedantic -Wall -Wextra - -### MONITOR_PORT -### The port your board is connected to. Using an '*' tries all the ports and finds the right one. -MONITOR_PORT = /dev/tty.usbmodem* - -### CURRENT_DIR -### Do not touch - used for binaries path -CURRENT_DIR = $(shell basename $(CURDIR)) - -### OBJDIR -### This is where you put the binaries you just compile using 'make' -OBJDIR = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR) - -### Do not touch - the path to Arduino.mk, inside the ARDMK_DIR -include $(ARDMK_DIR)/Arduino.mk - diff --git a/arduino/Arduino-Makefile/examples/README.md b/arduino/Arduino-Makefile/examples/README.md deleted file mode 100644 index 631704d..0000000 --- a/arduino/Arduino-Makefile/examples/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This folder contains the list of example Arduino sketches and makefile showing -the different usage patterns - -- BlinkInAVRC - Shows how to use plain AVR C code -- ATtinyBlink - Shows how to use different cores like ATtiny -- Blink - Shows normal usage -- HelloWorld - Shows how to include Arduino libraries -- SerialPrint - Shows how serial monitor can be used -- BlinkChipKIT - Shows how to use ChipKIT diff --git a/arduino/Arduino-Makefile/examples/SerialPrint/Makefile b/arduino/Arduino-Makefile/examples/SerialPrint/Makefile deleted file mode 100644 index f9d5cf4..0000000 --- a/arduino/Arduino-Makefile/examples/SerialPrint/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -BOARD_TAG = uno - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/SerialPrint/SerialPrint.ino b/arduino/Arduino-Makefile/examples/SerialPrint/SerialPrint.ino deleted file mode 100644 index e129c9d..0000000 --- a/arduino/Arduino-Makefile/examples/SerialPrint/SerialPrint.ino +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - Serial.begin(9600); - Serial.print("Press any key: "); -} - -void loop() { - if (Serial.available()) { - Serial.println(Serial.read()); - } -} diff --git a/arduino/Arduino-Makefile/examples/TinySoftWareSerial/Makefile b/arduino/Arduino-Makefile/examples/TinySoftWareSerial/Makefile deleted file mode 100644 index ffe3afc..0000000 --- a/arduino/Arduino-Makefile/examples/TinySoftWareSerial/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -# if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone. -ALTERNATE_CORE = attiny -# If not, you might have to include the full path. -#ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/ - -# !!! Important. You have to use "make ispload" to upload when using ISP programmer -ISP_PROG = usbasp - -# 1.5+ example of submenu cpu -BOARD_TAG = attiny -BOARD_SUB = attiny85 - -# clock is a submenu too -F_CPU = 16000000L - -ARDUINO_LIBS = SoftwareSerial - -include /usr/share/arduino/Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/TinySoftWareSerial/TinySoftwareSerial.ino b/arduino/Arduino-Makefile/examples/TinySoftWareSerial/TinySoftwareSerial.ino deleted file mode 100644 index a53e059..0000000 --- a/arduino/Arduino-Makefile/examples/TinySoftWareSerial/TinySoftwareSerial.ino +++ /dev/null @@ -1,12 +0,0 @@ -#include - -SoftwareSerial mySerial(3, 4); // RX, TX - -void setup() { - mySerial.begin(9600); -} - -void loop() { - mySerial.println(millis()); - delay(1000); -} diff --git a/arduino/Arduino-Makefile/examples/WebServer/Makefile b/arduino/Arduino-Makefile/examples/WebServer/Makefile deleted file mode 100644 index 51b9ac2..0000000 --- a/arduino/Arduino-Makefile/examples/WebServer/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -BOARD_TAG = uno -ARDUINO_LIBS = Ethernet SPI - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/WebServer/WebServer.ino b/arduino/Arduino-Makefile/examples/WebServer/WebServer.ino deleted file mode 100644 index fb2a1b9..0000000 --- a/arduino/Arduino-Makefile/examples/WebServer/WebServer.ino +++ /dev/null @@ -1,82 +0,0 @@ -/* - Web Server - - A simple web server that shows the value of the analog input pins. - using an Arduino Wiznet Ethernet shield. - - Circuit: - * Ethernet shield attached to pins 10, 11, 12, 13 - * Analog inputs attached to pins A0 through A5 (optional) - - created 18 Dec 2009 - by David A. Mellis - modified 4 Sep 2010 - by Tom Igoe - - */ - -#include -#include - -// Enter a MAC address and IP address for your controller below. -// The IP address will be dependent on your local network: -byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; -IPAddress ip(192,168,1, 178); - -// Initialize the Ethernet server library -// with the IP address and port you want to use -// (port 80 is default for HTTP): -EthernetServer server(80); - -void setup() -{ - // start the Ethernet connection and the server: - Ethernet.begin(mac, ip); - server.begin(); -} - -void loop() -{ - // listen for incoming clients - EthernetClient client = server.available(); - if (client) { - // an http request ends with a blank line - boolean currentLineIsBlank = true; - while (client.connected()) { - if (client.available()) { - char c = client.read(); - // if you've gotten to the end of the line (received a newline - // character) and the line is blank, the http request has ended, - // so you can send a reply - if (c == '\n' && currentLineIsBlank) { - // send a standard http response header - client.println("HTTP/1.1 200 OK"); - client.println("Content-Type: text/html"); - client.println(); - - // output the value of each analog input pin - for (int analogChannel = 0; analogChannel < 6; analogChannel++) { - client.print("analog input "); - client.print(analogChannel); - client.print(" is "); - client.print(analogRead(analogChannel)); - client.println("
"); - } - break; - } - if (c == '\n') { - // you're starting a new line - currentLineIsBlank = true; - } - else if (c != '\r') { - // you've gotten a character on the current line - currentLineIsBlank = false; - } - } - } - // give the web browser time to receive the data - delay(1); - // close the connection: - client.stop(); - } -} diff --git a/arduino/Arduino-Makefile/examples/master_reader/Makefile b/arduino/Arduino-Makefile/examples/master_reader/Makefile deleted file mode 100644 index 3030deb..0000000 --- a/arduino/Arduino-Makefile/examples/master_reader/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile - -BOARD_TAG = uno -ARDUINO_LIBS = Wire - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/master_reader/master_reader.ino b/arduino/Arduino-Makefile/examples/master_reader/master_reader.ino deleted file mode 100644 index 4124d7d..0000000 --- a/arduino/Arduino-Makefile/examples/master_reader/master_reader.ino +++ /dev/null @@ -1,32 +0,0 @@ -// Wire Master Reader -// by Nicholas Zambetti - -// Demonstrates use of the Wire library -// Reads data from an I2C/TWI slave device -// Refer to the "Wire Slave Sender" example for use with this - -// Created 29 March 2006 - -// This example code is in the public domain. - - -#include - -void setup() -{ - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial for output -} - -void loop() -{ - Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 - - while(Wire.available()) // slave may send less than requested - { - char c = Wire.read(); // receive a byte as character - Serial.print(c); // print the character - } - - delay(500); -} diff --git a/arduino/Arduino-Makefile/examples/toneMelody/Makefile b/arduino/Arduino-Makefile/examples/toneMelody/Makefile deleted file mode 100644 index 3dea6c0..0000000 --- a/arduino/Arduino-Makefile/examples/toneMelody/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD_TAG = uno -ARDUINO_LIBS = - -include ../../Arduino.mk diff --git a/arduino/Arduino-Makefile/examples/toneMelody/pitches.h b/arduino/Arduino-Makefile/examples/toneMelody/pitches.h deleted file mode 100644 index 55c7d54..0000000 --- a/arduino/Arduino-Makefile/examples/toneMelody/pitches.h +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************* - * Public Constants - *************************************************/ - -#define NOTE_B0 31 -#define NOTE_C1 33 -#define NOTE_CS1 35 -#define NOTE_D1 37 -#define NOTE_DS1 39 -#define NOTE_E1 41 -#define NOTE_F1 44 -#define NOTE_FS1 46 -#define NOTE_G1 49 -#define NOTE_GS1 52 -#define NOTE_A1 55 -#define NOTE_AS1 58 -#define NOTE_B1 62 -#define NOTE_C2 65 -#define NOTE_CS2 69 -#define NOTE_D2 73 -#define NOTE_DS2 78 -#define NOTE_E2 82 -#define NOTE_F2 87 -#define NOTE_FS2 93 -#define NOTE_G2 98 -#define NOTE_GS2 104 -#define NOTE_A2 110 -#define NOTE_AS2 117 -#define NOTE_B2 123 -#define NOTE_C3 131 -#define NOTE_CS3 139 -#define NOTE_D3 147 -#define NOTE_DS3 156 -#define NOTE_E3 165 -#define NOTE_F3 175 -#define NOTE_FS3 185 -#define NOTE_G3 196 -#define NOTE_GS3 208 -#define NOTE_A3 220 -#define NOTE_AS3 233 -#define NOTE_B3 247 -#define NOTE_C4 262 -#define NOTE_CS4 277 -#define NOTE_D4 294 -#define NOTE_DS4 311 -#define NOTE_E4 330 -#define NOTE_F4 349 -#define NOTE_FS4 370 -#define NOTE_G4 392 -#define NOTE_GS4 415 -#define NOTE_A4 440 -#define NOTE_AS4 466 -#define NOTE_B4 494 -#define NOTE_C5 523 -#define NOTE_CS5 554 -#define NOTE_D5 587 -#define NOTE_DS5 622 -#define NOTE_E5 659 -#define NOTE_F5 698 -#define NOTE_FS5 740 -#define NOTE_G5 784 -#define NOTE_GS5 831 -#define NOTE_A5 880 -#define NOTE_AS5 932 -#define NOTE_B5 988 -#define NOTE_C6 1047 -#define NOTE_CS6 1109 -#define NOTE_D6 1175 -#define NOTE_DS6 1245 -#define NOTE_E6 1319 -#define NOTE_F6 1397 -#define NOTE_FS6 1480 -#define NOTE_G6 1568 -#define NOTE_GS6 1661 -#define NOTE_A6 1760 -#define NOTE_AS6 1865 -#define NOTE_B6 1976 -#define NOTE_C7 2093 -#define NOTE_CS7 2217 -#define NOTE_D7 2349 -#define NOTE_DS7 2489 -#define NOTE_E7 2637 -#define NOTE_F7 2794 -#define NOTE_FS7 2960 -#define NOTE_G7 3136 -#define NOTE_GS7 3322 -#define NOTE_A7 3520 -#define NOTE_AS7 3729 -#define NOTE_B7 3951 -#define NOTE_C8 4186 -#define NOTE_CS8 4435 -#define NOTE_D8 4699 -#define NOTE_DS8 4978 - - diff --git a/arduino/Arduino-Makefile/examples/toneMelody/toneMelody.ino b/arduino/Arduino-Makefile/examples/toneMelody/toneMelody.ino deleted file mode 100644 index 8593ab7..0000000 --- a/arduino/Arduino-Makefile/examples/toneMelody/toneMelody.ino +++ /dev/null @@ -1,49 +0,0 @@ -/* - Melody - - Plays a melody - - circuit: - * 8-ohm speaker on digital pin 8 - - created 21 Jan 2010 - modified 30 Aug 2011 - by Tom Igoe - -This example code is in the public domain. - - http://arduino.cc/en/Tutorial/Tone - - */ - #include "pitches.h" - -// notes in the melody: -int melody[] = { - NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4}; - -// note durations: 4 = quarter note, 8 = eighth note, etc.: -int noteDurations[] = { - 4, 8, 8, 4,4,4,4,4 }; - -void setup() { - // iterate over the notes of the melody: - for (int thisNote = 0; thisNote < 8; thisNote++) { - - // to calculate the note duration, take one second - // divided by the note type. - //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc. - int noteDuration = 1000/noteDurations[thisNote]; - tone(8, melody[thisNote],noteDuration); - - // to distinguish the notes, set a minimum time between them. - // the note's duration + 30% seems to work well: - int pauseBetweenNotes = noteDuration * 1.30; - delay(pauseBetweenNotes); - // stop the tone playing: - noTone(8); - } -} - -void loop() { - // no need to repeat the melody. -} diff --git a/arduino/Arduino-Makefile/licence.txt b/arduino/Arduino-Makefile/licence.txt deleted file mode 100644 index 4362b49..0000000 --- a/arduino/Arduino-Makefile/licence.txt +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/arduino/Arduino-Makefile/packaging/debian/README.md b/arduino/Arduino-Makefile/packaging/debian/README.md deleted file mode 100644 index 44dcaa6..0000000 --- a/arduino/Arduino-Makefile/packaging/debian/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# How to compile a Deb package - -Use these instructions to build your own Deb package from your local sources. -For the latest official packages go to [Debian](http://packages.debian.org/arduino-mk) -or [Ubuntu](https://launchpad.net/ubuntu/+source/arduino-mk) or use apt. - -First install the dependencies as root: - - apt-get build-dep arduino-mk - apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts - -Fetch the Debian source: - - apt-get source arduino-mk - -Make any local changes to want within the arduino-mk-* directory and update the package version: - - cd arduino-mk-* - dch -i - -Then compile. This will create a binary Deb: - - dpkg-buildpackage -b diff --git a/arduino/Arduino-Makefile/packaging/fedora/README.md b/arduino/Arduino-Makefile/packaging/fedora/README.md deleted file mode 100644 index ddd47cf..0000000 --- a/arduino/Arduino-Makefile/packaging/fedora/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# How to compile an RPM - -First install the dependencies as root: - -```sh - yum install arduino-core rpm-build - - # or on Fedora 22+ - - dnf install arduino-core rpmdevtools -``` - -From the top-level Arduino-Makefile directory you've checked out of github, run the following (as unprivileged user) to create a compressed tarball using the naming conventions required by rpmbuild: - - git archive HEAD --prefix=arduino-mk-1.5/ -o ../arduino-mk-1.5.tar.gz - -If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM) you will need to create the directories: - - mkdir -p ~/rpmbuild/{SOURCES,SPECS} - -Then copy the tarball and specfile into those directories: - - cp ../arduino-mk-1.5.tar.gz ~/rpmbuild/SOURCES/ - cp packaging/fedora/arduino-mk.spec ~/rpmbuild/SPECS/ - -Then compile. This will create a binary and source RPM: - - cd ~/rpmbuild/SPECS/ - rpmbuild -ba arduino-mk.spec - -Fedora's AVR compilers use ccache, so you may have to override some of the paths to the AVR tools in your sketch's Makefile, for example: - -```Makefile -OVERRIDE_EXECUTABLES = 1 -CC = /usr/lib64/ccache/$(CC_NAME) -CXX = /usr/lib64/ccache/$(CXX_NAME) -AS = /usr/bin/$(AS_NAME) -OBJCOPY = /usr/bin/$(OBJCOPY_NAME) -OBJDUMP = /usr/bin/$(OBJDUMP_NAME) -AR = /usr/bin/$(AR_NAME) -SIZE = /usr/bin/$(SIZE_NAME) -NM = /usr/bin/$(NM_NAME) -``` - -Or if you don't want to use ccache, then just set ```AVR_TOOLS_PATH=/usr``` and none of the above will be necessary. diff --git a/arduino/Arduino-Makefile/packaging/fedora/arduino-mk.spec b/arduino/Arduino-Makefile/packaging/fedora/arduino-mk.spec deleted file mode 100644 index 326ea0a..0000000 --- a/arduino/Arduino-Makefile/packaging/fedora/arduino-mk.spec +++ /dev/null @@ -1,70 +0,0 @@ -Name: arduino-mk -Version: 1.5.2 -Release: 1%{dist} -Summary: Program your Arduino from the command line -Packager: Simon John -URL: https://github.com/sudar/Arduino-Makefile -Source: %{name}-%{version}.tar.gz -Group: Development/Tools -License: LGPLv2+ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch -Requires: arduino-core pyserial -BuildRequires: arduino-core - -%description -Arduino is an open-source electronics prototyping platform based on -flexible, easy-to-use hardware and software. It's intended for artists, -designers, hobbyists, and anyone interested in creating interactive -objects or environments. - -This package will install a Makefile to allow for CLI programming of the -Arduino platform. - -%prep -%setup -q - -%install -mkdir -p %{buildroot}/%{_datadir}/arduino -mkdir -p %{buildroot}/%{_bindir} -mkdir -p %{buildroot}/%{_mandir}/man1 -mkdir -p %{buildroot}/%{_docdir}/%{name}/examples -install -m 755 -d %{buildroot}/%{_docdir}/%{name} -install -m 755 -d %{buildroot}/%{_docdir}/%{name}/examples -for dir in `find examples -type d` ; do install -m 755 -d %{buildroot}/%{_docdir}/%{name}/$dir ; done -for file in `find examples -type f ! -name .gitignore` ; do install -m 644 $file %{buildroot}/%{_docdir}/%{name}/$file ; done -install -m 644 *.mk arduino-mk-vars.md %{buildroot}/%{_datadir}/arduino -install -m 644 licence.txt %{buildroot}/%{_docdir}/%{name} -install -m 755 bin/ard-reset-arduino %{buildroot}/%{_bindir}/ard-reset-arduino -install -m 644 ard-reset-arduino.1 %{buildroot}/%{_mandir}/man1 - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%{_bindir}/ard-reset-arduino -%{_mandir}/man1/ard-reset-arduino.1* -%{_datadir}/arduino/*.mk -%{_datadir}/arduino/arduino-mk-vars.md -%doc %{_docdir}/%{name}/licence.txt -%docdir %{_docdir}/%{name}/examples -%{_docdir}/%{name}/examples - -%changelog -* Sat Apr 12 2014 Simon John -- Put manpage back. -* Fri Apr 04 2014 Simon John -- Removed BuildRequires of python3/pyserial. -* Wed Apr 02 2014 Simon John -- Added BuildRequires of python3-pyserial. Need to look into Requires. -* Mon Mar 24 2014 Simon John -- Replaced perl/help2man with pyserial for reset script. -* Tue Feb 04 2014 Simon John -- Added arduino-mk-vars.md to the files to be installed/packaged. -* Sat Feb 01 2014 Simon John -- Updated version. -* Mon Jan 13 2014 Simon John -- Removed arduino-mk subdirectory -* Mon Dec 30 2013 Simon John -- Initial release. diff --git a/arduino/Arduino-Makefile/tests/script/bootstrap.sh b/arduino/Arduino-Makefile/tests/script/bootstrap.sh deleted file mode 100644 index 083bf5d..0000000 --- a/arduino/Arduino-Makefile/tests/script/bootstrap.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -pushd $SCRIPTS_DIR/.. - -source $SCRIPTS_DIR/bootstrap/chipkit.sh -source $SCRIPTS_DIR/bootstrap/arduino.sh diff --git a/arduino/Arduino-Makefile/tests/script/bootstrap/arduino.sh b/arduino/Arduino-Makefile/tests/script/bootstrap/arduino.sh deleted file mode 100644 index 7c2c9ac..0000000 --- a/arduino/Arduino-Makefile/tests/script/bootstrap/arduino.sh +++ /dev/null @@ -1,44 +0,0 @@ -set -e -BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source $BOOTSTRAP_DIR/common.sh - -echo "Installing dependencies for building for the Arduino" - -if [ -z "$ARDUINO_DIR" ] || ! test -e $ARDUINO_DIR || [ $OS == "cygwin" ]; then - - echo "Installing Arduino..." - - ARDUINO_BASENAME="arduino-1.0.6" - if [ $OS == "cygwin" ]; then - ARDUINO_FILE="$ARDUINO_BASENAME-windows".zip - EXTRACT_COMMAND="unzip -q" - elif [ $OS == "mac" ]; then - ARDUINO_FILE="$ARDUINO_BASENAME-macosx".zip - EXTRACT_COMMAND="unzip -q" - else - ARDUINO_FILE="$ARDUINO_BASENAME-linux64".tgz - EXTRACT_COMMAND="tar -xzf" - fi - - ARDUINO_URL=http://arduino.cc/download.php?f=/$ARDUINO_FILE - - _pushd $DEPENDENCIES_FOLDER - if ! test -e $ARDUINO_FILE - then - echo "Downloading Arduino IDE..." - download $ARDUINO_URL $ARDUINO_FILE - fi - - if ! test -d $ARDUINO_BASENAME - then - echo "Installing Arduino to local folder..." - $EXTRACT_COMMAND $ARDUINO_FILE - echo "Arduino installed" - fi - - _popd - -fi - -echo -echo "${bldgreen}Arduino dependencies installed.$txtrst" diff --git a/arduino/Arduino-Makefile/tests/script/bootstrap/chipkit.sh b/arduino/Arduino-Makefile/tests/script/bootstrap/chipkit.sh deleted file mode 100644 index efe9615..0000000 --- a/arduino/Arduino-Makefile/tests/script/bootstrap/chipkit.sh +++ /dev/null @@ -1,61 +0,0 @@ -set -e -BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source $BOOTSTRAP_DIR/common.sh - -echo "Installing dependencies for building for the chipKIT" - - -if [ -z "$MPIDE_DIR" ] || ! test -e $MPIDE_DIR || [ $OS == "cygwin" ]; then - - echo "Installing MPIDE..." - - if [ $OS == "cygwin" ]; then - MPIDE_BASENAME="mpide-0023-windows-20130715" - MPIDE_FILE="$MPIDE_BASENAME".zip - EXTRACT_COMMAND="unzip -q" - if ! command -v unzip >/dev/null 2>&1; then - _cygwin_error "unzip" - fi - elif [ $OS == "mac" ]; then - MPIDE_BASENAME=mpide-0023-macosx-20130715 - MPIDE_FILE="$MPIDE_BASENAME".dmg - else - MPIDE_BASENAME=mpide-0023-linux64-20130817-test - MPIDE_FILE="$MPIDE_BASENAME".tgz - EXTRACT_COMMAND="tar -xzf" - fi - - MPIDE_URL=http://chipkit.s3.amazonaws.com/builds/$MPIDE_FILE - - _pushd $DEPENDENCIES_FOLDER - if ! test -e $MPIDE_FILE - then - echo "Downloading MPIDE..." - download $MPIDE_URL $MPIDE_FILE - fi - - if ! test -d $MPIDE_BASENAME - then - echo "Installing MPIDE to local folder..." - if [ $OS == "mac" ]; then - hdiutil attach $MPIDE_FILE - cp -R /Volumes/Mpide/Mpide.app/Contents/Resources/Java $MPIDE_BASENAME - hdiutil detach /Volumes/Mpide - else - $EXTRACT_COMMAND $MPIDE_FILE - fi - echo "MPIDE installed" - fi - - if [ $OS == "cygwin" ]; then - chmod a+x mpide/hardware/pic32/compiler/pic32-tools/bin/* - chmod a+x -R mpide/hardware/pic32/compiler/pic32-tools/pic32mx/ - chmod a+x mpide/*.dll - chmod a+x mpide/hardware/tools/avr/bin/* - fi - _popd - -fi - -echo -echo "${bldgreen}chipKIT dependencies installed.$txtrst" diff --git a/arduino/Arduino-Makefile/tests/script/bootstrap/common.sh b/arduino/Arduino-Makefile/tests/script/bootstrap/common.sh deleted file mode 100644 index c3cd90e..0000000 --- a/arduino/Arduino-Makefile/tests/script/bootstrap/common.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash - -set -e -BOOTSTRAP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -if [ -z $COMMON_SOURCED ]; then - - # TODO this is kind of a hacky way of determining if root is required - - # ideally we wouuld set up a little virtualenv in the dependencies folder - SUDO_CMD= - if command -v sudo >/dev/null 2>&1; then - SUDO_CMD="sudo -E" - - if [ -z $CI ] && [ -z $VAGRANT ]; then - echo "The bootstrap script needs to install a few packages to your system as an admin, and we will use the 'sudo' command - enter your password to continue" - $SUDO_CMD ls > /dev/null - fi - fi - - KERNEL=`uname` - ARCH=`uname -m` - if [ ${KERNEL:0:7} == "MINGW32" ]; then - OS="windows" - elif [ ${KERNEL:0:6} == "CYGWIN" ]; then - OS="cygwin" - elif [ $KERNEL == "Darwin" ]; then - OS="mac" - else - OS="linux" - if ! command -v lsb_release >/dev/null 2>&1; then - # Arch Linux - if command -v pacman>/dev/null 2>&1; then - $SUDO_CMD pacman -S lsb-release - fi - fi - - DISTRO=`lsb_release -si` - fi - - - die() { - echo >&2 "${bldred}$@${txtrst}" - exit 1 - } - - _cygwin_error() { - echo - echo "${bldred}Missing \"$1\"${txtrst} - run the Cygwin installer again and select the base package set:" - echo " $CYGWIN_PACKAGES" - echo "After installing the packages, re-run this bootstrap script." - die - } - - if ! command -v tput >/dev/null 2>&1; then - if [ $OS == "cygwin" ]; then - echo "OPTIONAL: Install the \"ncurses\" package in Cygwin to get colored shell output" - fi - else - set +e - # These exit with 1 when provisioning in a Vagrant box...? - txtrst=$(tput sgr0) # reset - bldred=${txtbld}$(tput setaf 1) - bldgreen=${txtbld}$(tput setaf 2) - set -e - fi - - - _pushd() { - pushd $1 > /dev/null - } - - _popd() { - popd > /dev/null - } - - _wait() { - if [ -z $CI ] && [ -z $VAGRANT ]; then - echo "Press Enter when done" - read - fi - } - - _install() { - if [ $OS == "cygwin" ]; then - _cygwin_error $1 - elif [ $OS == "mac" ]; then - # brew exists with 1 if it's already installed - set +e - brew install $1 - set -e - else - if [ -z $DISTRO ]; then - echo - echo "Missing $1 - install it using your distro's package manager or build from source" - _wait - else - if [ $DISTRO == "arch" ]; then - $SUDO_CMD pacman -S $1 - elif [ $DISTRO == "Ubuntu" ]; then - $SUDO_CMD apt-get update -qq - $SUDO_CMD apt-get install $1 -y - else - echo - echo "Missing $1 - install it using your distro's package manager or build from source" - _wait - fi - fi - fi - } - - download() { - url=$1 - filename=$2 - curl $url -L -o $filename - } - - if [ `id -u` == 0 ]; then - die "Error: running as root - don't use 'sudo' with this script" - fi - - if ! command -v unzip >/dev/null 2>&1; then - _install "unzip" - fi - - if ! command -v curl >/dev/null 2>&1; then - if [ $OS == "cygwin" ]; then - _cygwin_error "curl" - else - _install curl - fi - fi - - echo "Storing all downloaded dependencies in the \"dependencies\" folder" - - DEPENDENCIES_FOLDER="/var/tmp/Arduino-Makefile-testing-dependencies" - mkdir -p $DEPENDENCIES_FOLDER - - if ! command -v make >/dev/null 2>&1; then - if [ $OS == "cygwin" ]; then - _cygwin_error "make" - elif [ $OS == "mac" ]; then - die "Missing 'make' - install the Xcode CLI tools" - else - if [ $DISTRO == "arch" ]; then - _install "base-devel" - elif [ $DISTRO == "Ubuntu" ]; then - _install "build-essential" - fi - fi - fi - - if [ $DISTRO == "Ubuntu" ] && [ $ARCH == "x86_64" ]; then - _install "libc6-i386" - _install "lib32gcc1" - fi - - if ! command -v g++ >/dev/null 2>&1; then - if [ $DISTRO == "Ubuntu" ]; then - _install "g++" - fi - fi - - if ! command -v python >/dev/null 2>&1; then - echo "Installing Python..." - _install "python" - fi - - if ! command -v pip >/dev/null 2>&1; then - echo "Installing Pip..." - if ! command -v easy_install >/dev/null 2>&1; then - _install "python-setuptools" - fi - - if ! command -v easy_install >/dev/null 2>&1; then - die "easy_install not available, can't install pip" - fi - - $SUDO_CMD easy_install pip - fi - - PIP_SUDO_CMD= - if [ -z $VIRTUAL_ENV ]; then - # Only use sudo if the user doesn't have an active virtualenv - PIP_SUDO_CMD=$SUDO_CMD - fi - - $PIP_SUDO_CMD pip install --src dependencies --pre -Ur $BOOTSTRAP_DIR/pip-requirements.txt - - COMMON_SOURCED=1 -fi diff --git a/arduino/Arduino-Makefile/tests/script/bootstrap/pip-requirements.txt b/arduino/Arduino-Makefile/tests/script/bootstrap/pip-requirements.txt deleted file mode 100644 index 8313187..0000000 --- a/arduino/Arduino-Makefile/tests/script/bootstrap/pip-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyserial==2.7 diff --git a/arduino/Arduino-Makefile/tests/script/runtests.sh b/arduino/Arduino-Makefile/tests/script/runtests.sh deleted file mode 100644 index 58b8e15..0000000 --- a/arduino/Arduino-Makefile/tests/script/runtests.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -TESTS_DIR=examples - -failures=() - -# These examples cannot be tested easily at the moment as they require -# alternate cores. The MakefileExample doesn't actually contain any source code -# to compile. -NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial BlinkTeensy BlinkNetworkRPi BlinkInAVRC) - -for dir in $TESTS_DIR/*/ -do - dir=${dir%*/} - example=${dir##*/} - example_is_testable=true - for non_testable_example in "${NON_TESTABLE_EXAMPLES[@]}"; do - if [[ $example == $non_testable_example ]]; then - example_is_testable=false - break - fi - done - - if ! $example_is_testable; then - echo "Skipping non-testable example $example..." - continue - fi - - pushd $dir - echo "Compiling $example..." - make_output=`make clean TEST=1` - make_output=`make TEST=1` - if [[ $? -ne 0 ]]; then - failures+=("$example") - echo "Example $example failed" - fi - - make_output=`make disasm TEST=1` - if [[ $? -ne 0 ]]; then - failures+=("$example disasm") - echo "Example $example disasm failed" - fi - - make_output=`make generate_assembly TEST=1` - if [[ $? -ne 0 ]]; then - failures+=("$example generate_assembly") - echo "Example $example generate_assembly failed" - fi - - make_output=`make symbol_sizes TEST=1` - if [[ $? -ne 0 ]]; then - failures+=("$example symbol_sizes") - echo "Example $example symbol_sizes failed" - fi - - popd -done - -for failure in "${failures[@]}"; do - echo "Example $failure failed" -done - -if [[ ${#failures[@]} -eq 0 ]]; then - echo "All tests passed." -else - exit 1 -fi diff --git a/arduino/arduino.ino b/arduino/arduino.ino index 785ee01..5f5994f 100644 --- a/arduino/arduino.ino +++ b/arduino/arduino.ino @@ -66,9 +66,11 @@ void loop() switch (lettre) { case 'L': // Ouverture loquet servoLoquet.write(100); + delay(500); break; case 'F': // Fermeture loquet servoLoquet.write(0); + delay(500); break; case 'A': // Position attente balle servoPositionBalle.write(70); @@ -120,3 +122,4 @@ void loop() Serial.write(lettre); } } +} diff --git a/chef/src/actionneurs.c b/chef/src/actionneurs.c index d5ebba1..94ab515 100644 --- a/chef/src/actionneurs.c +++ b/chef/src/actionneurs.c @@ -14,6 +14,7 @@ void configureActionneurs() { pthread_mutex_init(&receptionActionMutex, NULL); pthread_cond_init(&receptionActionCond, NULL); + resetActionneurs(); } void setLoquet(bool state) @@ -66,8 +67,10 @@ void setPropulsion(bool state) void resetActionneurs() { - setPropulsion(false); + setLoquet(false); barilletReset(); + setPositionBalle(attente); + setPropulsion(false); } void stopActionneurs() diff --git a/chef/src/diagnostics.c b/chef/src/diagnostics.c index 0577c24..c339b79 100644 --- a/chef/src/diagnostics.c +++ b/chef/src/diagnostics.c @@ -159,15 +159,15 @@ void runDiagnostics() i = 3; execDiagnostic("Mot+Cod R AR", diagCodeuse, &i); - execDiagnostic("Ouverture loquet", diagJustRun, &diagSetLoquetOuvert); execDiagnostic("Fermeture loquet", diagJustRun, &diagSetLoquetFerme); + execDiagnostic("Ouverture loquet", diagJustRun, &diagSetLoquetOuvert); execDiagnostic("Reset barillet", diagJustRun, &barilletReset); execDiagnostic("T+1 barillet", diagJustRun, &barilletSuivant); execDiagnostic("T+2 barillet", diagJustRun, &barilletSkip); execDiagnostic("Pousser balle", diagJustRun, &pousserBalle); - execDiagnostic("Pos. attente", diagJustRun, &diagSetPositionBalleAttente); execDiagnostic("Pos. ejection", diagJustRun, &diagSetPositionBalleEjection); execDiagnostic("Pos. evacuation", diagJustRun, &diagSetPositionBalleEvacuation); - execDiagnostic("Propulsion off", diagJustRun, &diagSetPropulsionOn); + execDiagnostic("Pos. attente", diagJustRun, &diagSetPositionBalleAttente); execDiagnostic("Propulsion on", diagJustRun, &diagSetPropulsionOff); + execDiagnostic("Propulsion off", diagJustRun, &diagSetPropulsionOn); } diff --git a/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware b/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware index 68d281b..5c982ea 100755 --- a/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware +++ b/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware @@ -5,6 +5,7 @@ start() { printf "Starting hardware handling: " + modprobe cdc_acm # Arduino modprobe pl2303 # USB↔Serial cable # I2C modprobe i2c-bcm2708 # RPi2