Working firmware for simultaneous LiDAR and Magnetometer data retrieval over ethernet.
Dependencies: EthernetInterface FXOS8700Q LidarLite mbed-rtos mbed
Diff: pause.cpp
- Revision:
- 0:ade62dde274b
diff -r 000000000000 -r ade62dde274b pause.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pause.cpp Thu Dec 10 17:45:30 2015 +0000 @@ -0,0 +1,23 @@ +#ifndef PAUSE_CPP +#define PAUSE_CPP +#include "mbed.h" + +// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0496b/BABDJCCI.html +#pragma diag_suppress 174 // suppress the warning "Expression has no effect". This warning is displayed for each of these functions. + + + +// these are various delays +inline void pause(uint32_t seconds) { + for(seconds; seconds > 0; seconds--) for(uint32_t i = 0x1ffffff; i > 0; i--) asm("nop"); +} + +inline void pause_ms(uint32_t milliseconds) { + for(milliseconds; milliseconds > 0; milliseconds--) for(uint32_t i = 0x8312; i > 0; i--) asm("nop"); +} + +inline void pause_us(uint32_t microseconds) { + for(microseconds; microseconds > 0; microseconds--) for(uint32_t i = 0x21; i > 0; i--) asm("nop"); +} + +#endif \ No newline at end of file