repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/uart/mod.rs
embassy-rp/src/uart/mod.rs
//! UART driver. use core::future::poll_fn; use core::marker::PhantomData; use core::sync::atomic::{AtomicU16, Ordering}; use core::task::Poll; use embassy_futures::select::{Either, select}; use embassy_hal_internal::{Peri, PeripheralType}; use embassy_sync::waitqueue::AtomicWaker; use embassy_time::{Delay, Timer}; us...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
true
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/functions.rs
embassy-rp/src/float/functions.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/functions.rs use crate::float::{Float, Int}; use crate::rom_data; trait ROMFunctions { fn sqrt(self) -> Self; fn ln(self) -> Self; fn exp(self) -> Self; fn sin(self) -> Self; ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/div.rs
embassy-rp/src/float/div.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/conv.rs use super::Float; use crate::rom_data; // Make sure this stays as a separate call, because when it's inlined the // compiler will move the save of the registers used to contain the divid...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/mod.rs
embassy-rp/src/float/mod.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/mod.rs use core::ops; // Borrowed and simplified from compiler-builtins so we can use bit ops // on floating point without macro soup. pub(crate) trait Int: Copy + core::fmt::Debug +...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/conv.rs
embassy-rp/src/float/conv.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/conv.rs use super::Float; use crate::rom_data; // Some of these are also not connected in the Pico SDK. This is probably // because the ROM version actually does a fixed point conversion, just ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/cmp.rs
embassy-rp/src/float/cmp.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/cmp.rs use super::Float; use crate::rom_data; trait ROMCmp { fn rom_cmp(self, b: Self) -> i32; } impl ROMCmp for f32 { fn rom_cmp(self, b: Self) -> i32 { rom_data::float_funcs::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/add_sub.rs
embassy-rp/src/float/add_sub.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/add_sub.rs use super::{Float, Int}; use crate::rom_data; trait ROMAdd { fn rom_add(self, b: Self) -> Self; } impl ROMAdd for f32 { fn rom_add(self, b: Self) -> Self { rom_data::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/float/mul.rs
embassy-rp/src/float/mul.rs
// Credit: taken from `rp-hal` (also licensed Apache+MIT) // https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/src/float/mul.rs use super::Float; use crate::rom_data; trait ROMMul { fn rom_mul(self, b: Self) -> Self; } impl ROMMul for f32 { fn rom_mul(self, b: Self) -> Self { rom_data::float_funcs...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/rotary_encoder.rs
embassy-rp/src/pio_programs/rotary_encoder.rs
//! PIO backed quadrature encoder use crate::Peri; use crate::gpio::Pull; use crate::pio::{ Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin, ShiftDirection, StateMachine, }; use crate::pio_programs::clock_divider::calculate_pio_clock_divider; /// This struct represents an Enco...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/pwm.rs
embassy-rp/src/pio_programs/pwm.rs
//! PIO backed PWM driver use core::time::Duration; use pio::InstructionOperands; use crate::gpio::Level; use crate::pio::{Common, Config, Direction, Instance, LoadedProgram, Pin, PioPin, StateMachine}; use crate::{Peri, clocks}; /// This converts the duration provided into the number of cycles the PIO needs to run...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/stepper.rs
embassy-rp/src/pio_programs/stepper.rs
//! Pio Stepper Driver for 5-wire steppers use core::mem::{self, MaybeUninit}; use crate::Peri; use crate::pio::{Common, Config, Direction, Instance, Irq, LoadedProgram, PioPin, StateMachine}; use crate::pio_programs::clock_divider::calculate_pio_clock_divider; /// This struct represents a Stepper driver program loa...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/onewire.rs
embassy-rp/src/pio_programs/onewire.rs
//! OneWire pio driver use crate::Peri; use crate::clocks::clk_sys_freq; use crate::gpio::Level; use crate::pio::{ Common, Config, Direction, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, }; /// This struct represents a onewire driver program pub struct PioOneWireProgram<'a, PIO: Ins...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/uart.rs
embassy-rp/src/pio_programs/uart.rs
//! Pio backed uart drivers use core::convert::Infallible; use embedded_io_async::{ErrorType, Read, Write}; use fixed::traits::ToFixed; use crate::Peri; use crate::clocks::clk_sys_freq; use crate::gpio::Level; use crate::pio::{ Common, Config, Direction as PioDirection, FifoJoin, Instance, LoadedProgram, PioPin,...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/spi.rs
embassy-rp/src/pio_programs/spi.rs
//! PIO backed SPI drivers use core::marker::PhantomData; use embassy_futures::join::join; use embassy_hal_internal::Peri; use embedded_hal_02::spi::{Phase, Polarity}; use fixed::traits::ToFixed; use fixed::types::extra::U8; use crate::clocks::clk_sys_freq; use crate::dma::{AnyChannel, Channel}; use crate::gpio::Lev...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/i2s.rs
embassy-rp/src/pio_programs/i2s.rs
//! Pio backed I2S output and output drivers use fixed::traits::ToFixed; use crate::Peri; use crate::dma::{AnyChannel, Channel, Transfer}; use crate::gpio::Pull; use crate::pio::{ Common, Config, Direction, FifoJoin, Instance, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, }; /// This struct r...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/mod.rs
embassy-rp/src/pio_programs/mod.rs
//! Pre-built pio programs for common interfaces pub mod clock_divider; pub mod hd44780; pub mod i2s; pub mod onewire; pub mod pwm; pub mod rotary_encoder; pub mod spi; pub mod stepper; pub mod uart; pub mod ws2812;
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/ws2812.rs
embassy-rp/src/pio_programs/ws2812.rs
//! [ws2812](https://www.sparkfun.com/categories/tags/ws2812) use embassy_time::Timer; use fixed::types::U24F8; use smart_leds::{RGB8, RGBW}; use crate::Peri; use crate::clocks::clk_sys_freq; use crate::dma::{AnyChannel, Channel}; use crate::pio::{ Common, Config, FifoJoin, Instance, LoadedProgram, PioPin, ShiftC...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/hd44780.rs
embassy-rp/src/pio_programs/hd44780.rs
//! [HD44780 display driver](https://www.sparkfun.com/datasheets/LCD/HD44780.pdf) use crate::Peri; use crate::dma::{AnyChannel, Channel}; use crate::pio::{ Common, Config, Direction, FifoJoin, Instance, Irq, LoadedProgram, PioPin, ShiftConfig, ShiftDirection, StateMachine, }; use crate::pio_programs::clock_div...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio_programs/clock_divider.rs
embassy-rp/src/pio_programs/clock_divider.rs
//! Helper functions for calculating PIO clock dividers use fixed::types::extra::U8; use crate::clocks::clk_sys_freq; /// Calculate a PIO clock divider value based on the desired target frequency. /// /// # Arguments /// /// * `target_hz` - The desired PIO clock frequency in Hz /// /// # Returns /// /// A fixed-poin...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rtc/filter.rs
embassy-rp/src/rtc/filter.rs
use super::DayOfWeek; use crate::pac::rtc::regs::{IrqSetup0, IrqSetup1}; /// A filter used for [`RealTimeClock::schedule_alarm`]. /// /// [`RealTimeClock::schedule_alarm`]: struct.RealTimeClock.html#method.schedule_alarm #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] #[cfg_attr(feature = "defmt", derive(defmt::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rtc/datetime_chrono.rs
embassy-rp/src/rtc/datetime_chrono.rs
use chrono::{Datelike, Timelike}; use crate::pac::rtc::regs::{Rtc0, Rtc1, Setup0, Setup1}; /// Alias for [`chrono::NaiveDateTime`] pub type DateTime = chrono::NaiveDateTime; /// Alias for [`chrono::Weekday`] pub type DayOfWeek = chrono::Weekday; /// Errors regarding the [`DateTime`] and [`DateTimeFilter`] structs. /...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rtc/mod.rs
embassy-rp/src/rtc/mod.rs
//! RTC driver. mod filter; use core::future::poll_fn; use core::sync::atomic::{AtomicBool, Ordering, compiler_fence}; use core::task::Poll; use embassy_hal_internal::{Peri, PeripheralType}; use embassy_sync::waitqueue::AtomicWaker; pub use self::filter::DateTimeFilter; #[cfg_attr(feature = "chrono", path = "dateti...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rtc/datetime_no_deps.rs
embassy-rp/src/rtc/datetime_no_deps.rs
use crate::pac::rtc::regs::{Rtc0, Rtc1, Setup0, Setup1}; /// Errors regarding the [`DateTime`] and [`DateTimeFilter`] structs. /// /// [`DateTimeFilter`]: struct.DateTimeFilter.html #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Error { /// The [DateTime] contains an invalid year value. Must be between `0.....
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio/instr.rs
embassy-rp/src/pio/instr.rs
//! Instructions controlling the PIO. use pio::{InSource, InstructionOperands, JmpCondition, OutDestination, SetDestination}; use crate::pio::{Instance, StateMachine}; impl<'d, PIO: Instance, const SM: usize> StateMachine<'d, PIO, SM> { /// Set value of scratch register X. /// /// SAFETY: autopull enabled...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/pio/mod.rs
embassy-rp/src/pio/mod.rs
//! PIO driver. use core::future::Future; use core::marker::PhantomData; use core::pin::Pin as FuturePin; use core::sync::atomic::{AtomicU8, AtomicU32, Ordering, compiler_fence}; use core::task::{Context, Poll}; use embassy_hal_internal::{Peri, PeripheralType}; use embassy_sync::waitqueue::AtomicWaker; use fixed::Fixe...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
true
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rom_data/rp235x.rs
embassy-rp/src/rom_data/rp235x.rs
//! Functions and data from the RPI Bootrom. //! //! From [Section 5.4](https://rptl.io/rp2350-datasheet#section_bootrom) of the //! RP2350 datasheet: //! //! > Whilst some ROM space is dedicated to the implementation of the boot //! > sequence and USB/UART boot interfaces, the bootrom also contains public //! > functi...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rom_data/rp2040.rs
embassy-rp/src/rom_data/rp2040.rs
//! Functions and data from the RPI Bootrom. //! //! From the [RP2040 datasheet](https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf), Section 2.8.2.1: //! //! > The Bootrom contains a number of public functions that provide useful //! > RP2040 functionality that might be needed in the absence of any other c...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-rp/src/rom_data/mod.rs
embassy-rp/src/rom_data/mod.rs
#![cfg_attr( feature = "rp2040", doc = r" Functions and data from the RPI Bootrom. From the [RP2040 datasheet](https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf), Section 2.8.2.1: > The Bootrom contains a number of public functions that provide useful > RP2040 functionality that might be needed i...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/build.rs
embassy-mspm0/build.rs
use std::cmp::Ordering; use std::collections::HashMap; use std::fmt::Write; use std::io::Write as _; use std::path::{Path, PathBuf}; use std::process::Command; use std::sync::LazyLock; use std::{env, fs}; use common::CfgSet; use mspm0_metapac::metadata::{ALL_CHIPS, METADATA}; use proc_macro2::{Ident, Literal, Span, To...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/build_common.rs
embassy-mspm0/build_common.rs
// NOTE: this file is copy-pasted between several Embassy crates, because there is no // straightforward way to share this code: // - it cannot be placed into the root of the repo and linked from each build.rs using `#[path = // "../build_common.rs"]`, because `cargo publish` requires that all files published with a cr...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/i2c.rs
embassy-mspm0/src/i2c.rs
#![macro_use] use core::future; use core::marker::PhantomData; use core::sync::atomic::{AtomicU32, Ordering}; use core::task::Poll; use embassy_embedded_hal::SetConfig; use embassy_hal_internal::PeripheralType; use embassy_sync::waitqueue::AtomicWaker; use mspm0_metapac::i2c; use crate::Peri; use crate::gpio::{AnyPi...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
true
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/time_driver.rs
embassy-mspm0/src/time_driver.rs
use core::cell::{Cell, RefCell}; use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; use core::task::Waker; use critical_section::{CriticalSection, Mutex}; use embassy_time_driver::Driver; use embassy_time_queue_utils::Queue; use mspm0_metapac::interrupt; use mspm0_metapac::tim::vals::{Cm, Cvae, CxC, EvtCfg...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/mathacl.rs
embassy-mspm0/src/mathacl.rs
//! MATHACL //! //! This HAL implements mathematical calculations performed by the CPU. #![macro_use] use core::f32::consts::PI; use core::marker::PhantomData; use embassy_hal_internal::PeripheralType; use micromath::F32Ext; use crate::Peri; use crate::pac::mathacl::{Mathacl as Regs, vals}; pub enum Precision { ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/lib.rs
embassy-mspm0/src/lib.rs
#![no_std] #![allow(unsafe_op_in_unsafe_fn)] // Doc feature labels can be tested locally by running RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))] #![cfg_attr( docsrs, doc = "<div style='padding:30px;background:#810;color:#fff...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/dma.rs
embassy-mspm0/src/dma.rs
//! Direct Memory Access (DMA) #![macro_use] use core::future::Future; use core::mem; use core::pin::Pin; use core::sync::atomic::{Ordering, compiler_fence}; use core::task::{Context, Poll}; use critical_section::CriticalSection; use embassy_hal_internal::interrupt::InterruptExt; use embassy_hal_internal::{Periphera...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/timer.rs
embassy-mspm0/src/timer.rs
#![macro_use] /// Amount of bits of a timer. #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum TimerBits { /// 16 bits. Bits16, /// 32 bits. Bits32, } #[allow(private_bounds)] pub trait Timer: SealedTimer + 'static { /// Amount of bits this...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/macros.rs
embassy-mspm0/src/macros.rs
#![macro_use] #[allow(unused)] macro_rules! new_pin { ($name: ident, $pf_type: expr) => {{ let pin = $name; pin.set_as_pf(pin.pf_num(), $pf_type); Some(pin.into()) }}; }
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/wwdt.rs
embassy-mspm0/src/wwdt.rs
//! Window Watchdog Timer (WWDT) driver. //! //! This HAL implements a basic window watchdog timer with handles. #![macro_use] use embassy_hal_internal::PeripheralType; use crate::Peri; use crate::pac::wwdt::{Wwdt as Regs, vals}; use crate::pac::{self}; /// Possible watchdog timeout values. #[derive(Clone, Copy, Pa...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/i2c_target.rs
embassy-mspm0/src/i2c_target.rs
//! Inter-Integrated-Circuit (I2C) Target // The following code is modified from embassy-stm32 and embassy-rp // https://github.com/embassy-rs/embassy/tree/main/embassy-stm32 // https://github.com/embassy-rs/embassy/tree/main/embassy-rp use core::future::poll_fn; use core::marker::PhantomData; use core::sync::atomic::...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/adc.rs
embassy-mspm0/src/adc.rs
#![macro_use] use core::future::poll_fn; use core::marker::PhantomData; use core::task::Poll; use embassy_hal_internal::{PeripheralType, impl_peripheral}; use embassy_sync::waitqueue::AtomicWaker; use crate::interrupt::{Interrupt, InterruptExt}; use crate::mode::{Async, Blocking, Mode}; use crate::pac::adc::{Adc as ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/fmt.rs
embassy-mspm0/src/fmt.rs
#![macro_use] #![allow(unused)] use core::fmt::{Debug, Display, LowerHex}; #[cfg(all(feature = "defmt", feature = "log"))] compile_error!("You may not enable both `defmt` and `log` features."); #[collapse_debuginfo(yes)] macro_rules! assert { ($($x:tt)*) => { { #[cfg(not(feature = "defmt"))] ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/gpio.rs
embassy-mspm0/src/gpio.rs
#![macro_use] use core::convert::Infallible; use core::future::Future; use core::pin::Pin as FuturePin; use core::task::{Context, Poll}; use embassy_hal_internal::{Peri, PeripheralType, impl_peripheral}; use embassy_sync::waitqueue::AtomicWaker; use crate::pac::gpio::vals::*; use crate::pac::gpio::{self}; #[cfg(all(...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/uart/buffered.rs
embassy-mspm0/src/uart/buffered.rs
use core::future::{Future, poll_fn}; use core::marker::PhantomData; use core::slice; use core::sync::atomic::{AtomicU8, Ordering}; use core::task::Poll; use embassy_embedded_hal::SetConfig; use embassy_hal_internal::atomic_ring_buffer::RingBuffer; use embassy_hal_internal::interrupt::InterruptExt; use embassy_sync::wa...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-mspm0/src/uart/mod.rs
embassy-mspm0/src/uart/mod.rs
#![macro_use] mod buffered; use core::marker::PhantomData; use core::sync::atomic::{AtomicU32, Ordering, compiler_fence}; pub use buffered::*; use embassy_embedded_hal::SetConfig; use embassy_hal_internal::PeripheralType; use crate::Peri; use crate::gpio::{AnyPin, PfType, Pull, SealedPin}; use crate::interrupt::{In...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-net-nrf91/src/lib.rs
embassy-net-nrf91/src/lib.rs
#![no_std] #![allow(unsafe_op_in_unsafe_fn)] #![doc = include_str!("../README.md")] #![warn(missing_docs)] #![deny(unused_must_use)] // must be first mod fmt; pub mod context; use core::cell::RefCell; use core::future::{Future, poll_fn}; use core::marker::PhantomData; use core::mem::{self, MaybeUninit}; use core::pt...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
true
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-net-nrf91/src/context.rs
embassy-net-nrf91/src/context.rs
//! Helper utility to configure a specific modem context. use core::net::IpAddr; use core::str::FromStr; use at_commands::builder::CommandBuilder; use at_commands::parser::CommandParser; use embassy_time::{Duration, Timer}; use heapless::Vec; /// Provides a higher level API for controlling a given context. pub struct...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-net-nrf91/src/fmt.rs
embassy-net-nrf91/src/fmt.rs
#![macro_use] #![allow(unused)] use core::fmt::{Debug, Display, LowerHex}; #[cfg(all(feature = "defmt", feature = "log"))] compile_error!("You may not enable both `defmt` and `log` features."); #[collapse_debuginfo(yes)] macro_rules! assert { ($($x:tt)*) => { { #[cfg(not(feature = "defmt"))] ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-net-driver/src/lib.rs
embassy-net-driver/src/lib.rs
#![no_std] #![allow(unsafe_op_in_unsafe_fn)] #![warn(missing_docs)] #![doc = include_str!("../README.md")] use core::task::Context; /// Representation of an hardware address, such as an Ethernet address or an IEEE802.15.4 address. #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/build.rs
embassy-executor/build.rs
#[path = "./build_common.rs"] mod common; fn main() { let mut rustc_cfgs = common::CfgSet::new(); common::set_target_cfgs(&mut rustc_cfgs); // This is used to exclude legacy architecture support. The raw executor needs to be used for // those architectures because SEV/WFE are not supported. #[cfg(...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/build_common.rs
embassy-executor/build_common.rs
// NOTE: this file is copy-pasted between several Embassy crates, because there is no // straightforward way to share this code: // - it cannot be placed into the root of the repo and linked from each build.rs using `#[path = // "../build_common.rs"]`, because `cargo publish` requires that all files published with a cr...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/spawner.rs
embassy-executor/src/spawner.rs
use core::future::{Future, poll_fn}; use core::marker::PhantomData; use core::mem; use core::sync::atomic::Ordering; use core::task::Poll; use super::raw; use crate::Metadata; /// Token to spawn a newly-created task in an executor. /// /// When calling a task function (like `#[embassy_executor::task] async fn my_task...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/lib.rs
embassy-executor/src/lib.rs
#![cfg_attr(not(any(feature = "arch-std", feature = "arch-wasm")), no_std)] #![allow(clippy::new_without_default)] #![allow(unsafe_op_in_unsafe_fn)] #![doc = include_str!("../README.md")] #![warn(missing_docs)] //! ## Feature flags #![doc = document_features::document_features!(feature_label = r#"<span class="stab por...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/metadata.rs
embassy-executor/src/metadata.rs
#[cfg(feature = "metadata-name")] use core::cell::Cell; use core::future::{Future, poll_fn}; #[cfg(feature = "scheduler-priority")] use core::sync::atomic::{AtomicU8, Ordering}; use core::task::Poll; #[cfg(feature = "metadata-name")] use critical_section::Mutex; use crate::raw; #[cfg(feature = "scheduler-deadline")] ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/fmt.rs
embassy-executor/src/fmt.rs
#![macro_use] #![allow(unused)] use core::fmt::{Debug, Display, LowerHex}; #[cfg(all(feature = "defmt", feature = "log"))] compile_error!("You may not enable both `defmt` and `log` features."); #[collapse_debuginfo(yes)] macro_rules! assert { ($($x:tt)*) => { { #[cfg(not(feature = "defmt"))] ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/state_critical_section.rs
embassy-executor/src/raw/state_critical_section.rs
use core::cell::Cell; use critical_section::{CriticalSection, Mutex}; pub(crate) use critical_section::{CriticalSection as Token, with as locked}; #[cfg(target_arch = "avr")] type StateBits = u8; #[cfg(not(target_arch = "avr"))] type StateBits = usize; /// Task is spawned (has a future) pub(crate) const STATE_SPAWNE...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/trace.rs
embassy-executor/src/raw/trace.rs
//! # Tracing //! //! The `trace` feature enables a number of callbacks that can be used to track the //! lifecycle of tasks and/or executors. //! //! Callbacks will have one or both of the following IDs passed to them: //! //! 1. A `task_id`, a `u32` value unique to a task for the duration of the time it is valid //! ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/deadline.rs
embassy-executor/src/raw/deadline.rs
use core::sync::atomic::{AtomicU32, Ordering}; /// A type for interacting with the deadline of the current task /// /// Requires the `scheduler-deadline` feature. /// /// Note: Interacting with the deadline should be done locally in a task. /// In theory you could try to set or read the deadline from another task, ///...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/util.rs
embassy-executor/src/raw/util.rs
use core::cell::UnsafeCell; use core::mem::MaybeUninit; use core::ptr; pub(crate) struct UninitCell<T>(MaybeUninit<UnsafeCell<T>>); impl<T> UninitCell<T> { pub const fn uninit() -> Self { Self(MaybeUninit::uninit()) } pub unsafe fn as_mut_ptr(&self) -> *mut T { (*self.0.as_ptr()).get() ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/mod.rs
embassy-executor/src/raw/mod.rs
//! Raw executor. //! //! This module exposes "raw" Executor and Task structs for more low level control. //! //! ## WARNING: here be dragons! //! //! Using this module requires respecting subtle safety contracts. If you can, prefer using the safe //! [executor wrappers](crate::Executor) and the [`embassy_executor::tas...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/waker_turbo.rs
embassy-executor/src/raw/waker_turbo.rs
use core::ptr::NonNull; use core::task::Waker; use super::{TaskHeader, TaskRef, wake_task}; pub(crate) unsafe fn from_task(p: TaskRef) -> Waker { Waker::from_turbo_ptr(NonNull::new_unchecked(p.as_ptr() as _)) } /// Get a task pointer from a waker. /// /// This can be used as an optimization in wait queues to sto...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/waker.rs
embassy-executor/src/raw/waker.rs
use core::task::{RawWaker, RawWakerVTable, Waker}; use super::{TaskHeader, TaskRef, wake_task}; static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop); unsafe fn clone(p: *const ()) -> RawWaker { RawWaker::new(p, &VTABLE) } unsafe fn wake(p: *const ()) { wake_task(TaskRef::from_ptr(p a...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/state_atomics.rs
embassy-executor/src/raw/state_atomics.rs
// Prefer pointer-width atomic operations, as narrower ones may be slower. #[cfg(all(target_pointer_width = "32", target_has_atomic = "32"))] type AtomicState = core::sync::atomic::AtomicU32; #[cfg(not(all(target_pointer_width = "32", target_has_atomic = "32")))] type AtomicState = core::sync::atomic::AtomicU8; #[cfg(...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/run_queue.rs
embassy-executor/src/raw/run_queue.rs
use core::ptr::{NonNull, addr_of_mut}; use cordyceps::Linked; #[cfg(any(feature = "scheduler-priority", feature = "scheduler-deadline"))] use cordyceps::SortedList; use cordyceps::sorted_list::Links; #[cfg(target_has_atomic = "ptr")] type TransferStack<T> = cordyceps::TransferStack<T>; #[cfg(not(target_has_atomic = ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/raw/state_atomics_arm.rs
embassy-executor/src/raw/state_atomics_arm.rs
use core::sync::atomic::{AtomicBool, AtomicU32, Ordering, compiler_fence}; #[derive(Clone, Copy)] pub(crate) struct Token(()); /// Creates a token and passes it to the closure. /// /// This is a no-op replacement for `CriticalSection::with` because we don't need any locking. pub(crate) fn locked<R>(f: impl FnOnce(Tok...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/avr.rs
embassy-executor/src/arch/avr.rs
#[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-avr`."); #[cfg(feature = "executor-thread")] pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { use core::marker::PhantomData; pub use embassy_executor_macros::main_avr as main; use por...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/cortex_ar.rs
embassy-executor/src/arch/cortex_ar.rs
#[cfg(arm_profile = "legacy")] compile_error!("`arch-cortex-ar` does not support the legacy ARM profile, WFE/SEV are not available."); #[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-cortex-ar`."); #[unsafe(export_name = "__pender")] #[cfg(any(feature = "executo...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/wasm.rs
embassy-executor/src/arch/wasm.rs
#[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-wasm`."); #[cfg(feature = "executor-thread")] pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { use core::marker::PhantomData; pub use embassy_executor_macros::main_wasm as main; use ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/spin.rs
embassy-executor/src/arch/spin.rs
#[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-spin`."); #[cfg(feature = "executor-thread")] pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { use core::marker::PhantomData; pub use embassy_executor_macros::main_spin as main; use ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/riscv32.rs
embassy-executor/src/arch/riscv32.rs
#[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-riscv32`."); #[cfg(feature = "executor-thread")] pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { use core::marker::PhantomData; use core::sync::atomic::{AtomicBool, Ordering}; pub us...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/std.rs
embassy-executor/src/arch/std.rs
#[cfg(feature = "executor-interrupt")] compile_error!("`executor-interrupt` is not supported with `arch-std`."); #[cfg(feature = "executor-thread")] pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { use std::marker::PhantomData; use std::sync::{Condvar, Mutex}; pub use embassy_executor_m...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/src/arch/cortex_m.rs
embassy-executor/src/arch/cortex_m.rs
#[unsafe(export_name = "__pender")] #[cfg(any(feature = "executor-thread", feature = "executor-interrupt"))] fn __pender(context: *mut ()) { unsafe { // Safety: `context` is either `usize::MAX` created by `Executor::run`, or a valid interrupt // request number given to `InterruptExecutor::start`. ...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/test.rs
embassy-executor/tests/test.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #![cfg_attr(feature = "nightly", feature(never_type))] use std::boxed::Box; use std::future::{Future, poll_fn}; use std::sync::{Arc, Mutex}; use std::task::Poll; use embassy_executor::raw::Executor; use embassy_executor::{Spawner, task}; #[unsafe(e...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui.rs
embassy-executor/tests/ui.rs
#[cfg(not(miri))] #[test] fn ui() { let t = trybuild::TestCases::new(); t.compile_fail("tests/ui/abi.rs"); t.compile_fail("tests/ui/bad_return.rs"); t.compile_fail("tests/ui/generics.rs"); t.compile_fail("tests/ui/impl_trait_nested.rs"); t.compile_fail("tests/ui/impl_trait.rs"); t.compile_fa...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_struct_anon.rs
embassy-executor/tests/ui/nonstatic_struct_anon.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task(_x: Foo<'_>) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/return_impl_send_nightly.rs
embassy-executor/tests/ui/return_impl_send_nightly.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] fn task() -> impl Send {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/bad_return.rs
embassy-executor/tests/ui/bad_return.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task() -> u32 { 5 } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/type_error.rs
embassy-executor/tests/ui/type_error.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn task() { 5 } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/task_safety_attribute.rs
embassy-executor/tests/ui/task_safety_attribute.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #![deny(unused_unsafe)] use std::mem; #[embassy_executor::task] async fn safe() {} #[embassy_executor::task] async unsafe fn not_safe() {} #[unsafe(export_name = "__pender")] fn pender(_: *mut ()) { // The test doesn't link if we don't include...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/self.rs
embassy-executor/tests/ui/self.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task(self) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/bad_return_impl_future.rs
embassy-executor/tests/ui/bad_return_impl_future.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] use core::future::Future; #[embassy_executor::task] fn task() -> impl Future<Output = u32> { async { 5 } } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/where_clause.rs
embassy-executor/tests/ui/where_clause.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task() where (): Sized, { } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/abi.rs
embassy-executor/tests/ui/abi.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async extern "C" fn task() {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/not_async.rs
embassy-executor/tests/ui/not_async.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] fn task() {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/spawn_nonsend.rs
embassy-executor/tests/ui/spawn_nonsend.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] use embassy_executor::SendSpawner; #[embassy_executor::task] async fn task(non_send: *mut ()) { println!("{}", non_send as usize); } fn send_spawn(s: SendSpawner) { s.spawn(task(core::ptr::null_mut()).unwrap()); } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_ref_anon_nested.rs
embassy-executor/tests/ui/nonstatic_ref_anon_nested.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo(_x: &'static &'_ u32) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/impl_trait_static.rs
embassy-executor/tests/ui/impl_trait_static.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo(_x: impl Sized + 'static) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/generics.rs
embassy-executor/tests/ui/generics.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task<T: Sized>(_t: T) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/impl_trait.rs
embassy-executor/tests/ui/impl_trait.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo(_x: impl Sized) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/unsafe_op_in_unsafe_task.rs
embassy-executor/tests/ui/unsafe_op_in_unsafe_task.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #![deny(unsafe_op_in_unsafe_fn)] #[embassy_executor::task] async unsafe fn task() { let x = 5; (&x as *const i32).read(); } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_ref_generic.rs
embassy-executor/tests/ui/nonstatic_ref_generic.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo<'a>(_x: &'a u32) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/bad_return_impl_future_nightly.rs
embassy-executor/tests/ui/bad_return_impl_future_nightly.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] use core::future::Future; #[embassy_executor::task] fn task() -> impl Future<Output = u32> { async { 5 } } fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/return_impl_send.rs
embassy-executor/tests/ui/return_impl_send.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] fn task() -> impl Send {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_struct_elided.rs
embassy-executor/tests/ui/nonstatic_struct_elided.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task(_x: Foo) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/impl_trait_nested.rs
embassy-executor/tests/ui/impl_trait_nested.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<T>(T); #[embassy_executor::task] async fn foo(_x: Foo<impl Sized + 'static>) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/return_impl_future_nonsend.rs
embassy-executor/tests/ui/return_impl_future_nonsend.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] use core::future::Future; use embassy_executor::SendSpawner; #[embassy_executor::task] fn task() -> impl Future<Output = ()> { // runs in spawning thread let non_send: *mut () = core::ptr::null_mut(); async move { // runs in exe...
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_struct_generic.rs
embassy-executor/tests/ui/nonstatic_struct_generic.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task<'a>(_x: Foo<'a>) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_ref_anon.rs
embassy-executor/tests/ui/nonstatic_ref_anon.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo(_x: &'_ u32) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/self_ref.rs
embassy-executor/tests/ui/self_ref.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] struct Foo<'a>(&'a ()); #[embassy_executor::task] async fn task(&mut self) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-executor/tests/ui/nonstatic_ref_elided.rs
embassy-executor/tests/ui/nonstatic_ref_elided.rs
#![cfg_attr(feature = "nightly", feature(impl_trait_in_assoc_type))] #[embassy_executor::task] async fn foo(_x: &u32) {} fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false
embassy-rs/embassy
https://github.com/embassy-rs/embassy/blob/f242d794e3325bc9b3559e50d2ea7fc293e1d574/embassy-time-driver/build.rs
embassy-time-driver/build.rs
fn main() {}
rust
Apache-2.0
f242d794e3325bc9b3559e50d2ea7fc293e1d574
2026-01-04T15:48:40.485023Z
false