-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from lf-lang/v0.6.0
Compatibility with Lingua Franca 0.6.0
- Loading branch information
Showing
6 changed files
with
107 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'CI' | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
find-latest-release: | ||
uses: lf-lang/lingua-franca/.github/workflows/latest-release.yml@master | ||
|
||
check-compile: | ||
runs-on: ubuntu-latest | ||
needs: find-latest-release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Set up Java 17 | ||
run: | | ||
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH | ||
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Install dev dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install cmake make gcc gcc-arm-none-eabi libnewlib-arm-none-eabi | ||
- uses: lf-lang/action-check-lf-files@main | ||
with: | ||
check_mode: "compile" | ||
no_compile_flag: false | ||
exclude_dirs: '["failing", "experimental"]' | ||
checkout_dir: '../lingua-franca' | ||
compiler_ref: ${{ needs.find-latest-release.outputs.ref }} | ||
|
||
check-format: | ||
runs-on: ubuntu-latest | ||
needs: find-latest-release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Java 17 | ||
run: | | ||
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH | ||
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV | ||
shell: bash | ||
- uses: lf-lang/action-check-lf-files@main | ||
with: | ||
check_mode: "format" | ||
exclude_dirs: '["failing", "experimental"]' | ||
checkout_dir: '../lingua-franca' | ||
compiler_ref: ${{ needs.find-latest-release.outputs.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
target C { | ||
platform: "Rp2040", | ||
threading: false | ||
platform: "Rp2040", | ||
single-threaded: true | ||
} | ||
|
||
import Led from "./lib/Led.lf"; | ||
import Led from "./lib/Led.lf" | ||
|
||
main reactor { | ||
timer t1(0, 100 msec); | ||
led = new Led(); | ||
reaction(t1) -> led.tog {= | ||
lf_set(led.tog, true); | ||
=} | ||
timer t1(0, 100 msec) | ||
led = new Led() | ||
|
||
reaction(t1) -> led.tog {= | ||
lf_set(led.tog, true); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
target C { | ||
platform: "Rp2040", | ||
threading: false, | ||
timeout: 5 sec, | ||
platform: "Rp2040", | ||
single-threaded: true, | ||
timeout: 5 sec | ||
} | ||
|
||
preamble {= | ||
#include <stdio.h> | ||
#include <stdio.h> | ||
=} | ||
|
||
main reactor { | ||
timer t1(0, 1 sec); | ||
reaction(t1) {= | ||
printf("Hello World!\n"); | ||
=} | ||
timer t1(0, 1 sec) | ||
|
||
reaction(t1) {= | ||
printf("Hello World!\n"); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
target C { | ||
platform: "Rp2040", | ||
threading: false, | ||
timeout: 10 sec, | ||
platform: "Rp2040", | ||
single-threaded: true, | ||
timeout: 10 sec | ||
} | ||
|
||
preamble {= | ||
#include <stdio.h> | ||
#include "pico/stdlib.h" | ||
#include <stdio.h> | ||
#include "pico/stdlib.h" | ||
=} | ||
|
||
main reactor { | ||
timer t1(0, 1 sec); | ||
reaction(t1) {= | ||
interval_t t = lf_time_logical_elapsed(); | ||
interval_t T = lf_time_physical_elapsed(); | ||
printf( | ||
"Elapsed logical time %lld, physical time %lld, lag: %lld\n", | ||
t, T, T-t | ||
); | ||
=} | ||
timer t1(0, 1 sec) | ||
|
||
reaction(t1) {= | ||
interval_t t = lf_time_logical_elapsed(); | ||
interval_t T = lf_time_physical_elapsed(); | ||
printf( | ||
"Elapsed logical time %lld, physical time %lld, lag: %lld\n", | ||
t, T, T-t | ||
); | ||
=} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
target C { | ||
platform: "Rp2040", | ||
threading: true, | ||
workers: 2, | ||
tracing: false, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
target C { | ||
platform: "RP2040", | ||
threading: false, | ||
platform: "RP2040", | ||
single-threaded: true | ||
} | ||
|
||
preamble {= | ||
#include <pico/stdlib.h> | ||
#include <hardware/gpio.h> | ||
#include <pico/stdlib.h> | ||
#include <hardware/gpio.h> | ||
=} | ||
|
||
/** | ||
* Led reactor that keeps track of led state. | ||
* Can either be toggled or set using different signals | ||
**/ | ||
* Led reactor that keeps track of led state. Can either be toggled or set using different signals | ||
*/ | ||
reactor Led { | ||
input tog:bool; // when is_present, will toggle the led | ||
input set:bool; // when is_present, set the led state to the input value | ||
state led:bool; | ||
|
||
reaction(startup) {= | ||
gpio_init(25); | ||
gpio_set_dir(25, GPIO_OUT); | ||
=} | ||
|
||
reaction(tog) {= | ||
self->led = !self->led; | ||
gpio_put(25, self->led); | ||
=} | ||
input tog: bool // when is_present, will toggle the led | ||
input set: bool // when is_present, set the led state to the input value | ||
state led: bool | ||
|
||
reaction(set) {= | ||
self->led = set->value; | ||
gpio_put(25, self->led); | ||
=} | ||
reaction(startup) {= | ||
gpio_init(25); | ||
gpio_set_dir(25, GPIO_OUT); | ||
=} | ||
|
||
reaction(tog) {= | ||
self->led = !self->led; | ||
gpio_put(25, self->led); | ||
=} | ||
|
||
reaction(set) {= | ||
self->led = set->value; | ||
gpio_put(25, self->led); | ||
=} | ||
} |