Skip to content

Commit

Permalink
Convert underscores to dashes in pinout names
Browse files Browse the repository at this point in the history
Fixes avr-rust#7.
  • Loading branch information
dylanmckay committed Nov 17, 2017
1 parent 7631735 commit f69fdc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ mod gen {
writeln!(w, "//! | | Pinout | Mcuage | Operating temperature | Operating voltage | Max speed |")?;
writeln!(w, "//! |--------|--------|---------|-----------------------|-------------------|-----------|")?;
for variant in mcu.variants.iter() {
let pinout_label = variant.pinout.as_ref().map(|p| p.replace('_', "-").to_owned()).unwrap_or_else(|| String::new());
let speed_mhz = variant.speed_max_hz / 1_000_000;
writeln!(w, "//! | {} | {} | {} | {}°C - {}°C | {}V - {}V | {} MHz |",
variant.name, variant.pinout.clone().unwrap_or_else(|| String::new()),
variant.name, pinout_label,
variant.package, variant.temperature_min,
variant.temperature_max, variant.voltage_min, variant.voltage_max,
speed_mhz)?;
Expand Down

0 comments on commit f69fdc0

Please sign in to comment.