Skip to content

Commit c813254

Browse files
authored
Merge branch 'master' into fix-typos
2 parents f7b26fb + 34338a3 commit c813254

11 files changed

+78
-95
lines changed

.ycm_extra_conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
,'c++'
2323

2424
# Avr-libc flags installed with homebrew
25-
,"-isystem/usr/local/Cellar/avr-gcc/7.2.0/avr/include"
25+
# ,"-isystem/usr/local/Cellar/avr-gcc/7.2.0/avr/include"
26+
,"-isystem/usr/local/Cellar/avr-gcc/8.3.0/avr/include"
2627

2728
# IDE 1.6.3
2829
,'-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino'

Arduino-Makefile

INSTALL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,18 @@ $ git push --set-upstream origin master
115115

116116
To upload the program, we need to reset the Arduino board. This is done using a `python script` stored in `./Arduino-Makefile/bin`
117117

118-
First, if you don't already have Python, you can install it using Homebrew on OS X:
118+
First, if you don't already have Python 2 & 3, you can install it using Homebrew on OS X:
119119

120120
```Bash
121-
$ brew install python
121+
$ brew install python python@2
122122
```
123123

124124
Then install `pySerial`:
125125

126126
```Bash
127-
$ pip install pyserial
127+
$ pip install pyserial & pip2 install pyserial
128128
```
129+
129130
### 4. Copy and edit a `Makefile`
130131

131132
To make sure you're up and running to hack Arduino, we are going to compile some code. We need to have a Makefile for each project we want to compile.

LICENSE.md renamed to LICENSE

File renamed without changes.

Makefile-CI.mk

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,38 @@
55

66
### PROJECT_DIR
77
### This is the path to where you have created/cloned your project
8-
PROJECT_DIR =
9-
10-
### AVR_GCC_VERSION
11-
### Check if the version is equal or higher than 4.9
12-
AVR_GCC_VERSION := $(shell expr `avr-gcc -dumpversion | cut -f1` \>= 4.9)
13-
8+
# PROJECT_DIR = // set by calling make
9+
#
1410
### ARDMK_DIR
1511
### Path to the Arduino-Makefile directory.
1612
ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile
1713

1814
### ARDUINO_DIR
19-
### Path to the Arduino application and resources directory.
20-
ARDUINO_DIR =
15+
16+
### Path to the Arduino application and ressources directory.
17+
# ARDUINO_DIR = // set by calling make
2118

2219
### USER_LIB_PATH
2320
### Path to where the your project's libraries are stored.
24-
USER_LIB_PATH := $(PROJECT_DIR)/lib
21+
# USER_LIB_PATH := $(PROJECT_DIR)/lib
22+
USER_LIB_PATH := $(realpath $(PROJECT_DIR)/lib)
2523

2624
### BOARD_TAG
2725
### It must be set to the board you are currently using. (i.e uno, mega2560, etc.)
28-
BOARD_TAG = mega2560
26+
BOARD_TAG = mega
27+
BOARD_SUB = atmega2560
28+
29+
### MONITOR_PORT
30+
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
31+
MONITOR_PORT = /dev/tty.usbmodem*
2932

3033
### MONITOR_BAUDRATE
3134
### It must be set to Serial baudrate value you are using.
3235
MONITOR_BAUDRATE = 115200
3336

3437
### AVR_TOOLS_DIR
3538
### Path to the AVR tools directory such as avr-gcc, avr-g++, etc.
36-
AVR_TOOLS_DIR =
39+
# AVR_TOOLS_DIR = // set by calling make
3740

3841
### AVRDUDE
3942
### Path to avrdude directory.
@@ -47,23 +50,14 @@ CXXFLAGS_STD = -std=gnu++11
4750

4851
### CPPFLAGS
4952
### Flags you might want to set for debugging purpose. Comment to stop.
50-
CXXFLAGS = -pedantic -Wall -Wextra
51-
52-
### If avr-gcc -v is higher than 4.9, activate coloring of the output
53-
ifeq "$(AVR_GCC_VERSION)" "1"
54-
CXXFLAGS += -fdiagnostics-color
55-
endif
56-
57-
### MONITOR_PORT
58-
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
59-
MONITOR_PORT = /dev/tty.usbmodem*
60-
61-
### don't touch this
62-
CURRENT_DIR = $(shell basename $(CURDIR))
53+
CXXFLAGS += -pedantic -Wall -Wextra
54+
LDFLAGS += -fdiagnostics-color
6355

