refactor(boot): change generics name to match existing convention

This commit is contained in:
Badr Bouslikhin 2024-02-07 11:32:13 +01:00
parent c267cb9ab7
commit af2b4df833
No known key found for this signature in database
GPG key ID: 3B081233DD4DE99B
3 changed files with 15 additions and 18 deletions
embassy-boot/src

View file

@ -49,19 +49,19 @@ pub struct BootLoaderConfig<ACTIVE, DFU, STATE> {
pub state: STATE, pub state: STATE,
} }
impl<'a, ActiveFlash: NorFlash, DFUFlash: NorFlash, StateFlash: NorFlash> impl<'a, ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash>
BootLoaderConfig< BootLoaderConfig<
BlockingPartition<'a, NoopRawMutex, ActiveFlash>, BlockingPartition<'a, NoopRawMutex, ACTIVE>,
BlockingPartition<'a, NoopRawMutex, DFUFlash>, BlockingPartition<'a, NoopRawMutex, DFU>,
BlockingPartition<'a, NoopRawMutex, StateFlash>, BlockingPartition<'a, NoopRawMutex, STATE>,
> >
{ {
/// Create a bootloader config from the flash and address symbols defined in the linkerfile /// Create a bootloader config from the flash and address symbols defined in the linkerfile
// #[cfg(target_os = "none")] // #[cfg(target_os = "none")]
pub fn from_linkerfile_blocking( pub fn from_linkerfile_blocking(
active_flash: &'a Mutex<NoopRawMutex, RefCell<ActiveFlash>>, active_flash: &'a Mutex<NoopRawMutex, RefCell<ACTIVE>>,
dfu_flash: &'a Mutex<NoopRawMutex, RefCell<DFUFlash>>, dfu_flash: &'a Mutex<NoopRawMutex, RefCell<DFU>>,
state_flash: &'a Mutex<NoopRawMutex, RefCell<StateFlash>>, state_flash: &'a Mutex<NoopRawMutex, RefCell<STATE>>,
) -> Self { ) -> Self {
extern "C" { extern "C" {
static __bootloader_state_start: u32; static __bootloader_state_start: u32;

View file

@ -16,13 +16,13 @@ pub struct FirmwareUpdater<'d, DFU: NorFlash, STATE: NorFlash> {
} }
#[cfg(target_os = "none")] #[cfg(target_os = "none")]
impl<'a, DFUFlash: NorFlash, StateFlash: NorFlash> impl<'a, DFU: NorFlash, STATE: NorFlash>
FirmwareUpdaterConfig<Partition<'a, NoopRawMutex, DFUFlash>, Partition<'a, NoopRawMutex, StateFlash>> FirmwareUpdaterConfig<Partition<'a, NoopRawMutex, DFU>, Partition<'a, NoopRawMutex, STATE>>
{ {
/// Create a firmware updater config from the flash and address symbols defined in the linkerfile /// Create a firmware updater config from the flash and address symbols defined in the linkerfile
pub fn from_linkerfile( pub fn from_linkerfile(
dfu_flash: &'a embassy_sync::mutex::Mutex<NoopRawMutex, DFUFlash>, dfu_flash: &'a embassy_sync::mutex::Mutex<NoopRawMutex, DFU>,
state_flash: &'a embassy_sync::mutex::Mutex<NoopRawMutex, StateFlash>, state_flash: &'a embassy_sync::mutex::Mutex<NoopRawMutex, STATE>,
) -> Self { ) -> Self {
extern "C" { extern "C" {
static __bootloader_state_start: u32; static __bootloader_state_start: u32;

View file

@ -16,16 +16,13 @@ pub struct BlockingFirmwareUpdater<'d, DFU: NorFlash, STATE: NorFlash> {
} }
#[cfg(target_os = "none")] #[cfg(target_os = "none")]
impl<'a, DFUFlash: NorFlash, StateFlash: NorFlash> impl<'a, DFU: NorFlash, STATE: NorFlash>
FirmwareUpdaterConfig< FirmwareUpdaterConfig<BlockingPartition<'a, NoopRawMutex, DFU>, BlockingPartition<'a, NoopRawMutex, STATE>>
BlockingPartition<'a, NoopRawMutex, DFUFlash>,
BlockingPartition<'a, NoopRawMutex, StateFlash>,
>
{ {
/// Create a firmware updater config from the flash and address symbols defined in the linkerfile /// Create a firmware updater config from the flash and address symbols defined in the linkerfile
pub fn from_linkerfile_blocking( pub fn from_linkerfile_blocking(
dfu_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<DFUFlash>>, dfu_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<DFU>>,
state_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<StateFlash>>, state_flash: &'a embassy_sync::blocking_mutex::Mutex<NoopRawMutex, core::cell::RefCell<STATE>>,
) -> Self { ) -> Self {
extern "C" { extern "C" {
static __bootloader_state_start: u32; static __bootloader_state_start: u32;