Skip to content

Commit e2bfbe3

Browse files
committed
Document the interrupt handlers some more
1 parent 7635dbc commit e2bfbe3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/dma/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,13 @@ impl<'rx, 'tx> EthernetDMA<'rx, 'tx> {
138138
///
139139
/// In your handler you must call
140140
/// [`EthernetDMA::interrupt_handler()`] or [`stm32_eth::eth_interrupt_handler`](crate::eth_interrupt_handler)
141-
/// to clear interrupt pending bits. Otherwise the interrupt will
142-
/// reoccur immediately.
141+
/// to clear interrupt pending bits. Otherwise the interrupt will reoccur immediately.
142+
///
143+
/// [`EthernetPTP::interrupt_handler()`]: crate::ptp::EthernetPTP::interrupt_handler
144+
#[cfg_attr(
145+
feature = "ptp",
146+
doc = "If you have PTP enabled, you must also call [`EthernetPTP::interrupt_handler()`] if you wish to make use of the PTP timestamp trigger feature."
147+
)]
143148
pub fn enable_interrupt(&self) {
144149
self.eth_dma.dmaier.modify(|_, w| {
145150
w
@@ -160,7 +165,7 @@ impl<'rx, 'tx> EthernetDMA<'rx, 'tx> {
160165
}
161166
}
162167

163-
/// Handle the DMA parts of the ETH interrupt.
168+
/// Handle the DMA parts of the `ETH` interrupt.
164169
pub fn interrupt_handler() -> InterruptReasonSummary {
165170
// SAFETY: we only perform atomic reads/writes through `eth_dma`.
166171
let eth_dma = unsafe { &*ETHERNET_DMA::ptr() };

src/ptp/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ impl EthernetPTP {
270270
eth_ptp.ptptssr.read().tsttr().bit_is_set()
271271
}
272272

273+
/// Handle the PTP parts of the `ETH` interrupt.
274+
///
273275
/// Returns a boolean indicating whether or not the interrupt
274276
/// was caused by a Timestamp trigger and clears the interrupt
275277
/// flag.

0 commit comments

Comments
 (0)