-
Notifications
You must be signed in to change notification settings - Fork 168
Better delay description #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,13 +26,16 @@ pub fn bkpt() { | |||||
|
||||||
/// Blocks the program for *at least* `n` instruction cycles | ||||||
/// | ||||||
/// This is implemented in assembly so its execution time is the same regardless of the optimization | ||||||
/// level. | ||||||
/// This is implemented in assembly so its execution time is independent of the optimization | ||||||
/// level, however it is dependent on the specific architecture and core configuration. | ||||||
/// | ||||||
/// NOTE that the delay can take much longer if interrupts are serviced during its execution. | ||||||
/// NOTE that the delay can take much longer if interrupts are serviced during its execution | ||||||
/// and the execution time may wary with other factors. This delay is mainly useful for simple | ||||||
/// timer-less initialisation of peripherals iff accurate timing is not essential. In any other | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, the iff is intended. I'm fine with changing the spelling to AE. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe expand it to "if and only if" then? iff tends to confuse people. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I've never met anyone who was confused about that but sure, why not. |
||||||
/// case please use more accurate methods to cause a delay. | ||||||
#[inline] | ||||||
pub fn delay(_n: u32) { | ||||||
// NOTE(divide by 4) is easier to compute than `/ 3` is it's just a shift (`>> 2`). | ||||||
// NOTE(divide by 4) is easier to compute than `/ 3` because it's just a shift (`>> 2`). | ||||||
match () { | ||||||
#[cfg(all(cortex_m, feature = "inline-asm"))] | ||||||
() => unsafe { | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.