fn chip_erase_program(
        &self,
        flash: &mut Flasher,
        sectors: &[FlashSector],
    ) -> Result<(), FlashBuilderError> {
        flash.run_erase(|active| active.erase_all())?;

        let r: R = flash.run_program(|active| {
            for page in Self::pages(sectors) {
                // TODO: Check this condition.
                if let Some(true) = page.erased {
                    continue;
                } else {
                    active.program_page(page.address, page.data.as_slice())?;
                }
            }
            Ok(())
        });

        r
    }
/// Program by first performing a chip erase.
Program by first performing a chip erase.
Program by first performing a chip erase .
fn chip_erase_program(
        &self,
        flash: &mut Flasher,
        sectors: &[FlashSector],
    ) -> Result<(), FlashBuilderError> {
        flash.run_erase(|active| active.erase_all())?;
        let r: R = flash.run_program(|active| {
            for page in Self::pages(sectors) {
                // TODO: Check this condition.
                if let Some(true) = page.erased {
                    continue;
                } else {
                    active.program_page(page.address, page.data.as_slice())?;
                }
            }
            Ok(())
        });
        r
    }
fn chip_erase_program ( & self , flash : & mut Flasher , sectors : & [ FlashSector ] , ) -> Result < ( ) , FlashBuilderError > { flash . run_erase ( | active | active . erase_all ( ) ) ? ; let r : R = flash . run_program ( | active | { for page in Self :: pages ( sectors ) { // TODO: Check this condition. if let Some ( true ) = page . erased { continue ; } else { active . program_page ( page . address , page . data . as_slice ( ) ) ? ; } } Ok ( ( ) ) } ) ; r }
Program by first performing a chip erase.
Program by first performing a chip erase .
&self
flash
&mut Flasher
sectors
&[FlashSector]