Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aebc097

Browse files
authoredMay 12, 2021
Update continuous integration system (#54)
* Add library.properties to "Compile Examples" workflow path filter The library.properties metadata file content is a factor in compilation, so the workflow should run on any change to this file. * Use major version refs of sketch compilation actions Previously, due to the lack of a release, the development versions of the sketch compilation actions were used. Using release versions provides a more stable CI system for the ArduinoCore-mbed project. Use of the major version ref will cause the workflow to benefit from ongoing development to the actions up until such time as a new major release of an action is made, at which time we would need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major release before updating the major ref (e.g., uses: `arduino/compile-sketches@v2`). * Optimize management of size deltas report when there are errors There may sometimes be failed compilations that are not related to the current pull request (e.g., breakage caused by an external change that will be fixed separately). In this case, it is still valuable to publish a size deltas report for the compilations that passed. * Configure Dependabot to check for outdated actions used in workflows Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/[email protected]`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot * Add badge to readme for "Compile Examples" workflow This will show the current status of the CI workflow at a glance. * Add CI workflow to check for commonly misspelled words On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces. * Correct typos in comments and documentation * Add CI workflow to do Arduino project-specific linting On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project code. * Add license file This defines the license in a standardized place, which allows GitHub's automated license detection system to detect the license type: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository#detecting-a-license This is the exact license text provided by choosealicense.com This text should not be modified in any way. Doing so may interfere with GitHub's license detection or even the licence's function as a legal instrument. * Use release version of boards platform in "Compile Examples" workflow Previously, the development version of the boards platform was used to compile the example sketches in the CI workflow.
1 parent e44e869 commit aebc097

File tree

19 files changed

+619
-62
lines changed

19 files changed

+619
-62
lines changed
 

‎.codespellrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = ,
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git,./src/utility/ioexpander/I2Cdev.*,./src/utility/ioexpander/TCA6424A.*,./src/utility/QEI,./src/utility/RS485,

‎.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
2+
version: 2
3+
4+
updates:
5+
# Configure check for outdated GitHub Actions actions in workflows.
6+
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
7+
- package-ecosystem: github-actions
8+
directory: / # Check the repository's workflows under /.github/workflows/
9+
schedule:
10+
interval: daily

‎.github/workflows/check-arduino.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Arduino
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Arduino Lint
22+
uses: arduino/arduino-lint-action@v1
23+
with:
24+
compliance: strict
25+
library-manager: submit
26+
# Always use this setting for official repositories. Remove for 3rd party projects.
27+
official: true
28+
project-type: library

‎.github/workflows/compile-examples.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
pull_request:
55
paths:
66
- ".github/workflows/compile-examples.yml"
7+
- "library.properties"
78
- "src/**"
89
- "examples/**"
910
push:
1011
paths:
1112
- ".github/workflows/compile-examples.yml"
13+
- "library.properties"
1214
- "src/**"
1315
- "examples/**"
1416
# Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms)
@@ -30,42 +32,16 @@ jobs:
3032
compile-examples:
3133
runs-on: ubuntu-latest
3234

33-
env:
34-
ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed
35-
ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API
36-
3735
steps:
3836
- name: Checkout repository
3937
uses: actions/checkout@v2
4038

41-
# It's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
42-
- name: Checkout ArduinoCore-mbed
43-
uses: actions/checkout@v2
44-
with:
45-
repository: arduino/ArduinoCore-mbed
46-
# The arduino/actions/libraries/compile-examples action will install the platform from this path
47-
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}
48-
49-
- name: Checkout ArduinoCore-API
50-
uses: actions/checkout@v2
51-
with:
52-
repository: arduino/ArduinoCore-API
53-
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
54-
55-
- name: Install ArduinoCore-API
56-
run: |
57-
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
58-
5939
- name: Compile example sketches
60-
uses: arduino/compile-sketches@main
40+
uses: arduino/compile-sketches@v1
6141
with:
62-
fqbn: arduino:mbed:envie_m7
42+
fqbn: arduino:mbed_portenta:envie_m7
6343
platforms: |
64-
# Install Arduino mbed-Enabled Boards via Boards Manager for the toolchain
65-
- name: arduino:mbed
66-
# Overwrite the Arduino mbed-Enabled Boards release version with version from the tip of the master branch (located in local path because of the need to first install ArduinoCore-API)
67-
- source-path: extras/ArduinoCore-mbed
68-
name: arduino:mbed
44+
- name: arduino:mbed_portenta
6945
enable-deltas-report: true
7046
enable-warnings-report: true
7147
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
@@ -74,21 +50,27 @@ jobs:
7450
- name: Save memory usage change report as artifact
7551
uses: actions/upload-artifact@v2
7652
with:
53+
if-no-files-found: error
7754
path: ${{ env.SKETCHES_REPORTS_PATH }}
7855
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
7956

8057
report:
8158
needs: compile-examples
8259
# Only run the job when the workflow is triggered by a pull request from this repository (because arduino/report-size-deltas requires write permissions)
83-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
60+
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
8461
runs-on: ubuntu-latest
8562
steps:
8663
- name: Download sketches reports artifact
64+
id: download-artifact
65+
continue-on-error: true # If compilation failed for all boards then there are no artifacts
8766
uses: actions/download-artifact@v2
8867
with:
8968
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
9069
path: ${{ env.SKETCHES_REPORTS_PATH }}
9170

92-
- uses: arduino/report-size-deltas@main
71+
- name: Comment size deltas report to PR
72+
uses: arduino/report-size-deltas@v1
73+
# If actions/download-artifact failed, there are no artifacts to report from.
74+
if: steps.download-artifact.outcome == 'success'
9375
with:
9476
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

‎.github/workflows/spell-check.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell Check
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Spell check
22+
uses: codespell-project/actions-codespell@master

‎LICENSE.txt

Lines changed: 504 additions & 0 deletions
Large diffs are not rendered by default.

‎README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
= Machine Control Library for Arduino =
22

3+
[![Check Arduino status](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/check-arduino.yml)
4+
[![Compile Examples status](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/compile-examples.yml)
5+
[![Spell Check status](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/AutomationCarrierLibrary/actions/workflows/spell-check.yml)
6+
37
Arduino Library for the Machine Control
48

59
For more information about this library please visit us at https://www.arduino.cc/en/Reference/MachineControl

‎examples/Analog_Out/Analog_Out.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void loop() {
4545
if (counter >= 10.5)
4646
{
4747
counter = 0;
48-
//Additional 100ms delay introduced to manage 10.5V -> 0V fall time of 150ms
48+
//Additional 100 ms delay introduced to manage 10.5V -> 0V fall time of 150 ms
4949
delay(100);
5050
}
5151
delay(100);

‎examples/Analog_input/Analog_input_4_20mA/Analog_input_4_20mA.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This example provides the current value acquired by the
55
Machine Control. For each channel of the ANALOG IN
6-
connector, there is a 120 ohm resistor to GND. The current
6+
connector, there is a 120 ohm resistor to GND. The current
77
of the 4-20mA sensor flows through it, generating a voltage
88
which is sampled by the Portenta's ADC.
99
To use the 4-20mA functionality, a 24V supply on

‎examples/Digital_output/Digital_output.ino

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
different behaviors, and it is the same for all channels:
1414
1) Latch mode: when the over current is detected
1515
the channel is opened, and will remain opened until
16-
it will be toggle via software.
16+
it is toggled via software.
1717
2) Auto retry: when the over current is detected
18-
the channel is openend, but after some tents of
18+
the channel is opened, but after some tens of
1919
milliseconds the channel will automatically try
20-
to close itself again. In case of a persistant
20+
to close itself again. In case of a persistent
2121
overcurrent the channel will continuously toggle.
2222
2323
The circuit:
@@ -33,7 +33,7 @@ using namespace machinecontrol;
3333

3434
void setup() {
3535
Serial.begin(9600);
36-
// The loop starts only when the serial monitor is opened.
36+
// The loop starts only when the Serial Monitor is opened.
3737
while (!Serial);
3838

3939
//Set over current behavior of all channels to latch mode:
@@ -53,60 +53,60 @@ void loop() {
5353

5454
// Set all channels to CLOSED
5555
digital_outputs.setAll(255);
56-
Serial.print("All channels are CLOSED for 1s...");
56+
Serial.print("All channels are CLOSED for 1 s...");
5757
delay(1000);
5858

5959
// Set all channels to OPEN
6060
digital_outputs.setAll(0);
6161
Serial.println("now they are OPEN.");
6262
delay(1000);
6363

64-
// Toggle each channel for 1s, one by one
64+
// Toggle each channel for 1 s, one by one
6565

6666
digital_outputs.set(0, HIGH);
67-
Serial.print("CH0 is CLOSED for 1s...");
67+
Serial.print("CH0 is CLOSED for 1 s...");
6868
delay(1000);
6969
digital_outputs.set(0, LOW);
7070
Serial.println("now is OPEN.");
7171

7272
digital_outputs.set(1, HIGH);
73-
Serial.print("CH1 is CLOSED for 1s...");
73+
Serial.print("CH1 is CLOSED for 1 s...");
7474
delay(1000);
7575
digital_outputs.set(1, LOW);
7676
Serial.println("now is OPEN.");
7777

7878
digital_outputs.set(2, HIGH);
79-
Serial.print("CH2 is CLOSED for 1s...");
79+
Serial.print("CH2 is CLOSED for 1 s...");
8080
delay(1000);
8181
digital_outputs.set(2, LOW);
8282
Serial.println("now is OPEN.");
8383

8484
digital_outputs.set(3, HIGH);
85-
Serial.print("CH3 is CLOSED for 1s...");
85+
Serial.print("CH3 is CLOSED for 1 s...");
8686
delay(1000);
8787
digital_outputs.set(3, LOW);
8888
Serial.println("now is OPEN.");
8989

9090
digital_outputs.set(4, HIGH);
91-
Serial.print("CH4 is CLOSED for 1s...");
91+
Serial.print("CH4 is CLOSED for 1 s...");
9292
delay(1000);
9393
digital_outputs.set(4, LOW);
9494
Serial.println("now is OPEN.");
9595

9696
digital_outputs.set(5, HIGH);
97-
Serial.print("CH5 is CLOSED for 1s...");
97+
Serial.print("CH5 is CLOSED for 1 s...");
9898
delay(1000);
9999
digital_outputs.set(5, LOW);
100100
Serial.println("now is OPEN.");
101101

102102
digital_outputs.set(6, HIGH);
103-
Serial.print("CH6 is CLOSED for 1s...");
103+
Serial.print("CH6 is CLOSED for 1 s...");
104104
delay(1000);
105105
digital_outputs.set(6, LOW);
106106
Serial.println("now is OPEN.");
107107

108108
digital_outputs.set(7, HIGH);
109-
Serial.print("CH7 is CLOSED for 1s...");
109+
Serial.print("CH7 is CLOSED for 1 s...");
110110
delay(1000);
111111
digital_outputs.set(7, LOW);
112112
Serial.println("now is OPEN.");

‎examples/Digital_programmable/Digital_input/Digital_input.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using namespace machinecontrol;
1818

1919
void setup() {
2020
Serial.begin(9600);
21-
//The loop starts only when the serial monitor is opened.
21+
//The loop starts only when the Serial Monitor is opened.
2222
while(!Serial);
2323
Wire.begin();
2424

‎examples/RS485_fullduplex/RS485_fullduplex.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Circuit:
1010
- Portenta H7
1111
- Machine Control
12-
- A Slave device with RS485 inteface
12+
- A Slave device with RS485 interface
1313
1414
*/
1515

@@ -34,8 +34,8 @@ void setup()
3434
comm_protocols.rs485.sel_485 = 1; // RS485_RS232_N
3535
comm_protocols.rs485.half_duplex = 0; // HALF_FULL_N
3636
comm_protocols.rs485.receive(); // RE_N
37-
comm_protocols.rs485.fd_tx_term = 1; // FD_TX_TERM - 120 Ohm Y-Z termination enabled when both TERM and FD_TX_TERM are high
38-
comm_protocols.rs485.term = 1; // TERM - 120 Ohm A-B termination enabled when high
37+
comm_protocols.rs485.fd_tx_term = 1; // FD_TX_TERM - 120 ohm Y-Z termination enabled when both TERM and FD_TX_TERM are high
38+
comm_protocols.rs485.term = 1; // TERM - 120 ohm A-B termination enabled when high
3939

4040
Serial.println("Initialization done!");
4141
}

‎examples/RTC_Alarm/RTC_Alarm.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void setup() {
3636

3737
Serial.println("Initialization Done!");
3838

39-
// APIs to set date's fields:hours, minutes and seconds
39+
// APIs to set date's fields: hours, minutes and seconds
4040
rtc_controller.setHours(hours);
4141
rtc_controller.setMinutes(minutes);
4242
rtc_controller.setSeconds(seconds);

‎examples/Temp_probes_RTD/Temp_probes_RTD.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Machine Control - Temperature probes RTD example
33
44
This example provides a way to test the 3-wire RTDs
5-
on the Machine control Carrier. It is possibile to
5+
on the Machine control Carrier. It is possible to
66
acquire 2-wire RTD simply by shorting the RTDx pin
77
to the TPx pin. The Machine control carrier has on
8-
board a precise 400ohm 0.1% reference resistor which
8+
board a precise 400 ohm 0.1% reference resistor which
99
is used as a reference by the MAX31865.
1010
1111
The circuit:

‎examples/Temp_probes_Thermocouples/Temp_probes_Thermocouples.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ void setup() {
3131
}
3232

3333
void loop() {
34-
//Set CH0, has internal 150ms delay
34+
//Set CH0, has internal 150 ms delay
3535
temp_probes.selectChannel(0);
3636
//Take CH0 measurement
3737
float temp_ch0 = temp_probes.tc.readTemperature();
3838
Serial.print("Temperature CH0 [°C]: ");
3939
Serial.print(temp_ch0);
4040
Serial.println();
4141

42-
//Set CH1, has internal 150ms delay
42+
//Set CH1, has internal 150 ms delay
4343
temp_probes.selectChannel(1);
4444
//Take CH1 measurement
4545
float temp_ch1 = temp_probes.tc.readTemperature();
4646
Serial.print("Temperature CH1 [°C]: ");
4747
Serial.print(temp_ch1);
4848
Serial.println();
4949

50-
//Set CH2, has internal 150ms delay
50+
//Set CH2, has internal 150 ms delay
5151
temp_probes.selectChannel(2);
5252
//Take CH2 measurement
5353
float temp_ch2 = temp_probes.tc.readTemperature();

‎examples/USB_host/USB_host.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,4 @@ static int process_key(tusbh_ep_info_t* ep, const uint8_t* keys)
161161
tusbh_set_keyboard_led(ep, key_leds);
162162
}
163163
return 0;
164-
}
164+
}

‎src/MachineControl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static mbed::CAN _can(PB_8, PH_13);
5454

5555
class COMMClass {
5656
public:
57-
// to be tested: cjeck if can be made a big pin initialization
57+
// to be tested: check if can be made a big pin initialization
5858
void init() {
5959
//SHUTDOWN OF RS485 LEDS
6060
digitalWrite(PA_0, LOW);

‎src/utility/RTC/PCF8563T.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define PCF8563T_MONTHS_REG 0x07
2929
#define PCF8563T_YEARS_REG 0x08
3030

31-
// allarm managemet
31+
// allarm management
3232
#define PCF8563T_MINUTE_ALARM_REG 0x09
3333
#define PCF8563T_MINUTE_ALARM_AE_M_MASK 0x80
3434
#define PCF8563T_MINUTE_ALARM_ON 0x7F

‎src/utility/THERMOCOUPLE/MAX31855.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ float MAX31855Class::readTemperature(int type)
8484
return NAN;
8585
}
8686
// The temperature is stored in the last 14 word's bits
87-
// sendend by the Thermocouple-to-Digital Converter
87+
// sent by the Thermocouple-to-Digital Converter
8888
if (rawword & 0x80000000) {
8989
// Negative value, drop the lower 18 bits and explicitly extend sign bits.
9090
rawword = 0xFFFFC000 | ((rawword >> 18) & 0x00003FFFF);
@@ -113,7 +113,7 @@ float MAX31855Class::readReferenceTemperature(int type)
113113
rawword >>= 4;
114114

115115
// The cold junction reference temperature is stored in the first 11 word's bits
116-
// sendend by the Thermocouple-to-Digital Converter
116+
// sent by the Thermocouple-to-Digital Converter
117117
rawword = rawword & 0x7FF;
118118
// check sign bit and convert to negative value.
119119
if (rawword & 0x800) {

0 commit comments

Comments
 (0)
This repository has been archived.