6456
### OBJDIR
57+
### Don't touch this!
6558
### This is were you put the binaries you just compile using 'make'
66-
OBJDIR = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR)
59+
CURRENT_DIR = $(shell basename $(CURDIR))
60+
OBJDIR = $(PROJECT_DIR)/build/$(CURRENT_DIR)/$(BOARD_TAG)
6761

6862
### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
6963
include $(ARDMK_DIR)/Arduino.mk

Makefile-Linux.mk

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66
### PROJECT_DIR
77
### This is the path to where you have created/cloned your project
8-
PROJECT_DIR = $(shell dirname $(shell dirname $(shell pwd)))
9-
10-
### AVR_GCC_VERSION
11-
### Check if the version is equal or higher than 4.9
12-
AVR_GCC_VERSION := $(shell expr `avr-gcc -dumpversion | cut -f1` \>= 4.9)
8+
PROJECT_DIR = $(shell dirname $(shell pwd))
139

1410
### ARDMK_DIR
1511
### Path to the Arduino-Makefile directory.
@@ -33,6 +29,11 @@ USER_LIB_PATH := $(realpath $(PROJECT_DIR)/lib)
3329
BOARD_TAG = mega
3430
BOARD_SUB = atmega2560
3531

32+
### MONITOR_PORT
33+
### The port your board is connected to. Using an '*' tries all the ports and finds the right one. Choose one of the two.
34+
MONITOR_PORT = /dev/ttyUSB*
35+
# MONITOR_PORT = /dev/ttyACM*
36+
3637
### MONITOR_BAUDRATE
3738
### It must be set to Serial baudrate value you are using.
3839
MONITOR_BAUDRATE = 115200
@@ -43,35 +44,28 @@ AVR_TOOLS_DIR = /usr
4344

4445
### AVRDUDE
4546
### Path to avrdude directory.
46-
AVRDUDE = /usr/bin/avrdude
47+
AVRDUDE = /usr/bin/avrdude
4748

4849
### CFLAGS_STD
4950
CFLAGS_STD = -std=gnu11
5051

5152
### CXXFLAGS_STD
52-
CXXFLAGS_STD = -std=gnu++11
53+
### You can choose wich ever you like
54+
# CXXFLAGS_STD = -std=gnu++11
55+
CXXFLAGS_STD = -std=gnu++17
56+
5357

5458
### CPPFLAGS
5559
### Flags you might want to set for debugging purpose. Comment to stop.
56-
CXXFLAGS = -pedantic -Wall -Wextra
57-
58-
### If avr-gcc -v is higher than 4.9, activate coloring of the output
59-
ifeq "$(AVR_GCC_VERSION)" "1"
60-
CXXFLAGS += -fdiagnostics-color
61-
endif
62-
63-
### MONITOR_PORT
64-
### The port your board is connected to. Using an '*' tries all the ports and finds the right one. Choose one of the two.
65-
MONITOR_PORT = /dev/ttyUSB*
66-
# MONITOR_PORT = /dev/ttyACM*
67-
68-
### don't touch this
69-
CURRENT_DIR = $(shell basename $(CURDIR))
60+
CXXFLAGS += -pedantic -Wall -Wextra
61+
LDFLAGS += -fdiagnostics-color
7062

7163
### OBJDIR
64+
### Don't touch this!
7265
### This is were you put the binaries you just compile using 'make'
7366
CURRENT_DIR = $(shell basename $(CURDIR))
74-
OBJDIR = $(PROJECT_DIR)/bin/$(CURRENT_DIR)/$(BOARD_TAG)
67+
OBJDIR = $(PROJECT_DIR)/build/$(CURRENT_DIR)/$(BOARD_TAG)
7568

7669
### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
7770
include $(ARDMK_DIR)/Arduino.mk
71+

