aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jonathan 'theJPster' Pallant <github@thejpster.org.uk> 2016-10-15 23:15:34 +0100
committerGravatar Jonathan 'theJPster' Pallant <github@thejpster.org.uk> 2016-10-15 23:15:34 +0100
commit1cf1dfbae4d05a00d8c0c5c1298ae08e768739f9 (patch)
treebabefeda07eab400da1662794de153935356ba7a /src
parent2b57c7d06256e88e6b0bfdbf311ab3cfb29fba6c (diff)
downloadcortex-m-1cf1dfbae4d05a00d8c0c5c1298ae08e768739f9.tar.gz
cortex-m-1cf1dfbae4d05a00d8c0c5c1298ae08e768739f9.tar.zst
cortex-m-1cf1dfbae4d05a00d8c0c5c1298ae08e768739f9.zip
Added nop() function
Diffstat (limited to 'src')
-rw-r--r--src/asm.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/asm.rs b/src/asm.rs
index 1de0d32..a70cd93 100644
--- a/src/asm.rs
+++ b/src/asm.rs
@@ -49,3 +49,8 @@ pub unsafe fn wfi() {
() => {}
}
}
+
+/// A no-operation. Useful to stop delay loops being elided.
+pub fn nop() {
+ asm!("nop" :::: "volatile");
+}