Atprogram Commands Calling Code Review

When clicking the "program" button of the example software GUI, the example software project will execute the program_Click function in Form1.cs file. As shown below, in part of the program_Click function source code there are three atprogram commands: chiperase, program, and write.


private void program_Click(object sender, EventArgs e)
{ 
 StreamReader reader;
 .................

 // Full erase of the chip
 reader = RunProgram_atprogram("cmd.exe", "atprogram -t atmelice -i ISP -d atmega328pb chiperase", textBox1.Text);
 .................

 // Program firmware image file assigned by text of textBox2 to flash and verify after programming 
 reader = RunProgram_atprogram("cmd.exe", "atprogram -t atmelice -i ISP -d atmega328pb program -f "+textBox2.Text+" --verify",textBox1.Text);
 .................

 // Writing fuse lock bits value-0xc0(The fuse lock bits value need refer to specific device datasheet, 0xc0 just for ATmega328PB device ) 
 reader = RunProgram_atprogram("cmd.exe", "atprogram -t atmelice -i ISP -d atmega328pb write -lb --values c0 ", textBox1.Text);
 .................

}

As the example software tool is developed for ATmega328PB device programming with ISP interface, the user must replace the device name (ATmega328PB) and programming interface name (ISP) with those on the user's platform. After modification and project rebuilding, a customized mass production programming tool with Atmel-ICE will be generated.