pub fn generate_linker_script(configuration: &Configuration) -> Result<()> {
    let mut file = OpenOptions::new().write(true).create(true).truncate(true).open("memory.x")?;

    #[allow(unused_mut)]
    let mut constants = configuration
        .port
        .linker_script_constants()
        .ok_or(anyhow!("Current board doesn't have linker script constants defined."))?;

    if std::env::var("CARGO_FEATURE_RELOCATE_TO_BOOTABLE_BANK").is_ok() {
        relocate_to_bootable_bank(&mut constants, configuration)?;
    }

    write!(
        file,
        "MEMORY\n\
         {{\n\
             FLASH : ORIGIN = 0x{:08X}, LENGTH = {}K\n\
             RAM : ORIGIN = 0x{:08X}, LENGTH = {}K\n\
         }}\n",
        constants.flash.origin,
        constants.flash.size / 1024,
        constants.ram.origin,
        constants.ram.size / 1024,
    )?;

    Ok(())
}
/// Generates the linker script `memory.x`, which describes the amount and location
/// of flash and RAM memory available to a particular Loadstone instance.
Generates the linker script `memory.x`, which describes the amount and location
of flash and RAM memory available to a particular Loadstone instance.
Generates the linker script ` memory . x ` which describes the amount and location of flash and RAM memory available to a particular Loadstone instance .
pub fn generate_linker_script(configuration: &Configuration) -> Result<()> {
    let mut file = OpenOptions::new().write(true).create(true).truncate(true).open("memory.x")?;
    #[allow(unused_mut)]
    let mut constants = configuration
        .port
        .linker_script_constants()
        .ok_or(anyhow!("Current board doesn't have linker script constants defined."))?;
    if std::env::var("CARGO_FEATURE_RELOCATE_TO_BOOTABLE_BANK").is_ok() {
        relocate_to_bootable_bank(&mut constants, configuration)?;
    }
    write!(
        file,
        "MEMORY\n\
         {{\n\
             FLASH : ORIGIN = 0x{:08X}, LENGTH = {}K\n\
             RAM : ORIGIN = 0x{:08X}, LENGTH = {}K\n\
         }}\n",
        constants.flash.origin,
        constants.flash.size / 1024,
        constants.ram.origin,
        constants.ram.size / 1024,
    )?;
    Ok(())
}
pub fn generate_linker_script ( configuration : & Configuration ) -> Result < ( ) > { let mut file = OpenOptions :: new ( ) . write ( true ) . create ( true ) . truncate ( true ) . open ( " " ) ? ; # [ allow ( unused_mut ) ] let mut constants = configuration . port . linker_script_constants ( ) . ok_or ( anyhow ! ( " " ) ) ? ; if std :: env :: var ( " " ) . is_ok ( ) { relocate_to_bootable_bank ( & mut constants , configuration ) ? ; } write ! ( file " \n \
 \n \
 \n \
 \n \
 \n " constants flash origin constants flash size 1024 constants ram origin constants ram size 1024 ) ? ; Ok ( ( ) ) }
Generates the linker script `memory.x`, which describes the amount and location
of flash and RAM memory available to a particular Loadstone instance.
Generates the linker script ` memory . x ` which describes the amount and location of flash and RAM memory available to a particular Loadstone instance .
configuration
&Configuration
configuration
&Configuration