Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reactor uc #1

Merged
merged 10 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
src-gen
bin
build
include

scripts/__pycache__
build/

.venv/
.vscode/
**/build
**/src-gen/
**/include/

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "RIOT"]
path = RIOT
url = git@github.com:RIOT-OS/RIOT.git
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The name of the LF application inside "./src" to build/run/flash etc.
LF_MAIN ?= HelloWorld

# Enable reactor-uc features
# CFLAGS += -DNETWORK_CHANNEL_TCP_POSIX
# CFLAGS += -DNETWORK_CHANNEL_COAP_RIOT

# Execute the LF compiler if build target is "all"
ifeq ($(MAKECMDGOALS),all)
_ := $(shell $(REACTOR_UC_PATH)/lfc/bin/lfc-dev src/$(LF_MAIN).lf)
endif

# ---- RIOT specific configuration ----
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/RIOT

# If no BOARD is found in the environment, use this default:
BOARD ?= native

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
DEVELHELP ?= 1

# Change this to 0 show compiler invocation lines by default:
QUIET ?= 1

include $(REACTOR_UC_PATH)/make/riot/riot-lfc.mk
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# Template project for LF applications based on RIOT OS

This is a template for Lingua Franca applications targeting RIOT OS.

## Getting started

1. Configure the name of the LF application you want to build inside the `Makefile` by specifying the `LF_MAIN` variable.
2. Configure the board to flash in the `Makefile` by specifying the `BOARD` variable.

### Example

```Makefile
LF_MAIN ?= HelloWorld
BOARD ?= native
```

## Build

```bash
make all
```

or with parameters to override the `Makefile configuration

```bash
LF_MAIN=HelloWorld BOARD=native make all
```

## Flash

```bash
make flash
```

or with parameters to override the `Makefile configuration

```bash
LF_MAIN=HelloWorld BOARD=native make flash
```

## Open Terminal

This allows to run CLI commands if a CLI is enabled or seeing debug logs etc.

```bash
make term
```

or with parameters to override the `Makefile configuration

```bash
LF_MAIN=HelloWorld BOARD=native make term
```
1 change: 1 addition & 0 deletions RIOT
Submodule RIOT added at d394f6
11 changes: 11 additions & 0 deletions src/HelloWorld.lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
target uC {
timeout: 3 sec
}

main reactor {
timer t(0, 1 sec)
reaction(t) {=
printf("Hello World from R2\n");
=}
}