Skip to content

Commit

Permalink
[refactor] rp2040 platform property migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gundralaa committed Jul 16, 2023
1 parent 678d821 commit 3e7b406
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 28 deletions.
9 changes: 0 additions & 9 deletions docs/src/Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ Textbook
2. TODO
3. TODO

## Repo
This book uses the [lf-pico](https://github.com/lf-lang/lf-pico) repository as a framework that contains setup scripts and examples for the applications described. Make sure the copy of lf-pico is up to date with the current documentation. Clone or navigate to the repository, pull the latest and compare the commit sha.
```
git clone https://github.com/lf-lang/lf-pico.git
git pull
git log -1
```
latest commit sha: 9fc422f05d934fdc45b7ebace22cfdaa12b3c3f9

## Setup
One challenge of working with embedded systems is installing tooling. To create a reproducible unix shell environment that installs all required dependency applications, we use the nix package manager. Install [nix](https://nixos.org/download.html) first for your preferred platform. There is support for windows (wsl), macos and linux.

Expand Down
4 changes: 2 additions & 2 deletions src/Blink.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
cmake-include: ["../platform/pico_config.txt"]
}
Expand All @@ -17,4 +17,4 @@ main reactor {
reaction(t1) -> led.tog {=
lf_set(led.tog, true);
=}
}
}
4 changes: 2 additions & 2 deletions src/Hello.lf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
target C {
platform: "Pico",
platform: "RP2040",
files: ["../lib/"],
threading: false,
cmake-include: ["../platform/pico_config.txt", "../platform/robot_lib.txt"]
cmake-include: ["../platform/robot_lib.txt"]
}

import Display from "lib/Display.lf"
Expand Down
4 changes: 2 additions & 2 deletions src/HelloPico.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
#no-compile: true,
cmake-include: ["../platform/pico_config.txt"]
Expand All @@ -15,4 +15,4 @@ main reactor {
reaction(t1) {=
printf("Hello World!\n");
=}
}
}
7 changes: 3 additions & 4 deletions src/SquareMotors.lf
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
target C {
platform: "Pico",
platform: "RP2040",
files: ["../lib/"],
threading: false,
//no-compile: true,
cmake-include: ["../platform/pico_config.txt",
"../platform/robot_lib.txt"],
cmake-include: ["../platform/robot_lib.txt"]
}

import Display from "lib/Display.lf"
Expand Down Expand Up @@ -89,4 +88,4 @@ main reactor {
lf_set(d0.line2, buf);
=}

}
}
2 changes: 1 addition & 1 deletion src/ZephyrPico.lf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ main reactor {
reaction(startup) {=
printf("Hello World!\n");
=}
}
}
2 changes: 1 addition & 1 deletion src/lib/Button.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/Display.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
}

Expand Down Expand Up @@ -74,4 +74,4 @@ reactor Display {
// display buffer
display_show();
=}
}
}
2 changes: 1 addition & 1 deletion src/lib/Encoders.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Imu.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/Led.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false
}

Expand Down Expand Up @@ -31,4 +31,4 @@ reactor Led {
self->led = set->value;
gpio_put(25, self->led);
=}
}
}
2 changes: 1 addition & 1 deletion src/lib/Motors.lf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target C {
platform: "Pico",
platform: "RP2040",
threading: false,
}

Expand Down

0 comments on commit 3e7b406

Please sign in to comment.