Skip to content

Commit

Permalink
Merge branch 'release/v4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
valeros committed May 31, 2022
2 parents da85d5c + d8ce3c1 commit 8863f39
Show file tree
Hide file tree
Showing 62 changed files with 279 additions and 1,055 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,29 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, windows-latest, macos-latest]
python-version: [3.7]
os: [ubuntu-latest, windows-latest, macos-latest]
example:
- "examples/arduino-blink"
- "examples/arduino-external-libs"
- "examples/arduino-internal-libs"
- "examples/arduino-own-src_dir"
- "examples/assembly-blink"
- "examples/digitstump-mouse"
- "examples/engduino-magnetometer"
- "examples/native-blink"
- "examples/simba-blink"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U https://github.com/platformio/platformio/archive/develop.zip
platformio platform install file://.
pio pkg install --global --platform symlink://.
- name: Build examples
run: |
platformio run -d ${{ matrix.example }}
pio run -d ${{ matrix.example }}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Atmel AVR: development platform for [PlatformIO](http://platformio.org)
# Atmel AVR: development platform for [PlatformIO](https://platformio.org)

[![Build Status](https://github.com/platformio/platform-atmelavr/workflows/Examples/badge.svg)](https://github.com/platformio/platform-atmelavr/actions)

Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming.

* [Home](http://platformio.org/platforms/atmelavr) (home page in PlatformIO Platform Registry)
* [Documentation](http://docs.platformio.org/page/platforms/atmelavr.html) (advanced usage, packages, boards, frameworks, etc.)
* [Home](https://registry.platformio.org/platforms/platformio/atmelavr) (home page in the PlatformIO Registry)
* [Documentation](https://docs.platformio.org/page/platforms/atmelavr.html) (advanced usage, packages, boards, frameworks, etc.)

# Usage

1. [Install PlatformIO](http://platformio.org)
2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file:
1. [Install PlatformIO](https://platformio.org)
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:

## Stable version

Expand All @@ -32,4 +32,4 @@ board = ...

# Configuration

Please navigate to [documentation](http://docs.platformio.org/page/platforms/atmelavr.html).
Please navigate to [documentation](https://docs.platformio.org/page/platforms/atmelavr.html).
2 changes: 1 addition & 1 deletion boards/attiny167.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX7 -DCLOCK_SOURCE=17",
"extra_flags": "-DARDUINO_AVR_ATTINYX7",
"f_cpu": "8000000L",
"mcu": "attiny167",
"variant": "tinyX7_New"
Expand Down
3 changes: 2 additions & 1 deletion boards/attiny25.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX5 -DNEOPIXELPORT=PORTB",
"extra_flags": "-DARDUINO_AVR_ATTINYX5",
"f_cpu": "8000000L",
"mcu": "attiny25",
"neo_pixel_port": "PORTB",
"variant": "tinyX5"
},
"debug": {
Expand Down
3 changes: 2 additions & 1 deletion boards/attiny45.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX5 -DNEOPIXELPORT=PORTB",
"extra_flags": "-DARDUINO_AVR_ATTINYX5",
"f_cpu": "8000000L",
"mcu": "attiny45",
"neo_pixel_port": "PORTB",
"variant": "tinyX5"
},
"debug": {
Expand Down
3 changes: 2 additions & 1 deletion boards/attiny85.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX5 -DNEOPIXELPORT=PORTB -DCLOCK_SOURCE=6",
"extra_flags": "-DARDUINO_AVR_ATTINYX5",
"f_cpu": "8000000L",
"mcu": "attiny85",
"neo_pixel_port": "PORTB",
"variant": "tinyX5"
},
"debug": {
Expand Down
2 changes: 1 addition & 1 deletion boards/attiny88.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"build": {
"core": "tiny",
"extra_flags": "-DARDUINO_AVR_ATTINYX8 -DCLOCK_SOURCE=18",
"extra_flags": "-DARDUINO_AVR_ATTINYX8",
"f_cpu": "8000000L",
"mcu": "attiny88",
"variant": "tinyX8"
Expand Down
2 changes: 1 addition & 1 deletion boards/controllino_maxi.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"require_upload_port": true,
"speed": 115200
},
"url": "https://controllino.biz/controllino/maxi/",
"url": "https://www.controllino.com/product/controllino-maxi/",
"vendor": "Controllino"
}
2 changes: 1 addition & 1 deletion boards/controllino_maxi_automation.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"require_upload_port": true,
"speed": 115200
},
"url": "https://controllino.biz/controllino/maxi-automation/",
"url": "https://www.controllino.com/product/controllino-maxi-automation/",
"vendor": "Controllino"
}
2 changes: 1 addition & 1 deletion boards/controllino_mega.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"require_upload_port": true,
"speed": 115200
},
"url": "https://controllino.biz/controllino/mega/",
"url": "https://www.controllino.com/product/controllino-mega/",
"vendor": "Controllino"
}
2 changes: 1 addition & 1 deletion boards/controllino_mini.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"require_upload_port": true,
"speed": 115200
},
"url": "https://controllino.biz/controllino/mini/",
"url": "https://www.controllino.com/product/controllino-mini/",
"vendor": "Controllino"
}
3 changes: 1 addition & 2 deletions boards/megaatmega2560.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
}
},
"frameworks": [
"arduino",
"simba"
"arduino"
],
"name": "Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)",
"upload": {
Expand Down
3 changes: 1 addition & 2 deletions boards/nanoatmega328.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
}
},
"frameworks": [
"arduino",
"simba"
"arduino"
],
"name": "Arduino Nano ATmega328",
"upload": {
Expand Down
3 changes: 1 addition & 2 deletions boards/seeeduino.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
}
},
"frameworks": [
"arduino",
"simba"
"arduino"
],
"name": "Seeeduino",
"upload": {
Expand Down
3 changes: 1 addition & 2 deletions boards/uno.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
}
},
"frameworks": [
"arduino",
"simba"
"arduino"
],
"name": "Arduino Uno",
"upload": {
Expand Down
38 changes: 0 additions & 38 deletions builder/compat.py

This file was deleted.

19 changes: 10 additions & 9 deletions builder/frameworks/_bare.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,27 @@

Import("env")

env.Append(
machine_flags = [
"-mmcu=$BOARD_MCU",
]

ASFLAGS=["-x", "assembler-with-cpp"],
env.Append(
ASFLAGS=machine_flags,
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],

CFLAGS=[
"-std=gnu11",
"-fno-fat-lto-objects"
],

CCFLAGS=[
CCFLAGS=machine_flags + [
"-Os", # optimize for size
"-Wall", # show warnings
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-flto",
"-mmcu=$BOARD_MCU"
],

CXXFLAGS=[
Expand All @@ -50,16 +55,12 @@
("F_CPU", "$BOARD_F_CPU")
],

LINKFLAGS=[
LINKFLAGS=machine_flags + [
"-Os",
"-mmcu=$BOARD_MCU",
"-Wl,--gc-sections",
"-flto",
"-fuse-linker-plugin"
],

LIBS=["m"]
)

# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
24 changes: 14 additions & 10 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,27 @@ def get_bootloader_size():
board.get("vendor", "").replace('"', ""))
]

machine_flags = [
"-mmcu=$BOARD_MCU",
]

env.Append(
ASFLAGS=["-x", "assembler-with-cpp"],
ASFLAGS=machine_flags,
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],

CFLAGS=[
"-std=gnu11",
"-fno-fat-lto-objects"
],

CCFLAGS=[
CCFLAGS=machine_flags + [
"-Os", # optimize for size
"-Wall", # show warnings
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-flto",
"-mmcu=$BOARD_MCU"
],

CXXFLAGS=[
Expand All @@ -91,9 +97,8 @@ def get_bootloader_size():
"-fpermissive"
],

LINKFLAGS=[
LINKFLAGS=machine_flags + [
"-Os",
"-mmcu=$BOARD_MCU",
"-Wl,--gc-sections",
"-flto",
"-fuse-linker-plugin"
Expand Down Expand Up @@ -141,16 +146,15 @@ def get_bootloader_size():
flatten_defines = env.Flatten(env["CPPDEFINES"])
extra_defines = []
if "CLOCK_SOURCE" not in flatten_defines:
extra_defines.append(("CLOCK_SOURCE", 0))
extra_defines.append(("CLOCK_SOURCE", board.get("build.clock_source", 0)))
if "NEOPIXELPORT" not in flatten_defines:
extra_defines.append(("NEOPIXELPORT", "PORTA"))
extra_defines.append(
("NEOPIXELPORT", board.get("build.neo_pixel_port", "PORTA"))
)

if extra_defines:
env.AppendUnique(CPPDEFINES=extra_defines)

# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])

#
# Target: Build Core Library
#
Expand Down
Loading

0 comments on commit 8863f39

Please sign in to comment.