mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
cargo fmt
This commit is contained in:
parent
b185e02a42
commit
6f03c40516
@ -10,8 +10,7 @@ macro_rules! binary_info_env {
|
||||
// # Safety
|
||||
//
|
||||
// We used `concat!` to null-terminate on the line above.
|
||||
let value_cstr =
|
||||
unsafe { core::ffi::CStr::from_bytes_with_nul_unchecked(value.as_bytes()) };
|
||||
let value_cstr = unsafe { core::ffi::CStr::from_bytes_with_nul_unchecked(value.as_bytes()) };
|
||||
value_cstr
|
||||
})
|
||||
};
|
||||
@ -25,8 +24,7 @@ macro_rules! binary_info_env {
|
||||
#[macro_export]
|
||||
macro_rules! binary_info_str {
|
||||
($tag:expr, $id:expr, $str:expr) => {{
|
||||
static ENTRY: $crate::binary_info::StringEntry =
|
||||
$crate::binary_info::StringEntry::new($tag, $id, $str);
|
||||
static ENTRY: $crate::binary_info::StringEntry = $crate::binary_info::StringEntry::new($tag, $id, $str);
|
||||
ENTRY.addr()
|
||||
}};
|
||||
}
|
||||
@ -39,8 +37,7 @@ macro_rules! binary_info_str {
|
||||
#[macro_export]
|
||||
macro_rules! binary_info_int {
|
||||
($tag:expr, $id:expr, $int:expr) => {{
|
||||
static ENTRY: $crate::binary_info::IntegerEntry =
|
||||
$crate::binary_info::IntegerEntry::new($tag, $id, $int);
|
||||
static ENTRY: $crate::binary_info::IntegerEntry = $crate::binary_info::IntegerEntry::new($tag, $id, $int);
|
||||
ENTRY.addr()
|
||||
}};
|
||||
}
|
||||
|
@ -48,11 +48,10 @@ pub(crate) mod relocate;
|
||||
pub use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef};
|
||||
#[cfg(all(feature = "unstable-pac", feature = "rp235x"))]
|
||||
pub use rp23_pac as pac;
|
||||
#[cfg(all(feature = "unstable-pac", feature = "rp2040"))]
|
||||
pub use rp_pac as pac;
|
||||
|
||||
#[cfg(all(not(feature = "unstable-pac"), feature = "rp235x"))]
|
||||
pub(crate) use rp23_pac as pac;
|
||||
#[cfg(all(feature = "unstable-pac", feature = "rp2040"))]
|
||||
pub use rp_pac as pac;
|
||||
#[cfg(all(not(feature = "unstable-pac"), feature = "rp2040"))]
|
||||
pub(crate) use rp_pac as pac;
|
||||
|
||||
|
@ -6,15 +6,14 @@ use critical_section::CriticalSection;
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::blocking_mutex::Mutex;
|
||||
use embassy_time_driver::{AlarmHandle, Driver};
|
||||
|
||||
use crate::interrupt::InterruptExt;
|
||||
use crate::{interrupt, pac};
|
||||
|
||||
#[cfg(feature = "rp2040")]
|
||||
use pac::TIMER;
|
||||
#[cfg(feature = "rp235x")]
|
||||
use pac::TIMER0 as TIMER;
|
||||
|
||||
use crate::interrupt::InterruptExt;
|
||||
use crate::{interrupt, pac};
|
||||
|
||||
struct AlarmState {
|
||||
timestamp: Cell<u64>,
|
||||
callback: Cell<Option<(fn(*mut ()), *mut ())>>,
|
||||
|
@ -8,10 +8,10 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
ADC_IRQ_FIFO => InterruptHandler;
|
||||
});
|
||||
|
@ -8,10 +8,10 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{Adc, Channel, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
ADC_IRQ_FIFO => InterruptHandler;
|
||||
});
|
||||
|
@ -14,11 +14,11 @@
|
||||
use assign_resources::assign_resources;
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::peripherals::{self, PIN_20, PIN_21};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -34,7 +34,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
// initialize the peripherals
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
|
@ -7,13 +7,13 @@
|
||||
/// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats)
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::channel::{Channel, Sender};
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use gpio::{AnyPin, Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -29,7 +29,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
enum LedState {
|
||||
Toggle,
|
||||
}
|
||||
|
@ -7,13 +7,13 @@
|
||||
/// [Link explaining it](https://www.physicsclassroom.com/class/sound/Lesson-3/Interference-and-Beats)
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex;
|
||||
use embassy_sync::mutex::Mutex;
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use gpio::{AnyPin, Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -29,7 +29,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
type LedType = Mutex<ThreadModeRawMutex, Option<Output<'static>>>;
|
||||
static LED: LedType = Mutex::new(None);
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
#![no_main]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Level, Output, Pull};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -24,7 +24,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Input, Level, Pull};
|
||||
use embassy_time::{with_deadline, Duration, Instant, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
pub struct Debouncer<'a> {
|
||||
input: Input<'a>,
|
||||
debounce: Duration,
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::flash::{Async, ERASE_SIZE, FLASH_BASE};
|
||||
use embassy_rp::peripherals::FLASH;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
const ADDR_OFFSET: u32 = 0x100000;
|
||||
const FLASH_SIZE: usize = 2 * 1024 * 1024;
|
||||
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Input, Level, Output, Pull};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
/// It requires an external signal to be manually triggered on PIN 16. For
|
||||
/// example, this could be accomplished using an external power source with a
|
||||
/// button so that it is possible to toggle the signal from low to high.
|
||||
|
@ -7,10 +7,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::clocks;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -9,12 +9,12 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::{self, Config, InterruptHandler};
|
||||
use embassy_rp::peripherals::I2C1;
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_async::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -30,7 +30,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
I2C1_IRQ => InterruptHandler<I2C1>;
|
||||
});
|
||||
|
@ -7,9 +7,9 @@
|
||||
#![no_main]
|
||||
|
||||
use defmt::*;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::InterruptHandler;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
// Our anonymous hypotetical temperature sensor could be:
|
||||
// a 12-bit sensor, with 100ms startup time, range of -40*C - 125*C, and precision 0.25*C
|
||||
// It requires no configuration or calibration, works with all i2c bus speeds,
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::i2c::{self, Config};
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_1::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[allow(dead_code)]
|
||||
mod mcp23017 {
|
||||
pub const ADDR: u8 = 0x20; // default addr
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::{I2C0, I2C1};
|
||||
use embassy_rp::{bind_interrupts, i2c, i2c_slave};
|
||||
use embassy_time::Timer;
|
||||
use embedded_hal_async::i2c::I2c;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::{block::ImageDef};
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
|
@ -13,6 +13,7 @@ use core::cell::{Cell, RefCell};
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{self, Adc, Blocking};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::interrupt;
|
||||
use embassy_rp::pwm::{Config, Pwm};
|
||||
@ -23,7 +24,6 @@ use embassy_time::{Duration, Ticker};
|
||||
use portable_atomic::{AtomicU32, Ordering};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -39,7 +39,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
static COUNTER: AtomicU32 = AtomicU32::new(0);
|
||||
static PWM: Mutex<CriticalSectionRawMutex, RefCell<Option<Pwm>>> = Mutex::new(RefCell::new(None));
|
||||
static ADC: Mutex<CriticalSectionRawMutex, RefCell<Option<(Adc<Blocking>, adc::Channel)>>> =
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Executor;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::multicore::{spawn_core1, Stack};
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
@ -14,7 +15,6 @@ use embassy_sync::channel::Channel;
|
||||
use embassy_time::Timer;
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -30,7 +30,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
static mut CORE1_STACK: Stack<4096> = Stack::new();
|
||||
static EXECUTOR0: StaticCell<Executor> = StaticCell::new();
|
||||
static EXECUTOR1: StaticCell<Executor> = StaticCell::new();
|
||||
|
@ -59,12 +59,12 @@
|
||||
use cortex_m_rt::entry;
|
||||
use defmt::{info, unwrap};
|
||||
use embassy_executor::{Executor, InterruptExecutor};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::interrupt;
|
||||
use embassy_rp::interrupt::{InterruptExt, Priority};
|
||||
use embassy_time::{Instant, Timer, TICK_HZ};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -80,7 +80,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::task]
|
||||
async fn run_high() {
|
||||
loop {
|
||||
|
@ -5,12 +5,12 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, InterruptHandler, Irq, Pio, PioPin, ShiftDirection, StateMachine};
|
||||
use fixed::traits::ToFixed;
|
||||
use fixed_macro::types::U56F8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -5,13 +5,13 @@
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Config, InterruptHandler, Pio, ShiftConfig, ShiftDirection};
|
||||
use embassy_rp::{bind_interrupts, Peripheral};
|
||||
use fixed::traits::ToFixed;
|
||||
use fixed_macro::types::U56F8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -7,6 +7,7 @@
|
||||
use core::fmt::Write;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::dma::{AnyChannel, Channel};
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{
|
||||
@ -16,7 +17,6 @@ use embassy_rp::pwm::{self, Pwm};
|
||||
use embassy_rp::{bind_interrupts, into_ref, Peripheral, PeripheralRef};
|
||||
use embassy_time::{Instant, Timer};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -32,7 +32,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(pub struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -13,13 +13,13 @@
|
||||
use core::mem;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Config, FifoJoin, InterruptHandler, Pio, ShiftConfig, ShiftDirection};
|
||||
use embassy_rp::{bind_interrupts, Peripheral};
|
||||
use fixed::traits::ToFixed;
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -35,7 +35,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -5,6 +5,7 @@
|
||||
use core::time::Duration;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Level;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine};
|
||||
@ -12,7 +13,6 @@ use embassy_rp::{bind_interrupts, clocks};
|
||||
use embassy_time::Timer;
|
||||
use pio::InstructionOperands;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
const REFRESH_INTERVAL: u64 = 20000;
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
|
@ -5,13 +5,13 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::{bind_interrupts, pio};
|
||||
use fixed::traits::ToFixed;
|
||||
use pio::{Common, Config, FifoJoin, Instance, InterruptHandler, Pio, PioPin, ShiftDirection, StateMachine};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -5,6 +5,7 @@
|
||||
use core::time::Duration;
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Level;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Pio, PioPin, StateMachine};
|
||||
@ -12,7 +13,6 @@ use embassy_rp::{bind_interrupts, clocks};
|
||||
use embassy_time::Timer;
|
||||
use pio::InstructionOperands;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
const DEFAULT_MIN_PULSE_WIDTH: u64 = 1000; // uncalibrated default, the shortest duty cycle sent to a servo
|
||||
const DEFAULT_MAX_PULSE_WIDTH: u64 = 2000; // uncalibrated default, the longest duty cycle sent to a servo
|
||||
const DEFAULT_MAX_DEGREE_ROTATION: u64 = 160; // 160 degrees is typical
|
||||
|
@ -8,6 +8,7 @@ use core::mem::{self, MaybeUninit};
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{Common, Config, Direction, Instance, InterruptHandler, Irq, Pio, PioPin, StateMachine};
|
||||
use embassy_time::{with_timeout, Duration, Timer};
|
||||
@ -15,7 +16,6 @@ use fixed::traits::ToFixed;
|
||||
use fixed::types::extra::U8;
|
||||
use fixed::FixedU32;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::dma::{AnyChannel, Channel};
|
||||
use embassy_rp::peripherals::PIO0;
|
||||
use embassy_rp::pio::{
|
||||
@ -17,7 +18,6 @@ use fixed::types::U24F8;
|
||||
use fixed_macro::fixed;
|
||||
use smart_leds::RGB8;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
PIO0_IRQ_0 => InterruptHandler<PIO0>;
|
||||
});
|
||||
|
@ -7,10 +7,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::pwm::{Config, Pwm};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -26,7 +26,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -5,11 +5,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::pwm::{Config, InputMode, Pwm};
|
||||
use embassy_time::{Duration, Ticker};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::{clocks, gpio};
|
||||
use embassy_time::Timer;
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let mut config = embassy_rp::config::Config::default();
|
||||
|
@ -8,6 +8,7 @@ use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice;
|
||||
use embassy_embedded_hal::shared_bus::asynch::spi::SpiDevice;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{AnyPin, Level, Output};
|
||||
use embassy_rp::i2c::{self, I2c, InterruptHandler};
|
||||
use embassy_rp::peripherals::{I2C1, SPI1};
|
||||
@ -17,7 +18,6 @@ use embassy_sync::mutex::Mutex;
|
||||
use embassy_time::Timer;
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
type Spi1Bus = Mutex<NoopRawMutex, Spi<'static, SPI1, spi::Async>>;
|
||||
type I2c1Bus = Mutex<NoopRawMutex, I2c<'static, I2C1, i2c::Async>>;
|
||||
|
||||
|
@ -19,8 +19,9 @@ use core::sync::atomic::{AtomicU32, Ordering};
|
||||
use cortex_m_rt::entry;
|
||||
use defmt::info;
|
||||
use embassy_executor::{Executor, InterruptExecutor};
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::clocks::RoscRng;
|
||||
use embassy_rp::interrupt::{Priority, InterruptExt};
|
||||
use embassy_rp::interrupt::{InterruptExt, Priority};
|
||||
use embassy_rp::peripherals::UART0;
|
||||
use embassy_rp::uart::{self, InterruptHandler, UartTx};
|
||||
use embassy_rp::{bind_interrupts, interrupt};
|
||||
@ -30,7 +31,6 @@ use embassy_time::{Duration, Ticker};
|
||||
use rand::RngCore;
|
||||
use static_cell::{ConstStaticCell, StaticCell};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -46,7 +46,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
type UartAsyncMutex = mutex::Mutex<CriticalSectionRawMutex, UartTx<'static, UART0, uart::Async>>;
|
||||
|
||||
struct MyType {
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -27,7 +27,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::{Config, Spi};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -11,6 +11,7 @@ use core::cell::RefCell;
|
||||
use defmt::*;
|
||||
use embassy_embedded_hal::shared_bus::blocking::spi::SpiDeviceWithConfig;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::{Level, Output};
|
||||
use embassy_rp::spi;
|
||||
use embassy_rp::spi::{Blocking, Spi};
|
||||
@ -26,7 +27,6 @@ use embedded_graphics::primitives::{PrimitiveStyleBuilder, Rectangle};
|
||||
use embedded_graphics::text::Text;
|
||||
use st7789::{Orientation, ST7789};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -42,7 +42,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
use crate::my_display_interface::SPIDeviceInterface;
|
||||
use crate::touch::Touch;
|
||||
|
||||
|
@ -9,13 +9,13 @@
|
||||
use defmt::*;
|
||||
use embassy_embedded_hal::SetConfig;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::spi::Spi;
|
||||
use embassy_rp::{gpio, spi};
|
||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||
use embedded_sdmmc::sdcard::{DummyCsPin, SdCard};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
struct DummyTimesource();
|
||||
|
||||
impl embedded_sdmmc::TimeSource for DummyTimesource {
|
||||
|
@ -8,9 +8,9 @@
|
||||
#![no_main]
|
||||
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::uart;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
|
@ -10,13 +10,13 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART0;
|
||||
use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config};
|
||||
use embassy_time::Timer;
|
||||
use embedded_io_async::{Read, Write};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -32,7 +32,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
UART0_IRQ => BufferedInterruptHandler<UART0>;
|
||||
});
|
||||
|
@ -4,12 +4,12 @@
|
||||
use defmt::{debug, error, info};
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART0;
|
||||
use embassy_rp::uart::{Config, DataBits, InterruptHandler as UARTInterruptHandler, Parity, StopBits, Uart};
|
||||
use embassy_time::{with_timeout, Duration, Timer};
|
||||
use heapless::Vec;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -25,7 +25,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(pub struct Irqs {
|
||||
UART0_IRQ => UARTInterruptHandler<UART0>;
|
||||
});
|
||||
|
@ -11,11 +11,11 @@
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::UART1;
|
||||
use embassy_rp::uart::{Async, Config, InterruptHandler, UartRx, UartTx};
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -31,7 +31,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
UART1_IRQ => InterruptHandler<UART1>;
|
||||
});
|
||||
|
@ -21,6 +21,7 @@ use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_futures::join::join;
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::peripherals::USB;
|
||||
use embassy_rp::usb::{Driver as UsbDriver, InterruptHandler};
|
||||
use embassy_usb::class::web_usb::{Config as WebUsbConfig, State, Url, WebUsb};
|
||||
@ -28,7 +29,6 @@ use embassy_usb::driver::{Driver, Endpoint, EndpointIn, EndpointOut};
|
||||
use embassy_usb::msos::{self, windows_version};
|
||||
use embassy_usb::{Builder, Config};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -44,7 +44,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
USBCTRL_IRQ => InterruptHandler<USB>;
|
||||
});
|
||||
|
@ -7,12 +7,12 @@
|
||||
|
||||
use defmt::info;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio;
|
||||
use embassy_rp::watchdog::*;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use gpio::{Level, Output};
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -28,7 +28,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
@ -10,6 +10,7 @@ use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_rp::adc::{self, Adc, Async, Config, InterruptHandler};
|
||||
use embassy_rp::bind_interrupts;
|
||||
use embassy_rp::block::ImageDef;
|
||||
use embassy_rp::gpio::Pull;
|
||||
use embassy_rp::peripherals::DMA_CH0;
|
||||
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
@ -17,7 +18,6 @@ use embassy_sync::zerocopy_channel::{Channel, Receiver, Sender};
|
||||
use embassy_time::{Duration, Ticker, Timer};
|
||||
use static_cell::StaticCell;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use embassy_rp::block::ImageDef;
|
||||
|
||||
#[link_section = ".start_block"]
|
||||
#[used]
|
||||
@ -33,7 +33,6 @@ pub static PICOTOOL_ENTRIES: [embassy_rp::binary_info::EntryAddr; 4] = [
|
||||
embassy_rp::binary_info_rp_program_build_attribute!(),
|
||||
];
|
||||
|
||||
|
||||
type SampleBuffer = [u16; 512];
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
|
Loading…
Reference in New Issue
Block a user