diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-10-06 22:55:38 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-10-06 23:19:53 +0200 |
| commit | abc8e450f936567ad42cb34b5d2a7941b206aa5d (patch) | |
| tree | 57b8ec55ad4fc9048524f2899b34198c5a8e61df /embassy-rp/src/lib.rs | |
| parent | e2a2bd3c573928208a4c85e7fcd6ad630f23f47d (diff) | |
Edition 2024.
Diffstat (limited to 'embassy-rp/src/lib.rs')
| -rw-r--r-- | embassy-rp/src/lib.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index d03ba1fef..4cb1a0912 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![allow(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(unsafe_op_in_unsafe_fn)] | ||
| 4 | #![allow(unused_unsafe)] | ||
| 3 | #![doc = include_str!("../README.md")] | 5 | #![doc = include_str!("../README.md")] |
| 4 | #![warn(missing_docs)] | 6 | #![warn(missing_docs)] |
| 5 | 7 | ||
| @@ -190,7 +192,7 @@ macro_rules! bind_interrupts { | |||
| 190 | 192 | ||
| 191 | $( | 193 | $( |
| 192 | #[allow(non_snake_case)] | 194 | #[allow(non_snake_case)] |
| 193 | #[no_mangle] | 195 | #[unsafe(no_mangle)] |
| 194 | $(#[cfg($cond_irq)])? | 196 | $(#[cfg($cond_irq)])? |
| 195 | unsafe extern "C" fn $irq() { | 197 | unsafe extern "C" fn $irq() { |
| 196 | unsafe { | 198 | unsafe { |
| @@ -446,13 +448,13 @@ macro_rules! select_bootloader { | |||
| 446 | ( $( $feature:literal => $loader:ident, )+ default => $default:ident ) => { | 448 | ( $( $feature:literal => $loader:ident, )+ default => $default:ident ) => { |
| 447 | $( | 449 | $( |
| 448 | #[cfg(feature = $feature)] | 450 | #[cfg(feature = $feature)] |
| 449 | #[link_section = ".boot2"] | 451 | #[unsafe(link_section = ".boot2")] |
| 450 | #[used] | 452 | #[used] |
| 451 | static BOOT2: [u8; 256] = rp2040_boot2::$loader; | 453 | static BOOT2: [u8; 256] = rp2040_boot2::$loader; |
| 452 | )* | 454 | )* |
| 453 | 455 | ||
| 454 | #[cfg(not(any( $( feature = $feature),* )))] | 456 | #[cfg(not(any( $( feature = $feature),* )))] |
| 455 | #[link_section = ".boot2"] | 457 | #[unsafe(link_section = ".boot2")] |
| 456 | #[used] | 458 | #[used] |
| 457 | static BOOT2: [u8; 256] = rp2040_boot2::$default; | 459 | static BOOT2: [u8; 256] = rp2040_boot2::$default; |
| 458 | } | 460 | } |
| @@ -475,13 +477,13 @@ macro_rules! select_imagedef { | |||
| 475 | ( $( $feature:literal => $imagedef:ident, )+ default => $default:ident ) => { | 477 | ( $( $feature:literal => $imagedef:ident, )+ default => $default:ident ) => { |
| 476 | $( | 478 | $( |
| 477 | #[cfg(feature = $feature)] | 479 | #[cfg(feature = $feature)] |
| 478 | #[link_section = ".start_block"] | 480 | #[unsafe(link_section = ".start_block")] |
| 479 | #[used] | 481 | #[used] |
| 480 | static IMAGE_DEF: crate::block::ImageDef = crate::block::ImageDef::$imagedef(); | 482 | static IMAGE_DEF: crate::block::ImageDef = crate::block::ImageDef::$imagedef(); |
| 481 | )* | 483 | )* |
| 482 | 484 | ||
| 483 | #[cfg(not(any( $( feature = $feature),* )))] | 485 | #[cfg(not(any( $( feature = $feature),* )))] |
| 484 | #[link_section = ".start_block"] | 486 | #[unsafe(link_section = ".start_block")] |
| 485 | #[used] | 487 | #[used] |
| 486 | static IMAGE_DEF: crate::block::ImageDef = crate::block::ImageDef::$default(); | 488 | static IMAGE_DEF: crate::block::ImageDef = crate::block::ImageDef::$default(); |
| 487 | } | 489 | } |
| @@ -528,7 +530,7 @@ select_imagedef! { | |||
| 528 | /// } | 530 | /// } |
| 529 | /// ``` | 531 | /// ``` |
| 530 | pub fn install_core0_stack_guard() -> Result<(), ()> { | 532 | pub fn install_core0_stack_guard() -> Result<(), ()> { |
| 531 | extern "C" { | 533 | unsafe extern "C" { |
| 532 | static mut _stack_end: usize; | 534 | static mut _stack_end: usize; |
| 533 | } | 535 | } |
| 534 | unsafe { install_stack_guard(core::ptr::addr_of_mut!(_stack_end)) } | 536 | unsafe { install_stack_guard(core::ptr::addr_of_mut!(_stack_end)) } |
