![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Working firmware for simultaneous LiDAR and Magnetometer data retrieval over ethernet.
Dependencies: EthernetInterface FXOS8700Q LidarLite mbed-rtos mbed
pause.cpp@0:ade62dde274b, 2015-12-10 (annotated)
- Committer:
- jakelarsen17
- Date:
- Thu Dec 10 17:45:30 2015 +0000
- Revision:
- 0:ade62dde274b
Working firmware for simultaneous LiDAR and Magnetometer data retrieval over ethernet.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jakelarsen17 | 0:ade62dde274b | 1 | #ifndef PAUSE_CPP |
jakelarsen17 | 0:ade62dde274b | 2 | #define PAUSE_CPP |
jakelarsen17 | 0:ade62dde274b | 3 | #include "mbed.h" |
jakelarsen17 | 0:ade62dde274b | 4 | |
jakelarsen17 | 0:ade62dde274b | 5 | // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0496b/BABDJCCI.html |
jakelarsen17 | 0:ade62dde274b | 6 | #pragma diag_suppress 174 // suppress the warning "Expression has no effect". This warning is displayed for each of these functions. |
jakelarsen17 | 0:ade62dde274b | 7 | |
jakelarsen17 | 0:ade62dde274b | 8 | |
jakelarsen17 | 0:ade62dde274b | 9 | |
jakelarsen17 | 0:ade62dde274b | 10 | // these are various delays |
jakelarsen17 | 0:ade62dde274b | 11 | inline void pause(uint32_t seconds) { |
jakelarsen17 | 0:ade62dde274b | 12 | for(seconds; seconds > 0; seconds--) for(uint32_t i = 0x1ffffff; i > 0; i--) asm("nop"); |
jakelarsen17 | 0:ade62dde274b | 13 | } |
jakelarsen17 | 0:ade62dde274b | 14 | |
jakelarsen17 | 0:ade62dde274b | 15 | inline void pause_ms(uint32_t milliseconds) { |
jakelarsen17 | 0:ade62dde274b | 16 | for(milliseconds; milliseconds > 0; milliseconds--) for(uint32_t i = 0x8312; i > 0; i--) asm("nop"); |
jakelarsen17 | 0:ade62dde274b | 17 | } |
jakelarsen17 | 0:ade62dde274b | 18 | |
jakelarsen17 | 0:ade62dde274b | 19 | inline void pause_us(uint32_t microseconds) { |
jakelarsen17 | 0:ade62dde274b | 20 | for(microseconds; microseconds > 0; microseconds--) for(uint32_t i = 0x21; i > 0; i--) asm("nop"); |
jakelarsen17 | 0:ade62dde274b | 21 | } |
jakelarsen17 | 0:ade62dde274b | 22 | |
jakelarsen17 | 0:ade62dde274b | 23 | #endif |