From 1cf1dfbae4d05a00d8c0c5c1298ae08e768739f9 Mon Sep 17 00:00:00 2001 From: Jonathan 'theJPster' Pallant Date: Sat, 15 Oct 2016 23:15:34 +0100 Subject: Added nop() function --- src/asm.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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"); +} -- cgit v1.2.3