Skip to content

Commit

Permalink
Merge branch 'dev' into 'master' for release 1.3.0
Browse files Browse the repository at this point in the history
Dev

See merge request smartme.io/arancino/ide/smartmeio-arancino-platform!5
  • Loading branch information
sergiotomasello committed Nov 17, 2021
2 parents 01ab2ee + abc93e2 commit d65f88b
Show file tree
Hide file tree
Showing 21 changed files with 1,022 additions and 21 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# Compiled Object files
*.o
*.obj

# Visual Studio Code
**/.vscode/

# Executables
*.out
*.app

*.pyc
/tools/.idea/
/tools/midi_tests/node_modules

.DS_Store
*.swp
/Output

# Ignore local overrides of platform.txt and boards.txt,
/boards.local.txt
/platform.local.txt
/libraries/**/build/

*.bz2

bootloaders/*/build/
49 changes: 49 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,37 @@ start:
- master
- branches

######## PUSH
push:
stage: start
only: ['tags']
except: ['master', 'branches']

allow_failure: true

variables:
GIT_STRATEGY: clone

before_script:
- eval `python3 check-version-tag.py ${CI_COMMIT_TAG}`

script:
#- apk add git
- git remote add github https://$GITHUB_BOT_USERNAME:[email protected]/$GITHUB_DEST_REPO
#- git remote show github
#- git remote show origin
#- git branch -a
- git checkout $CI_COMMIT_TAG
- git fetch github
#- git push github $CI_COMMIT_REF_NAME --force
- >
if [[ ${PRE_RELEASE} == "test" ]]; then
echo "not performing TAG push";
else
git push github ${CI_COMMIT_TAG}
fi
- git push github --all --force

#################################
####### PACKAGE #######
#################################
Expand All @@ -57,6 +88,24 @@ package_release:
- sed -i "s:\(version\)=.*:\1=$CI_COMMIT_TAG:" ./platform.txt
- jq --arg tag_ver ${CI_COMMIT_TAG} '.version = $tag_ver' package.json|sponge package.json

# adding Arduino-FreeRTOS-SAMD21 into core
- git clone $REPO_LIB_FREERTOS_URL -b v2.3.0-smartmeio.1 libraries/FreeRTOS-SAMD21

# adding ArduinoJson into core
- git clone $REPO_LIB_ARDUINOJSON_URL -b v6.18.0 libraries/ArduinoJson

# adding MsgPack into core
- git clone $REPO_LIB_MSGPACK_URL -b 0.3.8 libraries/MsgPack

# adding MsgPacketizer into core
- git clone $REPO_LIB_MSGPACKETIZER_URL -b 0.3.0 libraries/MsgPacketizer

# adding Microcontroller ID into core
- git clone $REPO_LIB_MICROCONTROLLER_ID_URL -b 1.0.0 libraries/Microcontroller-id

# adding PubSubClient into core
- git clone $REPO_LIB_PUBSUBCLIENT_URL -b v2.8 libraries/PubSubClient

- cd ..
# tar files and move temp folder back
- tar --exclude=tmp --exclude=.git* --exclude=*.DS_Store* -cvjf $PKG_NAME.tar.bz2 $CI_PROJECT_NAME
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#### v 1.3.0 - 2021.11.16

* added FreeRTOS-SAMD21 library tag 2.3.0 that include freeRtos core version 10.2.1 [#nt82u1](https://app.clickup.com/t/nt82u1)
* enabled atomic mode for analogRead and analogWrite function [#kd95qa](https://app.clickup.com/t/kd95qa)
* definition of a new variable `MCU_FAMILY`[#1nf8f15](#https://app.clickup.com/t/1nf8f15)
* moved the libraries used by arancino-library into the core

#### v 1.2.2 - 2021.03.11

* main features of previous release
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for Atmel's SAMD21 processor (used on the Arancino and Arancino Mignon boards).
This core is available as a package in the Arduino IDE cores manager. If you want to install it:

1. Open the **Preferences** of the Arduino IDE.
2. Add this URL `https://git.smartme.io/smartme.io/arancino/arduino/smartmeio-package-index/raw/master/package_smartmeio_index.json` in the **Additional Boards Manager URLs** field, and click OK.
2. Add this URL `https://raw.githubusercontent.com/smartmeio/arancino-boards/master/package_smartmeio_index.json` in the **Additional Boards Manager URLs** field, and click OK.
3. Open the **Boards Manager** (menu Tools->Board->Board Manager...)
4. Install **Arancino Boards**
5. Select one of the boards under **Arancino Boards** in Tools->Board menu
Expand Down Expand Up @@ -43,4 +43,4 @@ and customized by smartme.IO s.r.l.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
```

Arduino and Atmel are trademarks of their respective owners.
Arduino and Atmel are trademarks of their respective owners.
14 changes: 2 additions & 12 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ arancino_mignon.menu.UploadTool.ArancinoOTA.upload.tool=ArancinoOTA
arancino_mignon.menu.UploadTool.bossac=Serial
arancino_mignon.menu.UploadTool.bossac.upload.tool=bossac

arancino_mignon.menu.freertos.no=No
arancino_mignon.menu.freertos.yes=Yes
arancino_mignon.menu.freertos.no.build.arancino_extra_flags=
arancino_mignon.menu.freertos.yes.build.arancino_extra_flags=-DUSEFREERTOS

arancino_mignon.upload.protocol=sam-ba
arancino_mignon.upload.maximum_size=262144
arancino_mignon.upload.use_1200bps_touch=true
Expand All @@ -47,7 +42,7 @@ arancino_mignon.build.usb_product="Arancino Mignon"
arancino_mignon.build.usb_manufacturer="smartme.IO"
arancino_mignon.build.board=SAMD_ZERO
arancino_mignon.build.core=arancino
arancino_mignon.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arancino_mignon.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} -DUSEFREERTOS -DENABLE_CALLOC_REALLOC=1
arancino_mignon.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arancino_mignon.build.openocdscript=openocd_scripts/arancino.cfg
arancino_mignon.build.variant=arancino
Expand All @@ -63,11 +58,6 @@ arancino.name=Arancino
arancino.vid.0=0x04D8
arancino.pid.0=0xECDA

arancino.menu.freertos.no=No
arancino.menu.freertos.yes=Yes
arancino.menu.freertos.no.build.arancino_extra_flags=
arancino.menu.freertos.yes.build.arancino_extra_flags=-DUSEFREERTOS

arancino.upload.tool=ArancinoOTA
arancino.upload.protocol=sam-ba
arancino.upload.maximum_size=262144
Expand All @@ -80,7 +70,7 @@ arancino.build.usb_product="Arancino"
arancino.build.usb_manufacturer="smartme.IO"
arancino.build.board=SAMD_ZERO
arancino.build.core=arancino
arancino.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags}
arancino.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} -DUSEFREERTOS -DENABLE_CALLOC_REALLOC=1
arancino.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
arancino.build.openocdscript=openocd_scripts/arancino.cfg
arancino.build.variant=arancino
Expand Down
4 changes: 4 additions & 0 deletions cores/arancino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ void loop( void ) ;
#define ARANCINO_CORE_VERSION "0.0.0"
#endif

#ifndef MCU_FAMILY
#define MCU_FAMILY "SAMD21"
#endif

// USB Device
#include "USB/USBDesc.h"
#include "USB/USBCore.h"
Expand Down
16 changes: 15 additions & 1 deletion cores/arancino/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ void analogReference(eAnalogReference mode)

uint32_t analogRead(uint32_t pin)
{
//noInterrupts();
#if defined(USEFREERTOS)
noInterrupts();
#endif
uint32_t valueRead = 0;

if (pin < A0) {
Expand Down Expand Up @@ -182,7 +186,11 @@ uint32_t analogRead(uint32_t pin)
syncADC();
ADC->CTRLA.bit.ENABLE = 0x00; // Disable ADC
syncADC();


#if defined(USEFREERTOS)
interrupts();
#endif
//interrupts();
return mapResolution(valueRead, _ADCResolution, _readResolution);
}

Expand All @@ -195,6 +203,9 @@ void analogWrite(uint32_t pin, uint32_t value)
{
PinDescription pinDesc = g_APinDescription[pin];
uint32_t attr = pinDesc.ulPinAttribute;
#if defined(USEFREERTOS)
noInterrupts();
#endif

if ((attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG)
{
Expand Down Expand Up @@ -303,6 +314,9 @@ void analogWrite(uint32_t pin, uint32_t value)
syncTCC(TCCx);
}
}
#if defined(USEFREERTOS)
interrupts();
#endif
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# LibraryBuild.yml
# Github workflow script to test compile all examples of an Arduino library repository.
#
# Copyright (C) 2020 Armin Joachimsmeyer
# https://github.com/ArminJo/Github-Actions
#

# This is the name of the workflow, visible on GitHub UI.
name: LibraryBuild
on: [push, pull_request] # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request

jobs:
build:
name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples

runs-on: ubuntu-latest # I picked Ubuntu to use shell scripts.
env:
PLATFORM_DEFAULT_URL: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
strategy:
matrix:
# The matrix will produce one job for each configuration parameter of type `arduino-boards-fqbn`
# In the Arduino IDE, the fqbn is printed in the first line of the verbose output for compilation as parameter -fqbn=... for the "arduino-builder -dump-prefs" command
#
# Examples: arduino:avr:uno, arduino:avr:leonardo, arduino:avr:nano, arduino:avr:mega
# arduino:sam:arduino_due_x, arduino:samd:arduino_zero_native"
# ATTinyCore:avr:attinyx5:chip=85,clock=1internal, digistump:avr:digispark-tiny, digistump:avr:digispark-pro
# STM32:stm32:GenF1:pnum=BLUEPILL_F103C8
# esp8266:esp8266:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80
# You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
#############################################################################################################
arduino-boards-fqbn:
- arduino:samd:nano_33_iot
- arduino:samd:arduino_zero_native
- arduino:samd:mkrwan1300
- arduino:samd:mkrzero
- adafruit:samd:adafruit_itsybitsy_m4

# Specify parameters for each board.
# Parameters can be: platform-url, examples-exclude and examples-build-properties
# With examples-exclude you may exclude specific examples for a board. Use a space separated list.
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:samd:nano_33_iot
- arduino-boards-fqbn: arduino:samd:arduino_zero_native
- arduino-boards-fqbn: arduino:samd:mkrwan1300
- arduino-boards-fqbn: arduino:samd:mkrzero
- arduino-boards-fqbn: adafruit:samd:adafruit_itsybitsy_m4
sketches-exclude: Example4_BasicTemperatureReadingSleep

# Do not cancel all jobs / architectures if one job fails
fail-fast: false

# This is the list of steps this job will run.
steps:

# First of all, we clone the repo using the `checkout` action.
- name: Checkout
uses: actions/checkout@master

- name: Compile all examples
uses: ArminJo/arduino-test-compile@v3
with:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
platform-default-url: ${{ env.PLATFORM_DEFAULT_URL }}
required-libraries: RTCZero
sketches-exclude: ${{ matrix.sketches-exclude }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: arduino-lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: arduino/arduino-lint-action@v1
with:
# path: ./
version: 1.x
compliance: strict
library-manager: update
project-type: library
recursive: true
# report-file:
verbose: false
21 changes: 21 additions & 0 deletions libraries/ElectronicCats_InternalTemperatureZero/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 ElectronicCats

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions libraries/ElectronicCats_InternalTemperatureZero/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ElectronicCats Internal Temperature Zero

Arduino library for internal temperature of the family SAMD21 and SAMD51

### Quick Installing

To install, use the Arduino Library Manager and search for "Electronic Cats Internal Temperature Zero Library" and install the library.

### Manual Installing
To install this library:

- install it using the Arduino Library manager ("Sketch" -> "Include
Library" -> "Manage Libraries..."), or
- download a zipfile from github using the "Download ZIP" button and
install it using the IDE ("Sketch" -> "Include Library" -> "Add .ZIP
Library..."
- clone this git repository into your sketchbook/libraries folder.

For more info, see https://www.arduino.cc/en/Guide/Libraries

## Features of this version

- Support for SAMD21 and SAMD51

### Maintainer

<a href="https://github.com/sponsors/ElectronicCats">
<img src="https://electroniccats.com/wp-content/uploads/2020/07/Badge_GHS.png" height="104" />
</a>


Electronic Cats invests time and resources providing this open source design, please support Electronic Cats and open-source hardware by purchasing products from Electronic Cats!

### License

MIT

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/***************************************************************************
This is a library for internal temperature of the family SAMD
Electronic Cats invests time and resources providing this open source code,
please support Electronic Cats and open-source hardware by purchasing products
from Electronic Cats!
Written by Andrés Sabas Electronic Cats.
This code is beerware; if you see me (or any other Electronic Cats
member) at the local, and you've found our code helpful,
please buy us a round!
Distributed as-is; no warranty is given.
***************************************************************************/

#include <TemperatureZero.h>

TemperatureZero TempZero = TemperatureZero();

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
TempZero.init();
}

void loop() {
// put your main code here, to run repeatedly:
float temperature = TempZero.readInternalTemperature();
Serial.print("Internal Temperature is : ");
Serial.println(temperature);
delay(500);
}
Loading

0 comments on commit d65f88b

Please sign in to comment.