We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9801539 commit 24a29b1Copy full SHA for 24a29b1
cortex-m/asm/inline.rs
@@ -60,6 +60,10 @@ pub unsafe fn __delay(cyc: u32) {
60
// Add 1 to prevent an integer underflow which would cause a long freeze
61
let real_cyc = 1 + cyc / 2;
62
asm!(
63
+ // The `bne` on some cores (eg Cortex-M4) will take a different number of instructions
64
+ // depending on the alignment of the branch target. Set the alignment of the top of the
65
+ // loop to prevent surprising timing changes when the alignment of the delay() changes.
66
+ ".p2align 3",
67
// Use local labels to avoid R_ARM_THM_JUMP8 relocations which fail on thumbv6m.
68
"1:",
69
"subs {}, #1",
0 commit comments