diff options
| author | Caleb Jamison <[email protected]> | 2023-05-09 17:55:27 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-09 17:55:27 -0400 |
| commit | 9d971e5b150e2ebe51570040ea59e3ccdbef7b17 (patch) | |
| tree | 153a70e9123bbbd876f3a4b08659181d83ccec89 /embassy-rp/src/lib.rs | |
| parent | 5cfe1a1fb40470dfaf256fc87989fd67884113f1 (diff) | |
| parent | 856b944eaf20bbd5f1625226415af210a28af89a (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'embassy-rp/src/lib.rs')
| -rw-r--r-- | embassy-rp/src/lib.rs | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index 118ce5237..980ebe7f4 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -131,9 +131,32 @@ embassy_hal_common::peripherals! { | |||
| 131 | WATCHDOG, | 131 | WATCHDOG, |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | #[link_section = ".boot2"] | 134 | macro_rules! select_bootloader { |
| 135 | #[used] | 135 | ( $( $feature:literal => $loader:ident, )+ default => $default:ident ) => { |
| 136 | static BOOT2: [u8; 256] = *include_bytes!("boot2.bin"); | 136 | $( |
| 137 | #[cfg(feature = $feature)] | ||
| 138 | #[link_section = ".boot2"] | ||
| 139 | #[used] | ||
| 140 | static BOOT2: [u8; 256] = rp2040_boot2::$loader; | ||
| 141 | )* | ||
| 142 | |||
| 143 | #[cfg(not(any( $( feature = $feature),* )))] | ||
| 144 | #[link_section = ".boot2"] | ||
| 145 | #[used] | ||
| 146 | static BOOT2: [u8; 256] = rp2040_boot2::$default; | ||
| 147 | } | ||
| 148 | } | ||
| 149 | |||
| 150 | select_bootloader! { | ||
| 151 | "boot2-at25sf128a" => BOOT_LOADER_AT25SF128A, | ||
| 152 | "boot2-gd25q64cs" => BOOT_LOADER_GD25Q64CS, | ||
| 153 | "boot2-generic-03h" => BOOT_LOADER_GENERIC_03H, | ||
| 154 | "boot2-is25lp080" => BOOT_LOADER_IS25LP080, | ||
| 155 | "boot2-ram-memcpy" => BOOT_LOADER_RAM_MEMCPY, | ||
| 156 | "boot2-w25q080" => BOOT_LOADER_W25Q080, | ||
| 157 | "boot2-w25x10cl" => BOOT_LOADER_W25X10CL, | ||
| 158 | default => BOOT_LOADER_W25Q080 | ||
| 159 | } | ||
| 137 | 160 | ||
| 138 | pub mod config { | 161 | pub mod config { |
| 139 | use crate::clocks::ClockConfig; | 162 | use crate::clocks::ClockConfig; |