Makefile-OSX.mk

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66
### PROJECT_DIR
77
### This is the path to where you have created/cloned your project
8-
PROJECT_DIR = $(shell dirname $(shell dirname $(shell pwd)))
9-
10-
### AVR_GCC_VERSION
11-
### Check if the version is equal or higher than 4.9
12-
AVR_GCC_VERSION := $(shell expr `avr-gcc -dumpversion | cut -f1` \>= 4.9)
8+
PROJECT_DIR = $(shell dirname $(shell pwd))
139

1410
### ARDMK_DIR
1511
### Path to the Arduino-Makefile directory.
@@ -19,7 +15,7 @@ ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile
1915
### Path to the Arduino application and resources directory.
2016
### For Arduino IDE 1.0.x
2117
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
22-
### For Arduino IDE 1.6.x
18+
### For Arduino IDE 1.6.x ++
2319
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
2420

2521
### USER_LIB_PATH
@@ -36,6 +32,10 @@ USER_LIB_PATH := $(realpath $(PROJECT_DIR)/lib)
3632
BOARD_TAG = mega
3733
BOARD_SUB = atmega2560
3834

35+
### MONITOR_PORT
36+
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
37+
MONITOR_PORT = /dev/tty.usbmodem*
38+
3939
### MONITOR_BAUDRATE
4040
### It must be set to Serial baudrate value you are using.
4141
MONITOR_BAUDRATE = 115200
@@ -46,31 +46,27 @@ AVR_TOOLS_DIR = /usr/local
4646

4747
### AVRDUDE
4848
### Path to avrdude directory.
49-
AVRDUDE = /usr/local/bin/avrdude
49+
AVRDUDE = /usr/local/bin/avrdude
5050

5151
### CFLAGS_STD
5252
CFLAGS_STD = -std=gnu11
5353

5454
### CXXFLAGS_STD
55-
CXXFLAGS_STD = -std=gnu++11
55+
### You can choose wich ever you like
56+
# CXXFLAGS_STD = -std=gnu++11
57+
CXXFLAGS_STD = -std=gnu++17
5658

5759
### CPPFLAGS
5860
### Flags you might want to set for debugging purpose. Comment to stop.
59-
CXXFLAGS = -pedantic -Wall -Wextra
60-
61-
### If avr-gcc -v is higher than 4.9, activate coloring of the output
62-
ifeq "$(AVR_GCC_VERSION)" "1"
63-
CXXFLAGS += -fdiagnostics-color
64-
endif
65-
66-
### MONITOR_PORT
67-
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
68-
MONITOR_PORT = /dev/tty.usbmodem*
61+
CXXFLAGS += -pedantic -Wall -Wextra
62+
LDFLAGS += -fdiagnostics-color
6963

7064
### OBJDIR
65+
### Don't touch this!
7166
### This is were you put the binaries you just compile using 'make'
7267
CURRENT_DIR = $(shell basename $(CURDIR))
73-
OBJDIR = $(PROJECT_DIR)/bin/$(CURRENT_DIR)/$(BOARD_TAG)
68+
OBJDIR = $(PROJECT_DIR)/build/$(CURRENT_DIR)/$(BOARD_TAG)
7469

7570
### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
7671
include $(ARDMK_DIR)/Arduino.mk
72+

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
## Important notice
66

