Skip to content

Commit

Permalink
Updated copyright notice and embassy dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjasource committed Jan 7, 2025
1 parent 456e29e commit da79383
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 6 deletions.
17 changes: 11 additions & 6 deletions examples/mcu-embassy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Copyright © 2025 David Haig
# SPDX-License-Identifier: MIT

[package]
name = "mcu-embassy"
version = "0.1.0"
edition = "2021"
authors = ["David Haig <[email protected]>"]
readme = "README.md"
resolver = "2"
license = "MIT"
publish = false
repository = "https://github.com/slint-ui/slint"
homepage = "https://slint.dev"

Expand Down Expand Up @@ -33,7 +38,7 @@ slint = { version = "=1.9.0", path = "../../api/rs/slint", default-features = fa
] }
i-slint-core-macros = { version = "=1.9.0", path = "../../internal/core-macros" }

embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe", optional = true, features = [
embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "4790f8f", optional = true, features = [
"stm32u5g9zj",
"time-driver-tim2",
"exti",
Expand All @@ -42,14 +47,14 @@ embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe"
"chrono",
"time",
] }
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe", optional = true }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe", optional = true, features = [
embassy-sync = { git = "https://github.com/embassy-rs/embassy", rev = "4790f8f", optional = true }
embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "4790f8f", optional = true, features = [
"task-arena-size-32768",
"arch-cortex-m",
"executor-thread",
"integrated-timers",
] }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe", optional = true }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "72976fe", optional = true }
embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "4790f8f", optional = true }
embassy-futures = { git = "https://github.com/embassy-rs/embassy", rev = "4790f8f", optional = true }

env_logger = { version = "0.9.0", optional = true }
sdl2 = { git = "https://github.com/Rust-SDL2/rust-sdl2", rev = "400e033", optional = true }
Expand Down
5 changes: 5 additions & 0 deletions examples/mcu-embassy/slint_generated/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Copyright © 2025 David Haig
# SPDX-License-Identifier: MIT

[package]
name = "slint-generated"
version = "0.1.0"
edition = "2021"
build = "build.rs"
authors = ["David Haig <[email protected]>"]
readme = "README.md"
resolver = "2"
license = "MIT"
publish = false
repository = "https://github.com/slint-ui/slint"
homepage = "https://slint.dev"

Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/slint_generated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated

This crate is here to separate the `.slint` file compilation from the main application.
3 changes: 3 additions & 0 deletions examples/mcu-embassy/slint_generated/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

fn main() {
let config = slint_build::CompilerConfiguration::new()
.embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer);
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/slint_generated/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

#![no_std]

slint::include_modules!();
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/bin/ui_mcu.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

// A demo for stm32u5g9j-dk2
// The application renders a simple Slint screen to the display and the user can interact with it
// by toggling the green led on and off as well as pushing the blue button on the dk which should
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/bin/ui_simulator.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

// A simulator for the stm32u5g9j-dk2
// This uses the cross platform sdl2 library to render the application on a PC (see readme for installation instructions)
// The LEFTSHIFT key can be used in place of the blue push button on the dk2 (Hardware User Button)
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/controller.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use embassy_sync::channel::Channel;
use slint::ComponentHandle;
use slint_generated::{Globals, MainWindow};
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

#![cfg_attr(feature = "mcu", no_std)]

extern crate alloc;
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/mcu/double_buffer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use embassy_stm32::ltdc::{self, Ltdc, LtdcLayerConfig};
use slint::platform::software_renderer::Rgb565Pixel;

Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/mcu/hardware.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use crate::controller::Hardware;

pub struct HardwareMcu {
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/mcu/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

pub mod double_buffer;
pub mod hardware;
pub mod rcc_setup;
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/mcu/rcc_setup.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use embassy_stm32::time::Hertz;
use embassy_stm32::{rcc, Config, Peripherals};

Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/simulator/hardware.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use crate::controller::Hardware;
use crate::info;

Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/simulator/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

pub mod hardware;
3 changes: 3 additions & 0 deletions examples/mcu-embassy/src/slint_backend.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

use alloc::rc::Rc;
use embassy_time::Instant;
use slint::{
Expand Down
2 changes: 2 additions & 0 deletions examples/mcu-embassy/ui/common.slint
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

export global Globals {
in property <bool> hardware-user-btn-pressed;
Expand Down
3 changes: 3 additions & 0 deletions examples/mcu-embassy/ui/main.slint
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 David Haig
// SPDX-License-Identifier: MIT

import { Globals, Button, Theme, Toggle } from "common.slint";

export { Globals }
Expand Down

0 comments on commit da79383

Please sign in to comment.