diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-03-04 17:42:38 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-03-04 18:03:41 +0100 |
| commit | 53d9a0b5162220298dc7d2287917491b41d261b4 (patch) | |
| tree | ad4c4439a1260c1f9647ef88f595ea16eac19815 | |
| parent | 94b232cf88b85a5c68817524c999c7308875b069 (diff) | |
stm32: exclude spammy files from docs by prefixing with `_`.
These files end up containing chip-specific info, so they deduplicate
really badly when building docs for all 1200 chips.
The doc generator removes files starting with `_`.
| -rw-r--r-- | embassy-stm32/build.rs | 6 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/bdma.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/dma.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32/src/dma/dmamux.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/gpio.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/interrupt.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 9 |
7 files changed, 14 insertions, 15 deletions
diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index 737b62476..38413acbd 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs | |||
| @@ -646,13 +646,13 @@ fn main() { | |||
| 646 | make_table(&mut m, "foreach_dma_channel", &dma_channels_table); | 646 | make_table(&mut m, "foreach_dma_channel", &dma_channels_table); |
| 647 | 647 | ||
| 648 | let out_dir = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); | 648 | let out_dir = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); |
| 649 | let out_file = out_dir.join("macros.rs").to_string_lossy().to_string(); | 649 | let out_file = out_dir.join("_macros.rs").to_string_lossy().to_string(); |
| 650 | fs::write(out_file, m).unwrap(); | 650 | fs::write(out_file, m).unwrap(); |
| 651 | 651 | ||
| 652 | // ======== | 652 | // ======== |
| 653 | // Write generated.rs | 653 | // Write generated.rs |
| 654 | 654 | ||
| 655 | let out_file = out_dir.join("generated.rs").to_string_lossy().to_string(); | 655 | let out_file = out_dir.join("_generated.rs").to_string_lossy().to_string(); |
| 656 | fs::write(out_file, g.to_string()).unwrap(); | 656 | fs::write(out_file, g.to_string()).unwrap(); |
| 657 | 657 | ||
| 658 | // ======== | 658 | // ======== |
| @@ -773,7 +773,7 @@ impl<T: Iterator> IteratorExt for T { | |||
| 773 | fn make_table(out: &mut String, name: &str, data: &Vec<Vec<String>>) { | 773 | fn make_table(out: &mut String, name: &str, data: &Vec<Vec<String>>) { |
| 774 | write!( | 774 | write!( |
| 775 | out, | 775 | out, |
| 776 | "#[macro_export] | 776 | " |
| 777 | macro_rules! {} {{ | 777 | macro_rules! {} {{ |
| 778 | ($($pat:tt => $code:tt;)*) => {{ | 778 | ($($pat:tt => $code:tt;)*) => {{ |
| 779 | macro_rules! __{}_inner {{ | 779 | macro_rules! __{}_inner {{ |
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs index 4fafe7dfa..105bea50e 100644 --- a/embassy-stm32/src/dma/bdma.rs +++ b/embassy-stm32/src/dma/bdma.rs | |||
| @@ -6,8 +6,8 @@ use core::task::Waker; | |||
| 6 | use embassy::interrupt::{Interrupt, InterruptExt}; | 6 | use embassy::interrupt::{Interrupt, InterruptExt}; |
| 7 | use embassy::waitqueue::AtomicWaker; | 7 | use embassy::waitqueue::AtomicWaker; |
| 8 | 8 | ||
| 9 | use crate::_generated::BDMA_CHANNEL_COUNT; | ||
| 9 | use crate::dma::Request; | 10 | use crate::dma::Request; |
| 10 | use crate::generated::BDMA_CHANNEL_COUNT; | ||
| 11 | use crate::pac; | 11 | use crate::pac; |
| 12 | use crate::pac::bdma::vals; | 12 | use crate::pac::bdma::vals; |
| 13 | 13 | ||
| @@ -65,7 +65,7 @@ pub(crate) unsafe fn init() { | |||
| 65 | crate::interrupt::$irq::steal().enable(); | 65 | crate::interrupt::$irq::steal().enable(); |
| 66 | }; | 66 | }; |
| 67 | } | 67 | } |
| 68 | crate::generated::init_bdma(); | 68 | crate::_generated::init_bdma(); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | foreach_dma_channel! { | 71 | foreach_dma_channel! { |
diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index fd1732fbb..95a6eea2f 100644 --- a/embassy-stm32/src/dma/dma.rs +++ b/embassy-stm32/src/dma/dma.rs | |||
| @@ -4,7 +4,7 @@ use core::task::Waker; | |||
| 4 | use embassy::interrupt::{Interrupt, InterruptExt}; | 4 | use embassy::interrupt::{Interrupt, InterruptExt}; |
| 5 | use embassy::waitqueue::AtomicWaker; | 5 | use embassy::waitqueue::AtomicWaker; |
| 6 | 6 | ||
| 7 | use crate::generated::DMA_CHANNEL_COUNT; | 7 | use crate::_generated::DMA_CHANNEL_COUNT; |
| 8 | use crate::interrupt; | 8 | use crate::interrupt; |
| 9 | use crate::pac; | 9 | use crate::pac; |
| 10 | use crate::pac::dma::{regs, vals}; | 10 | use crate::pac::dma::{regs, vals}; |
| @@ -59,7 +59,7 @@ pub(crate) unsafe fn init() { | |||
| 59 | interrupt::$irq::steal().enable(); | 59 | interrupt::$irq::steal().enable(); |
| 60 | }; | 60 | }; |
| 61 | } | 61 | } |
| 62 | crate::generated::init_dma(); | 62 | crate::_generated::init_dma(); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | foreach_dma_channel! { | 65 | foreach_dma_channel! { |
diff --git a/embassy-stm32/src/dma/dmamux.rs b/embassy-stm32/src/dma/dmamux.rs index 628f496be..c45bebe26 100644 --- a/embassy-stm32/src/dma/dmamux.rs +++ b/embassy-stm32/src/dma/dmamux.rs | |||
| @@ -49,5 +49,5 @@ foreach_dma_channel! { | |||
| 49 | 49 | ||
| 50 | /// safety: must be called only once | 50 | /// safety: must be called only once |
| 51 | pub(crate) unsafe fn init() { | 51 | pub(crate) unsafe fn init() { |
| 52 | crate::generated::init_dmamux(); | 52 | crate::_generated::init_dmamux(); |
| 53 | } | 53 | } |
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs index 4837c4120..3e108736b 100644 --- a/embassy-stm32/src/gpio.rs +++ b/embassy-stm32/src/gpio.rs | |||
| @@ -574,7 +574,7 @@ foreach_pin!( | |||
| 574 | ); | 574 | ); |
| 575 | 575 | ||
| 576 | pub(crate) unsafe fn init() { | 576 | pub(crate) unsafe fn init() { |
| 577 | crate::generated::init_gpio(); | 577 | crate::_generated::init_gpio(); |
| 578 | } | 578 | } |
| 579 | 579 | ||
| 580 | mod eh02 { | 580 | mod eh02 { |
diff --git a/embassy-stm32/src/interrupt.rs b/embassy-stm32/src/interrupt.rs index c757b790c..714dcc4ca 100644 --- a/embassy-stm32/src/interrupt.rs +++ b/embassy-stm32/src/interrupt.rs | |||
| @@ -3,4 +3,4 @@ pub use critical_section::CriticalSection; | |||
| 3 | pub use embassy::interrupt::{take, Interrupt}; | 3 | pub use embassy::interrupt::{take, Interrupt}; |
| 4 | pub use embassy_hal_common::interrupt::Priority4 as Priority; | 4 | pub use embassy_hal_common::interrupt::Priority4 as Priority; |
| 5 | 5 | ||
| 6 | pub use crate::generated::interrupt::*; | 6 | pub use crate::_generated::interrupt::*; |
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 5e8d6dd86..45b8e1800 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -11,7 +11,7 @@ pub(crate) use stm32_metapac as pac; | |||
| 11 | 11 | ||
| 12 | // This must go FIRST so that all the other modules see its macros. | 12 | // This must go FIRST so that all the other modules see its macros. |
| 13 | pub mod fmt; | 13 | pub mod fmt; |
| 14 | include!(concat!(env!("OUT_DIR"), "/macros.rs")); | 14 | include!(concat!(env!("OUT_DIR"), "/_macros.rs")); |
| 15 | 15 | ||
| 16 | // Utilities | 16 | // Utilities |
| 17 | pub mod interrupt; | 17 | pub mod interrupt; |
| @@ -63,16 +63,15 @@ pub mod usb_otg; | |||
| 63 | pub mod subghz; | 63 | pub mod subghz; |
| 64 | 64 | ||
| 65 | // This must go last, so that it sees all the impl_foo! macros defined earlier. | 65 | // This must go last, so that it sees all the impl_foo! macros defined earlier. |
| 66 | pub(crate) mod generated { | 66 | pub(crate) mod _generated { |
| 67 | |||
| 68 | #![allow(dead_code)] | 67 | #![allow(dead_code)] |
| 69 | #![allow(unused_imports)] | 68 | #![allow(unused_imports)] |
| 70 | #![allow(non_snake_case)] | 69 | #![allow(non_snake_case)] |
| 71 | 70 | ||
| 72 | include!(concat!(env!("OUT_DIR"), "/generated.rs")); | 71 | include!(concat!(env!("OUT_DIR"), "/_generated.rs")); |
| 73 | } | 72 | } |
| 73 | pub use _generated::{peripherals, Peripherals}; | ||
| 74 | pub use embassy_macros::interrupt; | 74 | pub use embassy_macros::interrupt; |
| 75 | pub use generated::{peripherals, Peripherals}; | ||
| 76 | 75 | ||
| 77 | #[non_exhaustive] | 76 | #[non_exhaustive] |
| 78 | pub struct Config { | 77 | pub struct Config { |
