Skip to content

Commit 57eba9e

Browse files
committed
Merge branch 'master' into folderRename
2 parents cb2af4b + e5d5d79 commit 57eba9e

File tree

15 files changed

+159
-20
lines changed

15 files changed

+159
-20
lines changed

.github/dependabot.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ updates:
88
directory: / # Check the repository's workflows under /.github/workflows/
99
schedule:
1010
interval: daily
11+
labels:
12+
- "topic: infrastructure"

.github/workflows/check-arduino.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020

2121
- name: Arduino Lint
2222
uses: arduino/arduino-lint-action@v1

.github/workflows/compile-bootloader.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
4444
steps:
4545
- name: Checkout repository
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
4747

4848
- name: Compile bootloader
4949
uses: arduino/compile-sketches@v1
@@ -59,7 +59,7 @@ jobs:
5959
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
6060

6161
- name: Save sketches report as workflow artifact
62-
uses: actions/upload-artifact@v2
62+
uses: actions/upload-artifact@v3
6363
with:
6464
if-no-files-found: error
6565
path: ${{ env.SKETCHES_REPORTS_PATH }}

.github/workflows/compile-examples.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
100100
steps:
101101
- name: Checkout repository
102-
uses: actions/checkout@v2
102+
uses: actions/checkout@v3
103103

104104
- name: Compile examples
105105
uses: arduino/compile-sketches@v1
@@ -119,7 +119,7 @@ jobs:
119119
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
120120

121121
- name: Save sketches report as workflow artifact
122-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v3
123123
with:
124124
if-no-files-found: error
125125
path: ${{ env.SKETCHES_REPORTS_PATH }}

.github/workflows/compile-firmware.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
4444
steps:
4545
- name: Checkout repository
46-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
4747

4848
- name: Compile firmware
4949
uses: arduino/compile-sketches@v1
@@ -59,7 +59,7 @@ jobs:
5959
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
6060

6161
- name: Save sketches report as workflow artifact
62-
uses: actions/upload-artifact@v2
62+
uses: actions/upload-artifact@v3
6363
with:
6464
if-no-files-found: error
6565
path: ${{ env.SKETCHES_REPORTS_PATH }}

.github/workflows/spell-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020

2121
- name: Spell check
2222
uses: codespell-project/actions-codespell@master

.github/workflows/sync-labels.yml

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
2+
name: Sync Labels
3+
4+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/sync-labels.ya?ml"
9+
- ".github/label-configuration-files/*.ya?ml"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/sync-labels.ya?ml"
13+
- ".github/label-configuration-files/*.ya?ml"
14+
schedule:
15+
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
16+
- cron: "0 8 * * *"
17+
workflow_dispatch:
18+
repository_dispatch:
19+
20+
env:
21+
CONFIGURATIONS_FOLDER: .github/label-configuration-files
22+
CONFIGURATIONS_ARTIFACT: label-configuration-files
23+
24+
jobs:
25+
check:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
32+
- name: Download JSON schema for labels configuration file
33+
id: download-schema
34+
uses: carlosperate/download-file-action@v2
35+
with:
36+
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
37+
location: ${{ runner.temp }}/label-configuration-schema
38+
39+
- name: Install JSON schema validator
40+
run: |
41+
sudo npm install \
42+
--global \
43+
ajv-cli \
44+
ajv-formats
45+
46+
- name: Validate local labels configuration
47+
run: |
48+
# See: https://github.com/ajv-validator/ajv-cli#readme
49+
ajv validate \
50+
--all-errors \
51+
-c ajv-formats \
52+
-s "${{ steps.download-schema.outputs.file-path }}" \
53+
-d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
54+
55+
download:
56+
needs: check
57+
runs-on: ubuntu-latest
58+
59+
strategy:
60+
matrix:
61+
filename:
62+
# Filenames of the shared configurations to apply to the repository in addition to the local configuration.
63+
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
64+
- universal.yml
65+
66+
steps:
67+
- name: Download
68+
uses: carlosperate/download-file-action@v2
69+
with:
70+
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
71+
72+
- name: Pass configuration files to next job via workflow artifact
73+
uses: actions/upload-artifact@v3
74+
with:
75+
path: |
76+
*.yaml
77+
*.yml
78+
if-no-files-found: error
79+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
80+
81+
sync:
82+
needs: download
83+
runs-on: ubuntu-latest
84+
85+
steps:
86+
- name: Set environment variables
87+
run: |
88+
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
89+
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
90+
91+
- name: Determine whether to dry run
92+
id: dry-run
93+
if: >
94+
github.event_name == 'pull_request' ||
95+
(
96+
(
97+
github.event_name == 'push' ||
98+
github.event_name == 'workflow_dispatch'
99+
) &&
100+
github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
101+
)
102+
run: |
103+
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
104+
# configuration.
105+
echo "::set-output name=flag::--dry-run"
106+
107+
- name: Checkout repository
108+
uses: actions/checkout@v3
109+
110+
- name: Download configuration files artifact
111+
uses: actions/download-artifact@v3
112+
with:
113+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114+
path: ${{ env.CONFIGURATIONS_FOLDER }}
115+
116+
- name: Remove unneeded artifact
117+
uses: geekyeggo/delete-artifact@v2
118+
with:
119+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
120+
121+
- name: Merge label configuration files
122+
run: |
123+
# Merge all configuration files
124+
shopt -s extglob
125+
cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
126+
127+
- name: Install github-label-sync
128+
run: sudo npm install --global github-label-sync
129+
130+
- name: Sync labels
131+
env:
132+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
run: |
134+
# See: https://github.com/Financial-Times/github-label-sync
135+
github-label-sync \
136+
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
137+
${{ steps.dry-run.outputs.flag }} \
138+
${{ github.repository }}

