Skip to content

Commit 32634e4

Browse files
Merge #240
240: Better delay description r=jonas-schievink a=therealprof CC #236 Signed-off-by: Daniel Egger <[email protected]> Co-authored-by: Daniel Egger <[email protected]>
2 parents b01dcb4 + 13d9b2f commit 32634e4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/asm.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ pub fn bkpt() {
2626

2727
/// Blocks the program for *at least* `n` instruction cycles
2828
///
29-
/// This is implemented in assembly so its execution time is the same regardless of the optimization
30-
/// level.
29+
/// This is implemented in assembly so its execution time is independent of the optimization
30+
/// level, however it is dependent on the specific architecture and core configuration.
3131
///
32-
/// NOTE that the delay can take much longer if interrupts are serviced during its execution.
32+
/// NOTE that the delay can take much longer if interrupts are serviced during its execution
33+
/// and the execution time may vary with other factors. This delay is mainly useful for simple
34+
/// timer-less initialization of peripherals if and only if accurate timing is not essential. In
35+
/// any other case please use a more accurate method to produce a delay.
3336
#[inline]
3437
pub fn delay(_n: u32) {
35-
// NOTE(divide by 4) is easier to compute than `/ 3` is it's just a shift (`>> 2`).
38+
// NOTE(divide by 4) is easier to compute than `/ 3` because it's just a shift (`>> 2`).
3639
match () {
3740
#[cfg(all(cortex_m, feature = "inline-asm"))]
3841
() => unsafe {

0 commit comments

Comments
 (0)