Skip to content

Commit 44c2c74

Browse files
authored
Merge pull request #27 from bcmi-labs/pretty-the-horse-up
Cleanup and refactor library
2 parents d017a0d + de2a0d4 commit 44c2c74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+636
-1488
lines changed

.github/workflows/compile-examples.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,14 @@ env:
2626

2727
jobs:
2828
compile-test:
29-
name: compile for ${{ matrix.fqbn }}
29+
name: ${{ matrix.board.fqbn }}
3030
runs-on: ubuntu-latest
3131

3232
env:
3333
# libraries to install for all boards
3434
UNIVERSAL_LIBRARIES: |
35-
# Install the ArduinoThreads library from the repository
35+
# Install the Arduino_Threads library from the repository
3636
- source-path: ./
37-
- name: Arduino_LSM9DS1
38-
- name: Arduino_APDS9960
39-
- name: ArduinoECCX08
40-
- name: Arduino_HTS221
41-
- name: OneWire
4237
# sketch paths to compile (recursive) for all boards
4338
UNIVERSAL_SKETCH_PATHS: |
4439
- examples
@@ -49,10 +44,19 @@ jobs:
4944
fail-fast: false
5045

5146
matrix:
52-
fqbn:
53-
- "arduino:mbed:nano33ble"
54-
# - "arduino:mbed:envie_m4"
55-
- "arduino:mbed:envie_m7"
47+
board:
48+
- fqbn: arduino:mbed_nano:nano33ble
49+
platforms: |
50+
- name: arduino:mbed_nano
51+
- fqbn: arduino:mbed_nano:nanorp2040connect
52+
platforms: |
53+
- name: arduino:mbed_nano
54+
- fqbn: arduino:mbed_portenta:envie_m4
55+
platforms: |
56+
- name: arduino:mbed_portenta
57+
- fqbn: arduino:mbed_portenta:envie_m7
58+
platforms: |
59+
- name: arduino:mbed_portenta
5660
5761
steps:
5862
- name: Checkout
@@ -83,15 +87,10 @@ jobs:
8387
uses: arduino/compile-sketches@v1
8488
with:
8589
cli-version: 'arduino_threads'
86-
fqbn: ${{ matrix.fqbn }}
90+
fqbn: ${{ matrix.board.fqbn }}
8791
libraries: |
8892
${{ env.UNIVERSAL_LIBRARIES }}
89-
platforms: |
90-
# Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain
91-
- name: "arduino:mbed"
92-
# Overwrite the Board Manager installation with the local platform
93-
- source-path: "extras/ArduinoCore-mbed"
94-
name: "arduino:mbed"
93+
platforms: ${{ matrix.board.platforms }}
9594
sketch-paths: |
9695
${{ env.UNIVERSAL_SKETCH_PATHS }}
9796
enable-deltas-report: 'true'

examples/Blocks/Blocks.ino

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/Blocks/data_reader.inot

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/Blocks/data_writer.inot

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
void setup() {
2+
3+
}
4+
5+
void loop() {
6+
Serial.println(counter);
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
void setup()
2+
{
3+
Serial.begin(115200);
4+
while (!Serial) { }
5+
6+
Producer.start();
7+
Consumer.start();
8+
}
9+
10+
void loop()
11+
{
12+
rtos::ThisThread::yield();
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
void setup() {
2+
3+
}
4+
5+
void loop() {
6+
static int i = 0;
7+
counter = i;
8+
i++;
9+
delay(100);
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SHARED(counter, int);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SINK(counter, int);
2+
3+
void setup()
4+
{
5+
6+
}
7+
8+
void loop()
9+
{
10+
Serial.println(counter.read());
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This examples demonstrates the SOURCE/SINK abstraction.
3+
* Each thread may have any number of SOURCES and SINKS that can be connected
4+
* together using the "connectTo" method.
5+
*/
6+
7+
void setup()
8+
{
9+
Producer.counter.connectTo(Consumer.counter);
10+
Producer.start();
11+
Consumer.start();
12+
}
13+
14+
void loop() {
15+
rtos::ThisThread::yield();
16+
}

0 commit comments

Comments
 (0)