pub(crate) fn area(handle: &'a mut TargetHandle<T>, start: u32, length: usize) -> Self {
        let pages = if length == 0 {
            // No pages should be erased if the area is zero-length
            Vec::new()
        } else {
            let first_page = Page::from_address(start);
            let last_page = Page::from_address(start + length as u32 - 1);
            (first_page.into()..=last_page.into())
                .map(Page::from_index)
                .collect()
        };

        Self {
            handle,
            done: pages.is_empty(),
            count: pages.len(),
            pages,
        }
    }
/// Erase all necessary pages so that the flash area specified by a start address and length is
/// completely erased. Due to the page-wise erase, this might erase memory outside the given
/// area.
Erase all necessary pages so that the flash area specified by a start address and length is
completely erased. Due to the page-wise erase, this might erase memory outside the given
area.
Erase all necessary pages so that the flash area specified by a start address and length is completely erased . Due to the page - wise erase this might erase memory outside the given area .
pub(crate) fn area(handle: &'a mut TargetHandle<T>, start: u32, length: usize) -> Self {
        let pages = if length == 0 {
            // No pages should be erased if the area is zero-length
            Vec::new()
        } else {
            let first_page = Page::from_address(start);
            let last_page = Page::from_address(start + length as u32 - 1);
            (first_page.into()..=last_page.into())
                .map(Page::from_index)
                .collect()
        };
        Self {
            handle,
            done: pages.is_empty(),
            count: pages.len(),
            pages,
        }
    }
pub ( crate ) fn area ( handle : & ' a mut TargetHandle < T > , start : u32 , length : usize ) -> Self { let pages = if length == 0 { // No pages should be erased if the area is zero-length Vec :: new ( ) } else { let first_page = Page :: from_address ( start ) ; let last_page = Page :: from_address ( start + length as u32 - 1 ) ; ( first_page . into ( ) ..= last_page . into ( ) ) . map ( Page :: from_index ) . collect ( ) } ; Self { handle , done : pages . is_empty ( ) , count : pages . len ( ) , pages , } }
Erase all necessary pages so that the flash area specified by a start address and length is
completely erased.
Erase all necessary pages so that the flash area specified by a start address and length is completely erased .
handle
&'a mut TargetHandle<T>
start
u32
length
usize
handle
&'a mut TargetHandle<T>
start
u32
length
usize