Merge branch 'update from sudar'

This commit is contained in:
tinyladi 2014-04-14 15:05:43 +02:00
commit 76179bcd83
11 changed files with 259 additions and 177 deletions

View file

@ -19,7 +19,7 @@
# #
# Original Arduino adaptation by mellis, eighthave, oli.keller # Original Arduino adaptation by mellis, eighthave, oli.keller
# #
# Current version: 1.3.2 # Current version: 1.3.3
# #
# Refer to HISTORY.md file for complete history of changes # Refer to HISTORY.md file for complete history of changes
# #
@ -56,6 +56,24 @@
# ARDMK_DIR = /usr/share/arduino # ARDMK_DIR = /usr/share/arduino
# AVR_TOOLS_DIR = /usr # 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 # You can either set these up in the Makefile, or put them in your
# environment e.g. in your .bashrc # environment e.g. in your .bashrc
# #
@ -395,6 +413,15 @@ ifndef AVR_TOOLS_DIR
else else
$(call show_config_variable,AVR_TOOLS_DIR,[USER]) $(call show_config_variable,AVR_TOOLS_DIR,[USER])
# Check in Windows as Cygwin is being used, that the configuration file for the AVRDUDE is set
# Check if it works on MAC
ifeq ($(CURRENT_OS),WINDOWS)
ifndef AVRDUDE_CONF
AVRDUDE_CONF = $(AVR_TOOLS_DIR)/etc/avrdude.conf
endif
endif
endif #ndef AVR_TOOLS_DIR endif #ndef AVR_TOOLS_DIR
ifndef AVR_TOOLS_PATH ifndef AVR_TOOLS_PATH
@ -465,6 +492,13 @@ else
$(call show_config_variable,USER_LIB_PATH,[USER]) $(call show_config_variable,USER_LIB_PATH,[USER])
endif 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 # boards.txt parsing
@ -668,7 +702,7 @@ endif
ifeq ($(strip $(NO_CORE)),) ifeq ($(strip $(NO_CORE)),)
ifndef MONITOR_BAUDRATE ifndef MONITOR_BAUDRATE
ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) 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) 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) MONITOR_BAUDRATE = $(findstring $(SPEED),300 1200 2400 4800 9600 14400 19200 28800 38400 57600 115200)
endif endif
@ -836,7 +870,7 @@ endif
get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!)) get_monitor_port = $(if $(wildcard $(DEVICE_PATH)),$(firstword $(wildcard $(DEVICE_PATH))),$(error Arduino port $(DEVICE_PATH) not found!))
# Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors. # Returns the ISP port (first wildcard expansion) if it exists, otherwise it errors.
get_isp_port = $(if $(wildcard $(ISP_PORT)),$(firstword $(wildcard $(ISP_PORT))),$(error ISP port $(ISP_PORT) not found!)) 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) # Command for avr_size: do $(call avr_size,elffile,hexfile)
ifneq (,$(findstring AVR,$(shell $(SIZE) --help))) ifneq (,$(findstring AVR,$(shell $(SIZE) --help)))
@ -1075,8 +1109,12 @@ endif
AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE) AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE)
ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio)) ifndef $(ISP_PORT)
AVRDUDE_ISP_OPTS += -P $(call get_isp_port) ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio))
AVRDUDE_ISP_OPTS += -P $(call get_isp_port)
endif
else
AVRDUDE_ISP_OPTS += -P $(call get_isp_port)
endif endif
ifndef ISP_EEPROM ifndef ISP_EEPROM
@ -1102,9 +1140,12 @@ all: $(TARGET_EEP) $(TARGET_HEX)
# prerequisite" (e.g., put "| $(OBJDIR)" at the end of the prerequisite # prerequisite" (e.g., put "| $(OBJDIR)" at the end of the prerequisite
# list) to prevent remaking the target when any file in the directory # list) to prevent remaking the target when any file in the directory
# changes. # changes.
$(OBJDIR): $(OBJDIR): pre-build
$(MKDIR) $(OBJDIR) $(MKDIR) $(OBJDIR)
pre-build:
$(call runscript_if_exists,$(PRE_BUILD_HOOK))
$(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) $(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
$(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm $(CC) $(LDFLAGS) -o $@ $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS) -lc -lm
@ -1114,6 +1155,7 @@ $(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(USER_LIB_OBJS)
error_on_caterina: error_on_caterina:
$(ERROR_ON_CATERINA) $(ERROR_ON_CATERINA)
# Use submake so we can guarantee the reset happens # Use submake so we can guarantee the reset happens
# before the upload, even with make -j # before the upload, even with make -j
upload: $(TARGET_HEX) verify_size upload: $(TARGET_HEX) verify_size
@ -1240,7 +1282,7 @@ help:
.PHONY: all upload raw_upload raw_eeprom error_on_caterina reset reset_stty ispload \ .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 \ clean depends size show_boards monitor disasm symbol_sizes generated_assembly \
generate_assembly verify_size burn_bootloader help 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 # added - in the beginning, so that we don't get an error if the file is not present
-include $(DEPS) -include $(DEPS)

View file

@ -4,6 +4,14 @@
# (directory and optional filename) exists # (directory and optional filename) exists
dir_if_exists = $(if $(wildcard $(1)$(2)),$(1)) 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 # For message printing: pad the right side of the first argument with spaces to
# the number of bytes indicated by the second argument. # the number of bytes indicated by the second argument.
space_pad_to = $(shell echo $(1) " " | head -c$(2)) space_pad_to = $(shell echo $(1) " " | head -c$(2))

View file

@ -4,15 +4,28 @@ A Makefile for Arduino Sketches
The following is the rough list of changes that went into different versions. 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. I tried to give credit whenever possible. If I have missed anyone, kindly add it to the list.
### 1.3.2 (in development) ### 1.3.4 (In development)
- Tweak: Reference `Makefile-example.mk` in `README.md` (https://github.com/tinyladi) - Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav)
- New: Create `Makefile-example-mk`, a *real life* `Makefile` example, to be used as a reference. (https://github.com/tinyladi)
- Tweak: Add `OBJDIR` to arduino-mk-vars.md. (https://github.com/tinyladi) ### 1.3.3 (2014-04-12)
- Tweak: *Beautify* `arduino-mk-vars.md` with code blocks. (https://github.com/tinyladi) - 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 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 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 "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) - 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/tinyladi)
- Tweak: Add `OBJDIR` to `arduino-mk-vars.md` (https://github.com/tinyladi)
- Tweak: *Beautify* `arduino-mk-vars.md` with code blocks. (https://github.com/tinyladi)
- 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) ### 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) - Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278)

View file

@ -34,30 +34,38 @@ package and can be installed using `apt-get` or `aptitude`.
You need to have the Arduino IDE. You can either install it through the You need to have the Arduino IDE. You can either install it through the
installer or download the distribution zip file and extract it. installer or download the distribution zip file and extract it.
The Makefile also delegates resetting the board to a short Perl program. The Makefile also delegates resetting the board to a short Python program.
You'll need to install `Device::SerialPort` to use it though. You'll need to install `pySerial` to use it though.
On Debian or Ubuntu: On Debian or Ubuntu:
apt-get install libdevice-serialport-perl apt-get install python-serial
On Fedora: On Fedora:
yum install perl-Device-SerialPort yum install pyserial
On openSUSE: On openSUSE:
zypper install perl-Device-SerialPort zypper install python-serial
On Mac using MacPorts: On Mac using MacPorts:
sudo port install p5-device-serialport sudo port install py27-serial
and use /opt/local/bin/perl5 instead of /usr/bin/perl On Windows:
You need to install Cygwin and its packages for Make, Perl and the next Serial library.
pySerial can be downloaded from PyPi
On other systems: On other systems:
cpan Device::SerialPort pip install pyserial
or
easy_install -U pyserial
## Usage ## Usage
@ -87,12 +95,32 @@ On Windows (using cygwin), you might want to set:
MONITOR_PORT = com3 MONITOR_PORT = com3
BOARD_TAG = mega2560 BOARD_TAG = mega2560
It is recommended in Windows that you create a symbolic link directory for avoiding problem with folder naming conventions on Windows. Specially if your your Arduino folder is in:
c:\Program Files (x86)\Arduino
You will get problem for the special characters on the folder name. More details about this can be found on https://github.com/sudar/Arduino-Makefile/issues/94
For creating a symbolic link you have to use the command “mklink” on Windows, e.g.
mklink /d c:\Arduino c:\Program Files (x86)\Arduino
At the end the variables end up being.
ARDUINO_DIR=../../../../../Arduino
Instead of
ARDUINO_DIR=../../../../../Program\ Files\ \(x86\)/Arduino
- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards` - `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. - `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 - `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"). 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` - `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. - `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.
The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file. The list of all variables that can be overridden is available at [arduino-mk-vars.md](arduino-mk-vars.md) file.
@ -124,7 +152,7 @@ It is possible to use [`colorgcc`](https://github.com/colorgcc/colorgcc) with th
## Versioning ## Versioning
The current version of the makefile is `1.3.1`. You can find the full history in the [HISTORY.md](HISTORY.md) file The current version of the makefile is `1.3.3`. You can find the full history in the [HISTORY.md](HISTORY.md) file
This project adheres to Semantic [Versioning 2.0](http://semver.org/). This project adheres to Semantic [Versioning 2.0](http://semver.org/).

48
ard-reset-arduino.1 Normal file
View file

@ -0,0 +1,48 @@
.TH ARD-RESET-ARDUINO "1" "April 2014" "ard-reset-arduino 1.3.3" "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.

View file

@ -776,6 +776,25 @@ MONITOR_CMD = minicom
---- ----
### 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 setting variables
### AVRDUDE ### AVRDUDE
@ -1007,7 +1026,7 @@ BOOTLOADER_FILE = optiboot_atmega328.hex
**Description:** **Description:**
Path to bootloader file. Relative path to bootloader directory.
Usually can be auto-detected as a relative `bootloader.path` from `boards.txt` Usually can be auto-detected as a relative `bootloader.path` from `boards.txt`
@ -1017,14 +1036,34 @@ Usually can be auto-detected as a relative `bootloader.path` from `boards.txt`
BOOTLOADER_PATH = optiboot BOOTLOADER_PATH = optiboot
# or # or
BOOTLOADER_PATH = arduino:atmega BOOTLOADER_PATH = arduino:atmega
# or
BOOTLOADER_PATH = /usr/share/arduino/hardware/arduino/bootloaders/caterina/Caterina-Esplora.hex
``` ```
**Requirement:** *Optional* **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 ## ChipKIT variables
### MPIDE_DIR ### MPIDE_DIR

View file

@ -1,147 +1,38 @@
#!/usr/bin/env perl #!/usr/bin/env python
use strict; from __future__ import print_function
use warnings; import serial
import os.path
import argparse
from time import sleep
use Device::SerialPort; parser = argparse.ArgumentParser(description='Reset an Arduino')
use Getopt::Long; parser.add_argument('--caterina', action='store_true', help='Reset a Leonardo, Micro, Robot or LilyPadUSB.')
use Pod::Usage; 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()
my %Opt = if args.caterina:
( if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0])
period => 0.1, ser = serial.Serial(args.port[0], 57600)
); ser.close()
ser.open()
GetOptions(\%Opt, ser.close()
"period=f", # width of reset pulse in seconds ser.setBaudrate(1200)
"verbose!", ser.open()
"help!", ser.close()
"info!", sleep(1)
"caterina!",
);
if ($Opt{help} || $Opt{info})
{
usage();
}
die "No Arduinos found!\n"
unless @ARGV;
foreach my $dev (@ARGV)
{
my $p = Device::SerialPort->new($dev)
or die "Unable to open $dev: $!\n";
if ($Opt{caterina})
{
$p->baudrate(1200);
$p->write_settings;
$p->close;
print STDERR "Forcing reset using 1200bps open/close on port $dev\n"
if $Opt{verbose};
# wait for it to come back
sleep 1;
while( ! -e $dev ) {
print STDERR "Waiting for $dev to come back\n"
if $Opt{verbose};
sleep 1;
}
print STDERR "$dev has come back after reset\n"
if $Opt{verbose};
}
else
{
my $dt = $Opt{period};
print STDERR "Setting DTR high for ${dt}s on $dev\n"
if $Opt{verbose};
die "Invalid pulse width ($dt), "
unless $dt > 0.0;
$p->pulse_dtr_on($dt * 1000.0);
}
}
## here endeth the main
sub usage
{
pod2usage(-verbose => 2);
}
__END__
=head1 NAME
ard-reset-arduino - Reset an Arduino
=head1 USAGE
$ ard-reset-arduino /dev/cu.usb*
$ ard-reset-arduino --verbose --period=0.1 /dev/cu.usb*
$ ard-reset-arduino --verbose --caterina /dev/ttyUSB0
=head1 DESCRIPTION
To reset (most) Arduinos, it's enough to just pulse the DTR line.
You can do that from the shell with stty, but there's an interesting
diversity of command flags. This little program gives a uniform interface
at the cost of requiring C<Device::SerialPort>.
=head1 OPTIONS
=over
=item --verbose
Watch what's going on on STDERR.
=item --period=0.25
Specify the DTR pulse width in seconds.
=item --caterina
Reset a Leonardo, Micro, Robot or LilyPadUSB.
=back
=head1 BUGS AND LIMITATIONS
There are no known bugs in this application.
Please report problems to the author.
Patches are welcome.
=head1 AUTHOR
Martin Oldfield, ex-atelier@mjo.tc
Support for Leonardo/Micro added by sej7278, https://github.com/sej7278
Thanks to Daniele Vergini who suggested this to me, and supplied
a command line version.
=head1 LICENCE AND COPYRIGHT
Copyright (c) 2012, Martin Oldfield. All rights reserved.
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.
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.
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()

View file

@ -57,8 +57,13 @@ ifndef MPIDE_PREFERENCES_PATH
endif endif
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) ifeq ($(CURRENT_OS),LINUX)
BUNDLED_AVR_TOOLS_DIR = $(call dir_if_exists,$(MPIDE_DIR)/hardware/tools) AVRDUDE_DIR = $(ARDUINO_DIR)/hardware/tools
AVRDUDE = $(AVRDUDE_DIR)/avrdude
AVRDUDE_CONF = $(AVRDUDE_DIR)/avrdude.conf
endif endif
PIC32_TOOLS_DIR = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools PIC32_TOOLS_DIR = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools

View file

@ -4,10 +4,10 @@ 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) 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. or [Ubuntu](https://launchpad.net/ubuntu/+source/arduino-mk) or use apt.
First install the dependencies for building/running the package, as root: First install the dependencies as root:
apt-get build-dep arduino-mk apt-get build-dep arduino-mk
apt-get install arduino-core libdevice-serialport-perl help2man build-essential dpkg-dev fakeroot perl-doc devscripts apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts
Fetch the Debian source: Fetch the Debian source:

View file

@ -2,11 +2,11 @@
First install the dependencies as root: First install the dependencies as root:
yum install arduino-core perl-Device-SerialPort help2man rpm-build yum install arduino-core rpm-build
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: 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.3.2/ -o ../arduino-mk-1.3.2.tar.gz git archive HEAD --prefix=arduino-mk-1.3.3/ -o ../arduino-mk-1.3.3.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: If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM) you will need to create the directories:
@ -14,7 +14,7 @@ If you don't already have a rpmbuild setup (e.g. you've not installed the SRPM)
Then copy the tarball and specfile into those directories: Then copy the tarball and specfile into those directories:
cp ../arduino-mk-1.3.2.tar.gz ~/rpmbuild/SOURCES/ cp ../arduino-mk-1.3.3.tar.gz ~/rpmbuild/SOURCES/
cp packaging/fedora/arduino-mk.spec ~/rpmbuild/SPECS/ cp packaging/fedora/arduino-mk.spec ~/rpmbuild/SPECS/
Then compile. This will create a binary and source RPM: Then compile. This will create a binary and source RPM:

View file

@ -1,5 +1,5 @@
Name: arduino-mk Name: arduino-mk
Version: 1.3.2 Version: 1.3.3
Release: 1%{dist} Release: 1%{dist}
Summary: Program your Arduino from the command line Summary: Program your Arduino from the command line
Packager: Simon John <git@the-jedi.co.uk> Packager: Simon John <git@the-jedi.co.uk>
@ -9,8 +9,8 @@ Group: Development/Tools
License: LGPLv2+ License: LGPLv2+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
Requires: arduino-core, perl-Device-SerialPort Requires: arduino-core pyserial
BuildRequires: arduino-core, perl-Device-SerialPort, help2man BuildRequires: arduino-core
%description %description
Arduino is an open-source electronics prototyping platform based on Arduino is an open-source electronics prototyping platform based on
@ -36,7 +36,7 @@ for file in `find examples -type f ! -name .gitignore` ; do install -m 644 $file
install -m 644 *.mk arduino-mk-vars.md %{buildroot}/%{_datadir}/arduino install -m 644 *.mk arduino-mk-vars.md %{buildroot}/%{_datadir}/arduino
install -m 644 licence.txt %{buildroot}/%{_docdir}/%{name} install -m 644 licence.txt %{buildroot}/%{_docdir}/%{name}
install -m 755 bin/ard-reset-arduino %{buildroot}/%{_bindir}/ard-reset-arduino install -m 755 bin/ard-reset-arduino %{buildroot}/%{_bindir}/ard-reset-arduino
help2man %{buildroot}/%{_bindir}/ard-reset-arduino -n "Reset Arduino board" -s 1 -m "Arduino CLI Reset" --version-string=%{version} -N -o %{buildroot}/%{_mandir}/man1/ard-reset-arduino.1 install -m 644 ard-reset-arduino.1 %{buildroot}/%{_mandir}/man1
%clean %clean
rm -rf %{buildroot} rm -rf %{buildroot}
@ -52,6 +52,14 @@ rm -rf %{buildroot}
%{_docdir}/%{name}/examples %{_docdir}/%{name}/examples
%changelog %changelog
* Sat Apr 12 2014 Simon John <git@the-jedi.co.uk>
- Put manpage back.
* Fri Apr 04 2014 Simon John <git@the-jedi.co.uk>
- Removed BuildRequires of python3/pyserial.
* Wed Apr 02 2014 Simon John <git@the-jedi.co.uk>
- Added BuildRequires of python3-pyserial. Need to look into Requires.
* Mon Mar 24 2014 Simon John <git@the-jedi.co.uk>
- Replaced perl/help2man with pyserial for reset script.
* Tue Feb 04 2014 Simon John <git@the-jedi.co.uk> * Tue Feb 04 2014 Simon John <git@the-jedi.co.uk>
- Added arduino-mk-vars.md to the files to be installed/packaged. - Added arduino-mk-vars.md to the files to be installed/packaged.
* Sat Feb 01 2014 Simon John <git@the-jedi.co.uk> * Sat Feb 01 2014 Simon John <git@the-jedi.co.uk>