Skip to content
Snippets Groups Projects
Commit 58b98746 authored by zdmx's avatar zdmx :crab:
Browse files

simplify template

parent 9355e705
Branches
No related tags found
1 merge request!4Split project into multiple crates
[target.xtensa-esp32s3-none-elf]
runner = "espflash flash --monitor"
[build]
rustflags = [
"-C", "link-arg=-Tlinkall.x",
"-C", "link-arg=-nostartfiles",
]
target = "xtensa-esp32s3-none-elf"
[unstable]
build-std = ["core"]
This diff is collapsed.
[package]
name = "template"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ad7147 = { path = "../vendor/ad7147" }
bmi270 = { path = "../vendor/bmi270" }
byte-slice-cast = { version = "1.2.2", default-features = false }
display-interface = { path = "../vendor/display-interface", features = ["nightly", "async", "dma"] }
embassy-executor = { version = "0.2.0", features = ["nightly", "arch-xtensa", "executor-thread", "integrated-timers"] }
embassy-futures = "0.1.0"
embassy-net = { version = "0.1.0", features = ["medium-ethernet", "udp", "proto-ipv6", "nightly", "unstable-traits"] }
embassy-net-badgelink = { path = "../embassy-net-badgelink" }
embassy-sync = "0.2.0"
embassy-time = { version = "=0.1.2", features = ["nightly", "unstable-traits"] }
embedded-dma = "0.2.0"
embedded-graphics = "0.8.0"
embedded-graphics-framebuf = "0.5.0"
embedded-hal = "0.2.7"
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.11" }
embedded-hal-async = "0.2.0-alpha.1"
embedded-hal-bus = "0.1.0-alpha.2"
esp-backtrace = { version = "0.7.0", features = ["esp32s3", "panic-handler", "exception-handler", "print-uart"] }
esp-println = { version = "0.5.0", features = ["esp32s3"] }
hal = { package = "esp32s3-hal", version = "0.11.0", features = ["embassy", "async", "embassy-time", "embassy-time-systick"] }
heapless = "0.7.16"
smart-leds = "0.3.0"
smoltcp = { version = "0.10.0", default-features = false }
static_cell = "1.2.0"
tinybmp = "0.5.0"
flow3-rs = { path = "../flow3-rs" }
flow3-rs-rt = { path = "../flow3-rs-rt" }
shared-bus = { version = "0.3.0", features = ["xtensa-lx", "xtensa"] }
[toolchain]
channel = "esp"
#![no_std]
#![no_main]
#![feature(type_alias_impl_trait)]
#![feature(async_fn_in_trait)]
mod demo_tasks;
mod ui;
use demo_tasks::draw_start_screen;
use embassy_executor::Spawner;
use embassy_time::{Duration, Timer, Delay};
use esp_backtrace as _;
use esp_println::println;
use flow3_rs::Flow3r;
use flow3_rs_rt::start_runtime;
use hal::prelude::*;
use crate::ui::main_menu::main_menu;
#[entry]
fn runtime() -> ! {
start_runtime(main)
}
#[embassy_executor::task]
async fn main(mut flow3r: Flow3r) -> ! {
println!("started main");
// draw_start_screen(&mut flow3r.take_display()).await;
let spawner = Spawner::for_current_executor().await;
spawner.spawn(demo_tasks::leds_fade(flow3r.take_leds())).unwrap();
println!("started led task");
Timer::after(Duration::from_micros(100)).await;
main_menu(flow3r).await
}
......@@ -8,7 +8,7 @@ use embedded_graphics::{
};
use esp_println::println;
use flow3_rs::{display::Display, imu::ImuHandler, Flow3r};
use flow3_rs::{display::Display, Flow3r};
use crate::demo_tasks::{display_demo, imu_demo, captouch_demo};
......
File moved
......@@ -10,14 +10,13 @@ use hal::{
timer::TimerGroup,
Rmt, Rtc, Spi, Uart, IO, uart::{self, TxRxPins}, Rng,
};
use shared_bus::{BusManager, XtensaMutex};
use static_cell::StaticCell;
use flow3_rs::{
badgelink::BadgeLink,
// badgelink::BadgeLink,
captouch::{Captouch, CaptouchRunner},
display::Display,
imu::ImuHandler,
// imu::ImuHandler,
input::{Inputs, InputRunner},
leds::init_leds,
Flow3r,
......
use embassy_executor::{Executor, Spawner, SpawnToken};
use esp_println::println;
use hal::{i2c::I2C, peripherals::I2C0, gpio::{Gpio8, Gpio0, Gpio3, Unknown}, prelude::_embedded_hal_blocking_i2c_Read};
use hal::{i2c::I2C, peripherals::I2C0};
use shared_bus::{I2cProxy, XtensaMutex};
use static_cell::StaticCell;
......
......@@ -1333,34 +1333,13 @@ dependencies = [
name = "template"
version = "0.1.0"
dependencies = [
"ad7147",
"bmi270",
"byte-slice-cast 1.2.2",
"display-interface 0.5.0-alpha.1",
"embassy-executor",
"embassy-futures",
"embassy-net",
"embassy-net-badgelink",
"embassy-sync",
"embassy-time",
"embedded-dma",
"embedded-graphics",
"embedded-graphics-framebuf",
"embedded-hal 0.2.7",
"embedded-hal 1.0.0-alpha.11",
"embedded-hal-async",
"embedded-hal-bus",
"esp-backtrace",
"esp-println",
"esp32s3-hal",
"flow3-rs",
"flow3-rs-rt",
"heapless",
"shared-bus",
"smart-leds",
"smoltcp",
"static_cell",
"tinybmp",
]
[[package]]
......
......@@ -6,31 +6,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ad7147 = { path = "../vendor/ad7147" }
bmi270 = { path = "../vendor/bmi270" }
byte-slice-cast = { version = "1.2.2", default-features = false }
display-interface = { path = "../vendor/display-interface", features = ["nightly", "async", "dma"] }
embassy-executor = { version = "0.2.0", features = ["nightly", "arch-xtensa", "executor-thread", "integrated-timers"] }
embassy-futures = "0.1.0"
embassy-net = { version = "0.1.0", features = ["medium-ethernet", "udp", "proto-ipv6", "nightly", "unstable-traits"] }
embassy-net-badgelink = { path = "../embassy-net-badgelink" }
embassy-sync = "0.2.0"
embassy-time = { version = "=0.1.2", features = ["nightly", "unstable-traits"] }
embedded-dma = "0.2.0"
embedded-graphics = "0.8.0"
embedded-graphics-framebuf = "0.5.0"
embedded-hal = "0.2.7"
embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-alpha.11" }
embedded-hal-async = "0.2.0-alpha.1"
embedded-hal-bus = "0.1.0-alpha.2"
esp-backtrace = { version = "0.7.0", features = ["esp32s3", "panic-handler", "exception-handler", "print-uart"] }
esp-println = { version = "0.5.0", features = ["esp32s3"] }
hal = { package = "esp32s3-hal", version = "0.11.0", features = ["embassy", "async", "embassy-time", "embassy-time-systick"] }
heapless = "0.7.16"
smart-leds = "0.3.0"
smoltcp = { version = "0.10.0", default-features = false }
static_cell = "1.2.0"
tinybmp = "0.5.0"
flow3-rs = { path = "../flow3-rs" }
flow3-rs-rt = { path = "../flow3-rs-rt" }
shared-bus = { version = "0.3.0", features = ["xtensa-lx", "xtensa"] }
......@@ -3,37 +3,31 @@
#![feature(type_alias_impl_trait)]
#![feature(async_fn_in_trait)]
mod demo_tasks;
mod ui;
use demo_tasks::draw_start_screen;
use embassy_executor::Spawner;
use embassy_time::{Duration, Timer, Delay};
use embassy_time::{Duration, Timer};
use esp_println::println;
use esp_backtrace as _;
use esp_println::println;
use flow3_rs::Flow3r;
use flow3_rs_rt::start_runtime;
use hal::prelude::*;
use crate::ui::main_menu::main_menu;
#[entry]
fn runtime() -> ! {
start_runtime(main)
}
#[embassy_executor::task]
async fn main(mut flow3r: Flow3r) -> ! {
println!("started main");
// draw_start_screen(&mut flow3r.take_display()).await;
async fn main(mut flow3r: Flow3r) {
let spawner = Spawner::for_current_executor().await;
spawner.spawn(demo_tasks::leds_fade(flow3r.take_leds())).unwrap();
println!("started led task");
Timer::after(Duration::from_micros(100)).await;
spawner.spawn(task()).unwrap();
}
main_menu(flow3r).await
#[embassy_executor::task]
async fn task() {
loop {
println!("running!");
Timer::after(Duration::from_secs(1)).await;
}
}
......@@ -78,7 +78,6 @@ impl InputRunner {
let inputs_publisher = INPUTS_CHANNEL.immediate_publisher();
loop {
println!("input loop");
match select3(
i2c_int.wait_for_low(),
sw1_button.wait_for_any_edge(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment