Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
*.bz2

bootloaders/*/build/

.DS_Store

*.json
package_electroniccats-samd-2.0.0_index.json
38 changes: 38 additions & 0 deletions builder/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2014-present PlatformIO <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from SCons.Script import AlwaysBuild, Import


Import("env")


# Added in PIO Core 4.4.0
if not hasattr(env, "AddPlatformTarget"):

def AddPlatformTarget(
env,
name,
dependencies,
actions,
title=None,
description=None,
always_build=True,
):
target = env.Alias(name, dependencies, actions)
if always_build:
AlwaysBuild(target)
return target

env.AddMethod(AddPlatformTarget)
40 changes: 40 additions & 0 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2014-present PlatformIO <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Arduino
Arduino Wiring-based Framework allows writing cross-platform software to
control devices attached to a wide range of Arduino boards to create all
kinds of creative coding, interactive objects, spaces or physical experiences.
http://arduino.cc/en/Reference/HomePage
"""

import os

from SCons.Script import DefaultEnvironment

env = DefaultEnvironment()

board = env.BoardConfig()
build_mcu = env.get("BOARD_MCU", board.get("build.mcu", ""))

MCU_FAMILY = board.get(
"build.system", "sam" if build_mcu.startswith("at91") else "samd")

if env.BoardConfig().get("build.core", "").lower() == "mbcwb":
env.SConscript(
os.path.join(env.PioPlatform().get_package_dir(
"framework-arduino-mbcwb"), "tools", "platformio-samd-build.py"))
else:
env.SConscript(os.path.join("arduino", "arduino-%s.py" % MCU_FAMILY))
25 changes: 25 additions & 0 deletions builder/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
##########################################################################
#
# Electronic Cats SAPI de CV 2020
# http://www.electroniccats.com/
#
##########################################################################

from os.path import join
from SCons.Script import (AlwaysBuild, Default, DefaultEnvironment)
from colorama import Fore

env = DefaultEnvironment()
print( Fore.GREEN + '<<<<<<<<<<<< ' + env.BoardConfig().get("name").upper() + " 2019 ElectronicCats >>>>>>>>>>>>" + Fore.BLACK )

elf = env.BuildProgram()
bin = env.CreateBin( join("$BUILD_DIR", "${PROGNAME}"), elf )
hex = env.CreateHex( join("$BUILD_DIR", "${PROGNAME}"), elf )
AlwaysBuild( hex, bin )

#env.Depends(hex, env.CreateBin( join("$BUILD_DIR", "${PROGNAME}"), elf ))

upload = env.Alias("upload", hex, [ env.VerboseAction("$UPLOADCMD", "\n"), env.VerboseAction("", "\n") ] )
AlwaysBuild( upload )

Default( hex, bin )
54 changes: 54 additions & 0 deletions platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "electronic-cats-samd",
"title": "Electronic Cats SAMD(L)(C) Core for Arduino",
"description": "Arduino support for SAM D|L|C (M0+ and M4F). Support for D51, SAMR34, L21, C21, and D11",
"homepage": "http://www.electroniccats.com",
"license": "LGPL 2.0",
"keywords": [
"dev-platform",
"ARM",
"Cortex-M",
"Atmel",
"Microchip",
"samr34",
"samd51",
"samd21",
"saml21",
"samc21",
"samd11"
],
"engines": { "platformio": "^3.0.0" },
"repository": {
"type": "git",
"url": "https://github.com/ElectronicCats/ArduinoCore-samd"
},
"version": "2.0.4",
"packageRepositories": [
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http://dl.platformio.org/packages/manifest.json"
],
"frameworks": {
"arduino": {
"package": "framework-arduino-samd-electroniccats",
"script": "builder/frameworks/arduino.py"
},
"baremetal": {
"package": "framework-arduino-samd-electroniccats",
"script": "builder/frameworks/baremetal.py"
}
},
"packages": {
"toolchain-gccarmnoneeabi": {
"type": "toolchain",
"version": "=1.70201.0"
},
"framework-arduino-samd-electroniccats": {
"type": "framework",
"version": "https://github.com/ElectronicCats/ArduinoCore-samd"
},
"tool-arduino-samd-electroniccats": {
"type": "uploader",
"version": "https://github.com/ElectronicCats/Arduino_Boards_Index"
}
}
}