aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-03-04 17:42:38 +0100
committerDario Nieuwenhuis <[email protected]>2022-03-04 18:03:41 +0100
commit53d9a0b5162220298dc7d2287917491b41d261b4 (patch)
treead4c4439a1260c1f9647ef88f595ea16eac19815
parent94b232cf88b85a5c68817524c999c7308875b069 (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.rs6
-rw-r--r--embassy-stm32/src/dma/bdma.rs4
-rw-r--r--embassy-stm32/src/dma/dma.rs4
-rw-r--r--embassy-stm32/src/dma/dmamux.rs2
-rw-r--r--embassy-stm32/src/gpio.rs2
-rw-r--r--embassy-stm32/src/interrupt.rs2
-rw-r--r--embassy-stm32/src/lib.rs9
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 {
773fn make_table(out: &mut String, name: &str, data: &Vec<Vec<String>>) { 773fn make_table(out: &mut String, name: &str, data: &Vec<Vec<String>>) {
774 write!( 774 write!(
775 out, 775 out,
776 "#[macro_export] 776 "
777macro_rules! {} {{ 777macro_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;
6use embassy::interrupt::{Interrupt, InterruptExt}; 6use embassy::interrupt::{Interrupt, InterruptExt};
7use embassy::waitqueue::AtomicWaker; 7use embassy::waitqueue::AtomicWaker;
8 8
9use crate::_generated::BDMA_CHANNEL_COUNT;
9use crate::dma::Request; 10use crate::dma::Request;
10use crate::generated::BDMA_CHANNEL_COUNT;
11use crate::pac; 11use crate::pac;
12use crate::pac::bdma::vals; 12use 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
71foreach_dma_channel! { 71foreach_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;
4use embassy::interrupt::{Interrupt, InterruptExt}; 4use embassy::interrupt::{Interrupt, InterruptExt};
5use embassy::waitqueue::AtomicWaker; 5use embassy::waitqueue::AtomicWaker;
6 6
7use crate::generated::DMA_CHANNEL_COUNT; 7use crate::_generated::DMA_CHANNEL_COUNT;
8use crate::interrupt; 8use crate::interrupt;
9use crate::pac; 9use crate::pac;
10use crate::pac::dma::{regs, vals}; 10use 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
65foreach_dma_channel! { 65foreach_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
51pub(crate) unsafe fn init() { 51pub(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
576pub(crate) unsafe fn init() { 576pub(crate) unsafe fn init() {
577 crate::generated::init_gpio(); 577 crate::_generated::init_gpio();
578} 578}
579 579
580mod eh02 { 580mod 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;
3pub use embassy::interrupt::{take, Interrupt}; 3pub use embassy::interrupt::{take, Interrupt};
4pub use embassy_hal_common::interrupt::Priority4 as Priority; 4pub use embassy_hal_common::interrupt::Priority4 as Priority;
5 5
6pub use crate::generated::interrupt::*; 6pub 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.
13pub mod fmt; 13pub mod fmt;
14include!(concat!(env!("OUT_DIR"), "/macros.rs")); 14include!(concat!(env!("OUT_DIR"), "/_macros.rs"));
15 15
16// Utilities 16// Utilities
17pub mod interrupt; 17pub mod interrupt;
@@ -63,16 +63,15 @@ pub mod usb_otg;
63pub mod subghz; 63pub 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.
66pub(crate) mod generated { 66pub(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}
73pub use _generated::{peripherals, Peripherals};
74pub use embassy_macros::interrupt; 74pub use embassy_macros::interrupt;
75pub use generated::{peripherals, Peripherals};
76 75
77#[non_exhaustive] 76#[non_exhaustive]
78pub struct Config { 77pub struct Config {