docs/api.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ battery.getFiltered()
1616

1717
#### Returns
1818

19-
* _getRaw()_: returns the raw ADC read from the battery as am integer.
19+
* _getRaw()_: returns the raw ADC read from the battery as an integer.
2020
* _getConverted()_: returns the battery voltage converted to volts as a floating point.
2121
* _getFiltered()_: returns the battery voltage converted to volts and filtered in the last 10 seconds.
2222

@@ -110,12 +110,12 @@ Allow setting Motor1 or Motor2 to a specific speed or position. There are two PI
110110
#### Syntax
111111

112112
```
113-
pid1. setGains(int P, int I, int D)
113+
pid1.setGains(float P, float I, float D)
114114
```
115115

116116
#### Functions
117117

118-
* _setGains(float P, float I, float D)_: Set PID gains. (`int` type for MKRMotorCarrier)
118+
* _setGains(float P, float I, float D)_: Set PID gains.
119119
* _resetGains()_: Reset PID gains to factory default settings.
120120
* _setControlMode(cl_control)_: Set control mode to either `CL_VELOCITY` or `CL_POSITION`.
121121
* _setSetpoint(cl_mode, int target)_: Set a specific velocity or position in one of the motors. Define cl_mode as `TARGET_POSITION` or `TARGET_VELOCITY` and the desired value in target.

examples/Flasher/Flasher.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void setup() {
112112

113113
Wire.beginTransmission(0x66);
114114
Wire.write((uint8_t)GET_VERSION);
115-
Wire.write((uint32_t)0);
115+
Wire.write(0);
116116
Wire.endTransmission();
117117

118118
Wire.requestFrom(0x66, 5);

examples/NanoMotorCarrier/DCMotorTest/DCMotorTest.ino

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <ArduinoMotorCarrier.h>
2-
#define INTERRUPT_PIN 6
32

43
//Variable to store the battery voltage
54
static int batteryVoltage;

examples/NanoMotorCarrier/EncoderTest/EncoderTest.ino

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <ArduinoMotorCarrier.h>
2-
#define INTERRUPT_PIN 6
32

43
//Variable to store the battery voltage
54
static int batteryVoltage;

examples/NanoMotorCarrier/PID_Position_test/PID_Position_test.ino

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#include <MKRMotorCarrier_PID_test.h>
2-
//#include <MKRMotorCarrier.h>
3-
#define INTERRUPT_PIN 6
1+
#include <ArduinoMotorCarrier.h>
42

53
//Variable to store the battery voltage
64
static int batteryVoltage;

examples/NanoMotorCarrier/ServoTest/ServoTest.ino

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <ArduinoMotorCarrier.h>
33
//#include <MKRMotorCarrier.h>
44
//#include <MKRMotorCarrier_REV2.h>
5-
#define INTERRUPT_PIN 6
65

76

87
void setup()

library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ maintainer=Arduino <[email protected]>
55
sentence=Allows use of the Arduino Motor Carrier
66
paragraph=(Nano and MKR version)
77
category=Signal Input/Output
8-
url=https://www.arduino.cc/reference/en/libraries/ArduinoMotorCarrier/
9-
architectures=samd
8+
url=https://www.arduino.cc/reference/en/libraries/arduinomotorcarrier/
9+
architectures=samd,mbed_portenta
1010
includes=ArduinoMotorCarrier.h

src/Common.h

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515
*/
1616

17+
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
18+
#define RESET _RESET
19+
#endif
20+
1721
enum Commands {
1822
GET_VERSION = 0x01,
1923
RESET,

0 commit comments

Comments
 (0)