Skip to content
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
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ members = [
"apis/sensors/proximity",
"apis/sensors/temperature",
"apis/storage/key_value",
"demos/st7789",
"demos/st7789-slint",
"libraries/embedded_graphics_libtock",
"panic_handlers/debug_panic",
"panic_handlers/small_panic",
Expand Down
35 changes: 2 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ examples: toolchain
EXCLUDE_RUNTIME := --exclude libtock --exclude libtock_runtime \
--exclude libtock_debug_panic --exclude libtock_small_panic --exclude embedded_graphics_libtock

# Arguments to pass to cargo to exclude demo crates.
EXCLUDE_RUNTIME := $(EXCLUDE_RUNTIME) --exclude st7789 --exclude st7789-slint

# Arguments to pass to cargo to exclude crates that cannot be tested by Miri. In
# addition to excluding libtock_runtime, Miri also cannot test proc macro crates
# (and in fact will generate broken data that causes cargo test to fail).
Expand All @@ -138,8 +135,6 @@ test: examples
--target=thumbv7em-none-eabi --workspace
LIBTOCK_PLATFORM=hifive1 cargo clippy $(EXCLUDE_STD) \
--target=riscv32imac-unknown-none-elf --workspace
$(MAKE) apollo3-st7789
$(MAKE) apollo3-st7789-slint
cd nightly && \
MIRIFLAGS="-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check" \
cargo miri test $(EXCLUDE_MIRI) --manifest-path=../Cargo.toml \
Expand Down Expand Up @@ -174,22 +169,6 @@ $(1): toolchain
mkdir -p target/tbf/$(1)
cp target/$(1)/$(2)/release/examples/$(EXAMPLE).{tab,tbf} \
target/tbf/$(1)

.PHONY: $(1)-st7789
$(1)-st7789: toolchain
cd demos/st7789 && LIBTOCK_PLATFORM=$(1) cargo run $(features) \
$(release) --target=$(2) --target-dir=target/$(1)
mkdir -p target/tbf/$(1)
cp demos/st7789/target/$(1)/$(2)/release/st7789.{tab,tbf} \
target/tbf/$(1)

.PHONY: $(1)-st7789-slint
$(1)-st7789-slint: toolchain
cd demos/st7789-slint && LIBTOCK_PLATFORM=$(1) cargo run $(features) \
$(release) --target=$(2) --target-dir=target/$(1)
mkdir -p target/tbf/$(1)
cp demos/st7789-slint/target/$(1)/$(2)/release/st7789-slint.{tab,tbf} \
target/tbf/$(1)
endef

# Creates the `make flash-<BOARD> EXAMPLE=<EXAMPLE>` targets. Arguments:
Expand All @@ -200,18 +179,6 @@ flash-$(1): toolchain
LIBTOCK_PLATFORM=$(1) cargo run --example $(EXAMPLE) $(features) \
$(release) --target=$(2) --target-dir=target/flash-$(1) -- \
--deploy=tockloader

.PHONY: flash-$(1)-st7789
flash-$(1)-st7789: toolchain
cd demos/st7789 && LIBTOCK_PLATFORM=$(1) cargo run $(features) \
$(release) --target=$(2) --target-dir=target/flash-$(1) -- \
--deploy=tockloader

.PHONY: flash-$(1)-st7789-slint
flash-$(1)-st7789-slint: toolchain
cd demos/st7789-slint && LIBTOCK_PLATFORM=$(1) cargo run $(features) \
$(release) --target=$(2) --target-dir=target/flash-$(1) -- \
--deploy=tockloader
endef

$(eval $(call platform_build,apollo3,thumbv7em-none-eabi))
Expand Down Expand Up @@ -246,6 +213,8 @@ $(eval $(call platform_flash,clue_nrf52840,thumbv7em-none-eabi))
demos:
$(MAKE) -C demos/embedded_graphics/spin
$(MAKE) -C demos/embedded_graphics/buttons
$(MAKE) -C demos/st7789
$(MAKE) -C demos/st7789-slint

# clean cannot safely be invoked concurrently with other actions, so we don't
# need to depend on toolchain. We also manually remove the nightly toolchain's
Expand Down
4 changes: 3 additions & 1 deletion demos/st7789-slint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "st7789-slint"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
rust-version = "1.87"
authors = ["Alistair Francis <alistair.francis@wdc.com>"]
description = """A demo to use the Slint GUI library with a ST7789 display via SPI using libtock-rs."""
license = "Apache-2.0 OR MIT"
Expand All @@ -29,3 +29,5 @@ display-interface = "0.5"
libtock_build_scripts = { path = "../../build_scripts" }

slint-build = { git = "https://github.com/slint-ui/slint" }

[workspace]
20 changes: 20 additions & 0 deletions demos/st7789-slint/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Makefile for the demo app.

# Crate name of the demo app
DEMO := st7789-slint

all: tab

include ../../Targets.mk

$(ELF_TARGETS):
LIBTOCK_LINKER_FLASH=$(F) LIBTOCK_LINKER_RAM=$(R) cargo build --target=$(T) --release
@mkdir -p target/$(A).$(F).$(R)/
@cp target/$(T)/release/$(DEMO) target/$(A).$(F).$(R)/
$(eval ELF_LIST += target/$(A).$(F).$(R)/$(DEMO),$(A).$(F).$(R))

# This target (`make tab`) is not parallel-safe
.PHONY: tab
tab: $(ELF_TARGETS)
@mkdir -p target/tab
elf2tab --kernel-major 2 --kernel-minor 1 -n $(DEMO) -o target/tab/$(DEMO).tab --stack 1024 --minimum-footer-size 256 $(ELF_LIST)
4 changes: 3 additions & 1 deletion demos/st7789/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "st7789"
version = "0.1.0"
edition = "2021"
rust-version.workspace = true
rust-version = "1.87"
authors = ["Alistair Francis <alistair.francis@wdc.com>"]
description = """A demo to drive a ST7789 display via SPI using libtock-rs."""
license = "Apache-2.0 OR MIT"
Expand All @@ -18,3 +18,5 @@ embedded-graphics = "0.8"

[build-dependencies]
libtock_build_scripts = { path = "../../build_scripts" }

[workspace]
20 changes: 20 additions & 0 deletions demos/st7789/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Makefile for the demo app.

# Crate name of the demo app
DEMO := st7789

all: tab

include ../../Targets.mk

$(ELF_TARGETS):
LIBTOCK_LINKER_FLASH=$(F) LIBTOCK_LINKER_RAM=$(R) cargo build --target=$(T) --release
@mkdir -p target/$(A).$(F).$(R)/
@cp target/$(T)/release/$(DEMO) target/$(A).$(F).$(R)/
$(eval ELF_LIST += target/$(A).$(F).$(R)/$(DEMO),$(A).$(F).$(R))

# This target (`make tab`) is not parallel-safe
.PHONY: tab
tab: $(ELF_TARGETS)
@mkdir -p target/tab
elf2tab --kernel-major 2 --kernel-minor 1 -n $(DEMO) -o target/tab/$(DEMO).tab --stack 1024 --minimum-footer-size 256 $(ELF_LIST)