- build.rs discovers boards by content (implements LoRaBoard), not exclusion lists - build.rs auto-discovers helper modules by scanning board files for use super::<helper> - Jinja template dynamically generates cfg gates for helpers - Updated PORTING.md for new architecture (hal/, driver/, BoardParts, associated types) - Zero manual template editing needed when adding boards to existing MCU families
17 lines
491 B
Django/Jinja
17 lines
491 B
Django/Jinja
// @generated by build.rs — DO NOT EDIT
|
|
pub mod traits;
|
|
pub use traits::*;
|
|
|
|
{% for helper, helper_features in helpers|items -%}
|
|
#[cfg(any({% for f in helper_features %}feature = "{{ f }}"{% if not loop.last %}, {% endif %}{% endfor %}))]
|
|
mod {{ helper }};
|
|
{% endfor %}
|
|
cfg_if::cfg_if! {
|
|
{%- for board in boards %}
|
|
{% if loop.first %}if{% else %}else if{% endif %} #[cfg(feature = "{{ board }}")] {
|
|
mod {{ board }};
|
|
pub use {{ board }}::*;
|
|
}
|
|
{%- endfor %}
|
|
}
|