Fix nix and update all dependecies

This commit is contained in:
NormalFall 2024-05-16 18:58:23 -04:00
parent 96c5e5929a
commit 5a2bfb0d36
6 changed files with 854 additions and 232 deletions

View file

@ -2,7 +2,7 @@
target = "thumbv6m-none-eabi" target = "thumbv6m-none-eabi"
[target.thumbv6m-none-eabi] [target.thumbv6m-none-eabi]
runner = "probe-run --chip RP2040" # "elf2uf2-rs -d" runner = "probe-rs run" # "elf2uf2-rs -d"
rustflags = [ rustflags = [
"-C", "link-arg=--nmagic", "-C", "link-arg=--nmagic",
"-C", "link-arg=-Tlink.x", "-C", "link-arg=-Tlink.x",

1002
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,13 +4,45 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } # embassy-embedded-hal = { version = "0.1.0", features = ["defmt"] }
cortex-m-rt = "0.7.0" # embassy-sync = { version = "0.5.0", features = ["defmt"] }
embassy-executor = { version = "0.5.0", features = ["task-arena-size-32768", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] }
embassy-time = { version = "0.3.0", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", features = ["defmt", "unstable-pac", "time-driver", "critical-section-impl"] }
# embassy-usb = { version = "0.1.0", features = ["defmt"] }
# embassy-net = { version = "0.4.0", features = ["defmt", "tcp", "udp", "dhcpv4", "medium-ethernet"] }
# embassy-net-wiznet = { version = "0.1.0", features = ["defmt"] }
# embassy-futures = { version = "0.1.0" }
# embassy-usb-logger = { version = "0.1.0" }
# cyw43 = { version = "0.1.0", features = ["defmt", "firmware-logs"] }
# cyw43-pio = { version = "0.1.0", features = ["defmt", "overclock"] }
defmt = "0.3" defmt = "0.3"
defmt-rtt = "0.3" defmt-rtt = "0.4"
panic-probe = { version = "0.3", features = ["print-defmt"] } # fixed = "1.23.1"
# fixed-macro = "1.2"
embassy-executor = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "integrated-timers"] } cortex-m = { version = "0.7.6", features = ["inline-asm"] }
embassy-time = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] } cortex-m-rt = "0.7.0"
embassy-rp = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] } # critical-section = "1.1"
panic-probe = { version = "0.3", features = ["print-defmt"] }
# display-interface-spi = "0.5.0"
# embedded-graphics = "0.8.1"
# display-interface = "0.5.0"
# byte-slice-cast = { version = "1.2.0", default-features = false }
# smart-leds = "0.4.0"
# heapless = "0.8"
# usbd-hid = "0.7.0"
# embedded-hal-1 = { package = "embedded-hal", version = "1.0" }
# embedded-hal-async = "1.0"
# embedded-hal-bus = { version = "0.2.0", features = ["async"] }
# embedded-io-async = { version = "0.6.1", features = ["defmt-03"] }
# embedded-storage = { version = "0.3" }
# static_cell = "2"
# portable-atomic = { version = "1.5", features = ["critical-section"] }
# log = "0.4"
# pio-proc = "0.2"
# pio = "0.2.1"
# rand = { version = "0.8.5", default-features = false }
# embedded-sdmmc = "0.7.0"

View file

@ -20,11 +20,12 @@
devShells.default = mkShell { devShells.default = mkShell {
buildInputs = [ buildInputs = [
probe-rs probe-rs
flip-link
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml) (rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
]; ];
shellHook = '' shellHook = ''
source .nix-shell-history.sh source .nix-shell-history-hook.sh
alias flash="cargo flash --chip RP2040" alias flash="cargo flash --chip RP2040"
''; '';
}; };

View file

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "nightly-2022-09-22" channel = "stable"
components = [ "rust-src", "rustfmt" ] components = [ "rust-src", "rustfmt" ]
targets = [ "thumbv6m-none-eabi" ] targets = [ "thumbv6m-none-eabi" ]

View file

@ -1,40 +1,29 @@
//! This example test the RP Pico on board LED.
//!
//! It does not work with the RP Pico W board. See wifi_blinky.rs.
#![no_std] #![no_std]
#![no_main] #![no_main]
#![feature(type_alias_impl_trait)]
use defmt::*; use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_rp::gpio; use embassy_rp::gpio;
use embassy_time::{Duration, Timer}; use embassy_time::Timer;
use gpio::{Level, Output}; use gpio::{Level, Output};
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main] #[embassy_executor::main]
async fn main(_spawner: Spawner) { async fn main(_spawner: Spawner) {
// Initialise Peripherals
let p = embassy_rp::init(Default::default()); let p = embassy_rp::init(Default::default());
// Create LED
let mut led = Output::new(p.PIN_25, Level::Low); let mut led = Output::new(p.PIN_25, Level::Low);
// Loop
loop { loop {
// Log info!("led on!");
info!("LED On!");
// Turn LED On
led.set_high(); led.set_high();
Timer::after_secs(1).await;
// Wait 100ms info!("led off!");
Timer::after(Duration::from_millis(100)).await;
// Log
info!("LED Off!");
// Turn Led Off
led.set_low(); led.set_low();
Timer::after_secs(1).await;
// Wait 100ms
Timer::after(Duration::from_millis(100)).await;
} }
} }