7-
> I'm not using this project as much as I used to and might be slow at answering issues or PR's.
8-
> I am slowly moving out of Arduino-Makefile in favor of [PlatformIO](http://docs.platformio.org/en/latest/).
9-
> I've ported their basic toolchain so you can still use the latest avr-gcc toolchain and stuff.
10-
> Take a look here and let me know what you think: [osx-cross/platform-osxcrossavr](https://github.com/osx-cross/platform-osxcrossavr)
7+
> ~~I'm not using this project as much as I used to and might be slow at answering issues or PR's.
8+
> I am slowly moving out of Arduino-Makefile in favor of PlatformIO
9+
> I've ported their basic toolchain so you can still use the latest avr-gcc toolchain and stuff.~~
1110
1211
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1312
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -39,7 +38,7 @@ Ever wanted to start a new [Arduino](http://arduino.cc/) project and...
3938
- tests in `test`
4039
- binaries in `bin`
4140
- etc.
42-
- **use** a newer version of `avr-gcc` such as `7.2` or `6.4`?
41+
- **use** a newer version of `avr-gcc` such as `8.3.0`?
4342
- **use** an awesome [`Makefile`](https://github.com/sudar/Arduino-Makefile) to compile and upload your code from the `cli`?
4443

4544
If you answered **yes** to one of the above, this [Bare Arduino Project](https://github.com/ladislas/bare-arduino-project) is just what you're looking for! :)
@@ -50,8 +49,8 @@ Based on what we've learned on our [Moti project](http://github.com/weareleka/mo
5049

5150
- move away from the Arduino IDE and use your favorite text editor such as Vim or SublimeText
5251
- get up and running in less time
53-
- use `avr-gcc 7.2` to compile your code
54-
- use `C++14` for your standard coding
52+
- use `avr-gcc 8.3.0` to compile your code
53+
- use `C++17` for your standard coding
5554
- use `make` to compile, `make upload` to upload, thanks to [Sudar](https://github.com/sudar/)'s incredible project [Arduino-Makefile](https://github.com/sudar/Arduino-Makefile)
5655
- use our [Travis-CI](https://travis-ci.org) continuous integration configuration and adapt it to suit your needs
5756

script/bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SRC="$CWD/src"
77
TEST="$CWD/test"
88
ARDMK="$CWD/Arduino-Makefile"
99

10-
AVR_GCC="/usr/local/share/avr-gcc"
11-
ARDUINO="/usr/local/share/arduino"
10+
AVR_GCC="/usr/share/avr-gcc"
11+
ARDUINO="/usr/share/arduino"
1212

1313
source "$SCRIPTS_DIR/install.sh"

script/install.sh

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22

33
echo "Installing dependencies needed to build the sources and tests..."
44

5-
ARDUINO_BASENAME="arduino-1.0.6"
6-
ARDUINO_FILE="$ARDUINO_BASENAME-linux64.tgz"
7-
ARDUINO_URL="http://arduino.cc/download.php?f=/$ARDUINO_FILE"
8-
9-
AVR_GCC_BASENAME="arduino-1.5.8"
10-
AVR_GCC_FILE="$AVR_GCC_BASENAME-linux64.tgz"
11-
AVR_GCC_URL="http://arduino.cc/download.php?f=/$AVR_GCC_FILE"
12-
13-
echo "Installing Arduino 1.0.6..."
5+
ARDUINO_BASENAME="arduino-1.8.9"
6+
ARDUINO_FILE="$ARDUINO_BASENAME-linux64.tar.xz"
7+
ARDUINO_URL="https://downloads.arduino.cc/$ARDUINO_FILE"
148

9+
echo "Downloading $ARDUINO_BASENAME from $ARDUINO_URL"
1510
wget "$ARDUINO_URL" -O "$ARDUINO_FILE"
16-
tar -xzf "$ARDUINO_FILE"
17-
sudo mv "$ARDUINO_BASENAME/" "$ARDUINO"
1811

19-
echo "Installing avr-gcc from Arduino 1.5.8..."
12+
echo "Unzipping $ARDUINO_BASENAME"
13+
tar xf "$ARDUINO_FILE"
2014

21-
wget "$AVR_GCC_URL" -O "$AVR_GCC_FILE"
22-
tar -xzf "$AVR_GCC_FILE"
23-
sudo mv "$AVR_GCC_BASENAME/hardware/tools/avr" "$AVR_GCC"
15+
echo "Installing avr-gcc to $AVR_GCC"
16+
sudo mv "$ARDUINO_BASENAME/hardware/tools/avr" "$AVR_GCC"
17+
18+
echo "Install Arduino to $ARDUINO"
19+
sudo mv "$ARDUINO_BASENAME/" "$ARDUINO"
2420

2521
echo "Installation of dependencies is complete, we are now going to run some tests..."
2622

2723
source "$SCRIPTS_DIR/runtests.sh"
24+

src/BarProject/BarProject.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <Arduino.h>
22
#include <Wire.h>
33
#include "BarLib.h"
4+
#include "FooLib.h"
45

56
BarClass BarObject;
67

0 commit comments

Comments
 (0)