Skip to content

Commit 643e61c

Browse files
James Munnshannobraun
authored andcommitted
Add comments stating burden on caller
1 parent 50318bf commit 643e61c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

nrf52-hal-common/src/rtc.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ where
8282
}
8383

8484
/// Enable the generation of a hardware interrupt from a given stimulus
85+
///
86+
/// If access to the NVIC is not provided, the interrupt must ALSO be enabled
87+
/// there outside of this function (e.g. manually call `nvic.enable`, or through
88+
/// the use of RTFM).
8589
pub fn enable_interrupt(&mut self, int: RtcInterrupt, nvic: Option<&mut NVIC>) {
8690
match int {
8791
RtcInterrupt::Tick => self.periph.intenset.write(|w| w.tick().set()),
@@ -97,6 +101,10 @@ where
97101
}
98102

99103
/// Disable the generation of a hardware interrupt from a given stimulus
104+
///
105+
/// If access to the NVIC is not provided, the interrupt must ALSO be disabled
106+
/// there outside of this function (e.g. manually call `nvic.enable`, or through
107+
/// the use of RTFM).
100108
pub fn disable_interrupt(&mut self, int: RtcInterrupt, nvic: Option<&mut NVIC>) {
101109
match int {
102110
RtcInterrupt::Tick => self.periph.intenclr.write(|w| w.tick().clear()),

nrf52-hal-common/src/timer.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ where
6060
///
6161
/// Enables an interrupt that is fired when the timer reaches the value that
6262
/// is given as an argument to `start`.
63+
///
64+
/// If access to the NVIC is not provided, the interrupt must ALSO be enabled
65+
/// there outside of this function (e.g. manually call `nvic.enable`, or through
66+
/// the use of RTFM).
6367
pub fn enable_interrupt(&mut self, nvic: Option<&mut NVIC>) {
6468
// As of this writing, the timer code only uses
6569
// `cc[0]`/`events_compare[0]`. If the code is extended to use other
@@ -75,6 +79,10 @@ where
7579
///
7680
/// Disables an interrupt that is fired when the timer reaches the value
7781
/// that is given as an argument to `start`.
82+
///
83+
/// If access to the NVIC is not provided, the interrupt must ALSO be disabled
84+
/// there outside of this function (e.g. manually call `nvic.enable`, or through
85+
/// the use of RTFM).
7886
pub fn disable_interrupt(&mut self, nvic: Option<&mut NVIC>) {
7987
// As of this writing, the timer code only uses
8088
// `cc[0]`/`events_compare[0]`. If the code is extended to use other

0 commit comments

Comments
 (0)