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]
runner = "probe-run --chip RP2040" # "elf2uf2-rs -d"
runner = "probe-rs run" # "elf2uf2-rs -d"
rustflags = [
"-C", "link-arg=--nmagic",
"-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"
[dependencies]
cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
cortex-m-rt = "0.7.0"
# embassy-embedded-hal = { version = "0.1.0", features = ["defmt"] }
# 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-rtt = "0.3"
panic-probe = { version = "0.3", features = ["print-defmt"] }
defmt-rtt = "0.4"
# 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"] }
embassy-time = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-rp = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] }
cortex-m = { version = "0.7.6", features = ["inline-asm"] }
cortex-m-rt = "0.7.0"
# 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 {
buildInputs = [
probe-rs
flip-link
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
];
shellHook = ''
source .nix-shell-history.sh
source .nix-shell-history-hook.sh
alias flash="cargo flash --chip RP2040"
'';
};

View file

@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2022-09-22"
channel = "stable"
components = [ "rust-src", "rustfmt" ]
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_main]
#![feature(type_alias_impl_trait)]
use defmt::*;
use embassy_executor::Spawner;
use embassy_rp::gpio;
use embassy_time::{Duration, Timer};
use embassy_time::Timer;
use gpio::{Level, Output};
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
async fn main(_spawner: Spawner) {
// Initialise Peripherals
let p = embassy_rp::init(Default::default());
// Create LED
let mut led = Output::new(p.PIN_25, Level::Low);
// Loop
loop {
// Log
info!("LED On!");
// Turn LED On
info!("led on!");
led.set_high();
Timer::after_secs(1).await;
// Wait 100ms
Timer::after(Duration::from_millis(100)).await;
// Log
info!("LED Off!");
// Turn Led Off
info!("led off!");
led.set_low();
// Wait 100ms
Timer::after(Duration::from_millis(100)).await;
Timer::after_secs(1).await;
}
}
}