Allow passing an MCU description to reprocess just that one file.

This is a useful convenience for debugging one particular processor
This commit is contained in:
Savanni D'Gerinel 2023-04-02 13:20:16 -04:00
parent f17af2ba44
commit bda8637c08
3 changed files with 8 additions and 137 deletions

View File

@ -139,8 +139,13 @@ fn main() {
fs::create_dir_all(&cores_path()).expect("could not create cores directory"); fs::create_dir_all(&cores_path()).expect("could not create cores directory");
} }
let microcontrollers = avr_mcu::microcontrollers(); let args: Vec<String> = std::env::args().collect();
// let microcontrollers = vec![avr_mcu::microcontroller("atmega32u4")]; println!("args: {:?}", args);
let microcontrollers = if args.len() > 2 {
vec![avr_mcu::microcontroller(args[2].as_ref())]
} else {
Vec::from(avr_mcu::microcontrollers())
};
let (count_total, mut cores_successful, mut cores_failed) = let (count_total, mut cores_successful, mut cores_failed) =
(microcontrollers.len(), Vec::new(), Vec::new()); (microcontrollers.len(), Vec::new(), Vec::new());

View File

@ -6,5 +6,5 @@ SCRIPT_DIR=$(dirname $0)
cd "${SCRIPT_DIR}/core_generator" cd "${SCRIPT_DIR}/core_generator"
cargo run "../src" cargo run -- ../src $1

View File

