Skip to content

Commit

Permalink
Merge pull request #27 from bcmi-labs/pretty-the-horse-up
Browse files Browse the repository at this point in the history
Cleanup and refactor library
  • Loading branch information
aentinger committed Oct 12, 2021
2 parents d017a0d + de2a0d4 commit 44c2c74
Show file tree
Hide file tree
Showing 55 changed files with 636 additions and 1,488 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,14 @@ env:

jobs:
compile-test:
name: compile for ${{ matrix.fqbn }}
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
# libraries to install for all boards
UNIVERSAL_LIBRARIES: |
# Install the ArduinoThreads library from the repository
# Install the Arduino_Threads library from the repository
- source-path: ./
- name: Arduino_LSM9DS1
- name: Arduino_APDS9960
- name: ArduinoECCX08
- name: Arduino_HTS221
- name: OneWire
# sketch paths to compile (recursive) for all boards
UNIVERSAL_SKETCH_PATHS: |
- examples
Expand All @@ -49,10 +44,19 @@ jobs:
fail-fast: false

matrix:
fqbn:
- "arduino:mbed:nano33ble"
# - "arduino:mbed:envie_m4"
- "arduino:mbed:envie_m7"
board:
- fqbn: arduino:mbed_nano:nano33ble
platforms: |
- name: arduino:mbed_nano
- fqbn: arduino:mbed_nano:nanorp2040connect
platforms: |
- name: arduino:mbed_nano
- fqbn: arduino:mbed_portenta:envie_m4
platforms: |
- name: arduino:mbed_portenta
- fqbn: arduino:mbed_portenta:envie_m7
platforms: |
- name: arduino:mbed_portenta
steps:
- name: Checkout
Expand Down Expand Up @@ -83,15 +87,10 @@ jobs:
uses: arduino/compile-sketches@v1
with:
cli-version: 'arduino_threads'
fqbn: ${{ matrix.fqbn }}
fqbn: ${{ matrix.board.fqbn }}
libraries: |
${{ env.UNIVERSAL_LIBRARIES }}
platforms: |
# Use Board Manager to install the latest release of Arduino mbed Boards to get the toolchain
- name: "arduino:mbed"
# Overwrite the Board Manager installation with the local platform
- source-path: "extras/ArduinoCore-mbed"
name: "arduino:mbed"
platforms: ${{ matrix.board.platforms }}
sketch-paths: |
${{ env.UNIVERSAL_SKETCH_PATHS }}
enable-deltas-report: 'true'
Expand Down
22 changes: 0 additions & 22 deletions examples/Blocks/Blocks.ino

This file was deleted.

12 changes: 0 additions & 12 deletions examples/Blocks/data_reader.inot

This file was deleted.

21 changes: 0 additions & 21 deletions examples/Blocks/data_writer.inot

This file was deleted.

7 changes: 7 additions & 0 deletions examples/Demo_Shared_Counter/Consumer.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
void setup() {

}

void loop() {
Serial.println(counter);
}
13 changes: 13 additions & 0 deletions examples/Demo_Shared_Counter/Demo_Shared_Counter.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
void setup()
{
Serial.begin(115200);
while (!Serial) { }

Producer.start();
Consumer.start();
}

void loop()
{
rtos::ThisThread::yield();
}
10 changes: 10 additions & 0 deletions examples/Demo_Shared_Counter/Producer.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
void setup() {

}

void loop() {
static int i = 0;
counter = i;
i++;
delay(100);
}
1 change: 1 addition & 0 deletions examples/Demo_Shared_Counter/SharedVariables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SHARED(counter, int);
11 changes: 11 additions & 0 deletions examples/Demo_Source_Sink_Counter/Consumer.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SINK(counter, int);

void setup()
{

}

void loop()
{
Serial.println(counter.read());
}
16 changes: 16 additions & 0 deletions examples/Demo_Source_Sink_Counter/Demo_Source_Sink_Counter.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* This examples demonstrates the SOURCE/SINK abstraction.
* Each thread may have any number of SOURCES and SINKS that can be connected
* together using the "connectTo" method.
*/

void setup()
{
Producer.counter.connectTo(Consumer.counter);
Producer.start();
Consumer.start();
}

void loop() {
rtos::ThisThread::yield();
}
13 changes: 13 additions & 0 deletions examples/Demo_Source_Sink_Counter/Producer.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SOURCE(counter, int);

void setup()
{

}

void loop()
{
static int i = 0;
counter.write(i);
i++;
}
File renamed without changes.
15 changes: 15 additions & 0 deletions examples/Demo_Source_Sink_LED/Demo_Source_Sink_LED.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* This examples demonstrates the SOURCE/SINK abstraction.
* Each thread may have any number of SOURCES and SINKS that can be connected
* together using the "connectTo" method.
*/

void setup() {
Source_Thread.led.connectTo(Sink_Thread.led);
Sink_Thread.start();
Source_Thread.start();
}

void loop() {
rtos::ThisThread::yield();
}
Empty file.
21 changes: 21 additions & 0 deletions examples/Demo_Source_Sink_LED/Sink_Thread.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/*
* An 'bool' SINK with a size of '0'. This kind of SINK has no buffer so the reading thread
* will block until the writing thread has written something, or vice versa.
*/
SINK(led, bool);

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
/* Read a 'bool' from the SINK and discard it. Since there is basically no delay in the loop
* this call will surely block until something comes from the connected SOURCE. In this case
* the pace is dictated by the SOURCE that sends data every 100 ms.
*/
bool led_on = led.read();
digitalWrite(LED_BUILTIN, led_on);
}
15 changes: 15 additions & 0 deletions examples/Demo_Source_Sink_LED/Source_Thread.inot
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* The output SOURCE, it sends 'bool' values. */
SOURCE(led, bool);

void setup()
{

}

void loop()
{
led.write(true);
delay(100);
led.write(false);
delay(100);
}
13 changes: 0 additions & 13 deletions examples/Enqueue_test/Enqueue.inot

This file was deleted.

15 changes: 0 additions & 15 deletions examples/Enqueue_test/Enqueue_test.ino

This file was deleted.

1 change: 0 additions & 1 deletion examples/Enqueue_test/SharedVariables.h

This file was deleted.

13 changes: 0 additions & 13 deletions examples/Leds/Leds.ino

This file was deleted.

1 change: 0 additions & 1 deletion examples/Leds/SharedVariables.h

This file was deleted.

10 changes: 0 additions & 10 deletions examples/Leds/ledblue.inot

This file was deleted.

50 changes: 0 additions & 50 deletions examples/Nano33BLEMegaSketch/Accelerometer.inot

This file was deleted.

0 comments on commit 44c2c74

Please sign in to comment.