@ -1,141 +1,7 @@
//! The primary module containing microcontroller-specific core definitions //! The primary module containing microcontroller-specific core definitions
/// The ATmega48PA.
#[cfg(any(avr_mcu_atmega48pa, feature = "all-mcus"))] pub mod atmega48pa;
#[cfg(avr_mcu_atmega48pa)] pub use self::atmega48pa as current;
/// The ATmega328P.
#[cfg(any(avr_mcu_atmega328p, feature = "all-mcus"))] pub mod atmega328p;
#[cfg(avr_mcu_atmega328p)] pub use self::atmega328p as current;
/// The ATmega16U4.
#[cfg(any(avr_mcu_atmega16u4, feature = "all-mcus"))] pub mod atmega16u4;
#[cfg(avr_mcu_atmega16u4)] pub use self::atmega16u4 as current;
/// The ATmega88.
#[cfg(any(avr_mcu_atmega88, feature = "all-mcus"))] pub mod atmega88;
#[cfg(avr_mcu_atmega88)] pub use self::atmega88 as current;
/// The ATmega168A.
#[cfg(any(avr_mcu_atmega168a, feature = "all-mcus"))] pub mod atmega168a;
#[cfg(avr_mcu_atmega168a)] pub use self::atmega168a as current;
/// The AT90PWM161.
#[cfg(any(avr_mcu_at90pwm161, feature = "all-mcus"))] pub mod at90pwm161;
#[cfg(avr_mcu_at90pwm161)] pub use self::at90pwm161 as current;
/// The ATmega48.
#[cfg(any(avr_mcu_atmega48, feature = "all-mcus"))] pub mod atmega48;
#[cfg(avr_mcu_atmega48)] pub use self::atmega48 as current;
/// The ATmega48A.
#[cfg(any(avr_mcu_atmega48a, feature = "all-mcus"))] pub mod atmega48a;
#[cfg(avr_mcu_atmega48a)] pub use self::atmega48a as current;
/// The ATmega406.
#[cfg(any(avr_mcu_atmega406, feature = "all-mcus"))] pub mod atmega406;
#[cfg(avr_mcu_atmega406)] pub use self::atmega406 as current;
/// The ATmega88PA.
#[cfg(any(avr_mcu_atmega88pa, feature = "all-mcus"))] pub mod atmega88pa;
#[cfg(avr_mcu_atmega88pa)] pub use self::atmega88pa as current;
/// The ATmega328.
///
/// This device is chosen as the default when the crate is targeting non-AVR devices.
#[cfg(any(avr_mcu_atmega328, feature = "all-mcus", not(target_arch = "avr")))] pub mod atmega328;
#[cfg(any(avr_mcu_atmega328, not(target_arch = "avr")))] pub use self::atmega328 as current;
/// The ATmega168P.
#[cfg(any(avr_mcu_atmega168p, feature = "all-mcus"))] pub mod atmega168p;
#[cfg(avr_mcu_atmega168p)] pub use self::atmega168p as current;
/// The ATmega88P.
#[cfg(any(avr_mcu_atmega88p, feature = "all-mcus"))] pub mod atmega88p;
#[cfg(avr_mcu_atmega88p)] pub use self::atmega88p as current;
/// The ATmega168PA.
#[cfg(any(avr_mcu_atmega168pa, feature = "all-mcus"))] pub mod atmega168pa;
#[cfg(avr_mcu_atmega168pa)] pub use self::atmega168pa as current;
/// The ATmega48P.
#[cfg(any(avr_mcu_atmega48p, feature = "all-mcus"))] pub mod atmega48p;
#[cfg(avr_mcu_atmega48p)] pub use self::atmega48p as current;
/// The ATmega88A.
#[cfg(any(avr_mcu_atmega88a, feature = "all-mcus"))] pub mod atmega88a;
#[cfg(avr_mcu_atmega88a)] pub use self::atmega88a as current;
/// The ATmega32U4.
#[cfg(any(avr_mcu_atmega32u4, feature = "all-mcus"))] pub mod atmega32u4;
#[cfg(avr_mcu_atmega32u4)] pub use self::atmega32u4 as current;
/// The ATmega168.
#[cfg(any(avr_mcu_atmega168, feature = "all-mcus"))] pub mod atmega168;
#[cfg(avr_mcu_atmega168)] pub use self::atmega168 as current;
/// The ATtiny261.
#[cfg(any(avr_mcu_attiny261, feature = "all-mcus"))] pub mod attiny261;
#[cfg(avr_mcu_attiny261)] pub use self::attiny261 as current;
/// The ATtiny861A.
#[cfg(any(avr_mcu_attiny861a, feature = "all-mcus"))] pub mod attiny861a;
#[cfg(avr_mcu_attiny861a)] pub use self::attiny861a as current;
/// The ATtiny461.
#[cfg(any(avr_mcu_attiny461, feature = "all-mcus"))] pub mod attiny461;
#[cfg(avr_mcu_attiny461)] pub use self::attiny461 as current;
/// The ATtiny861.
#[cfg(any(avr_mcu_attiny861, feature = "all-mcus"))] pub mod attiny861;
#[cfg(avr_mcu_attiny861)] pub use self::attiny861 as current;
/// The ATtiny26.
#[cfg(any(avr_mcu_attiny26, feature = "all-mcus"))] pub mod attiny26;
#[cfg(avr_mcu_attiny26)] pub use self::attiny26 as current;
/// The ATtiny261A.
#[cfg(any(avr_mcu_attiny261a, feature = "all-mcus"))] pub mod attiny261a;
#[cfg(avr_mcu_attiny261a)] pub use self::attiny261a as current;
/// The ATtiny2313.
#[cfg(any(avr_mcu_attiny2313, feature = "all-mcus"))] pub mod attiny2313;
#[cfg(avr_mcu_attiny2313)] pub use self::attiny2313 as current;
/// The ATtiny11.
#[cfg(any(avr_mcu_attiny11, feature = "all-mcus"))] pub mod attiny11;
#[cfg(avr_mcu_attiny11)] pub use self::attiny11 as current;
/// The ATtiny40.
#[cfg(any(avr_mcu_attiny40, feature = "all-mcus"))] pub mod attiny40;
#[cfg(avr_mcu_attiny40)] pub use self::attiny40 as current;
/// The ATtiny12.
#[cfg(any(avr_mcu_attiny12, feature = "all-mcus"))] pub mod attiny12;
#[cfg(avr_mcu_attiny12)] pub use self::attiny12 as current;
/// The ATtiny461A.
#[cfg(any(avr_mcu_attiny461a, feature = "all-mcus"))] pub mod attiny461a;
#[cfg(avr_mcu_attiny461a)] pub use self::attiny461a as current;
/// The ATtiny2313A.
#[cfg(any(avr_mcu_attiny2313a, feature = "all-mcus"))] pub mod attiny2313a;
#[cfg(avr_mcu_attiny2313a)] pub use self::attiny2313a as current;
/// The ATtiny20.
#[cfg(any(avr_mcu_attiny20, feature = "all-mcus"))] pub mod attiny20;
#[cfg(avr_mcu_attiny20)] pub use self::attiny20 as current;
/// The ATtiny1634.
#[cfg(any(avr_mcu_attiny1634, feature = "all-mcus"))] pub mod attiny1634;
#[cfg(avr_mcu_attiny1634)] pub use self::attiny1634 as current;
/// The ATtiny85. /// The ATtiny85.
#[cfg(any(avr_mcu_attiny85, feature = "all-mcus"))] pub mod attiny85; #[cfg(any(avr_mcu_attiny85, feature = "all-mcus"))] pub mod attiny85;
#[cfg(avr_mcu_attiny85)] pub use self::attiny85 as current; #[cfg(avr_mcu_attiny85)] pub use self::attiny85 as current;
/// The ATtiny4313.
#[cfg(any(avr_mcu_attiny4313, feature = "all-mcus"))] pub mod attiny4313;
#[cfg(avr_mcu_attiny4313)] pub use self::attiny4313 as current;