Jared's DAC Code
Dependencies: mbed
Fork of Chemical_Sensor_DMA by
pause.cpp@7:af255a90505e, 2015-12-19 (annotated)
- Committer:
- DeWayneDennis
- Date:
- Sat Dec 19 21:47:52 2015 +0000
- Revision:
- 7:af255a90505e
- Parent:
- 2:3771b3195c7b
Final Code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
baxterja | 2:3771b3195c7b | 1 | #ifndef PAUSE_CPP |
baxterja | 2:3771b3195c7b | 2 | #define PAUSE_CPP |
baxterja | 2:3771b3195c7b | 3 | #include "mbed.h" |
baxterja | 2:3771b3195c7b | 4 | // these are various delays |
baxterja | 2:3771b3195c7b | 5 | inline void pause(uint32_t seconds) { |
baxterja | 2:3771b3195c7b | 6 | for(seconds; seconds > 0; seconds--) for(uint32_t i = 0x1ffffff; i > 0; i--) asm("nop"); |
baxterja | 2:3771b3195c7b | 7 | } |
DeWayneDennis | 7:af255a90505e | 8 | |
baxterja | 2:3771b3195c7b | 9 | inline void pause_ms(uint32_t milliseconds) { |
baxterja | 2:3771b3195c7b | 10 | for(milliseconds; milliseconds > 0; milliseconds--) for(uint32_t i = 0x8312; i > 0; i--) asm("nop"); |
baxterja | 2:3771b3195c7b | 11 | } |
DeWayneDennis | 7:af255a90505e | 12 | |
baxterja | 2:3771b3195c7b | 13 | inline void pause_us(uint32_t microseconds) { |
baxterja | 2:3771b3195c7b | 14 | for(microseconds; microseconds > 0; microseconds--) for(uint32_t i = 0x21; i > 0; i--) asm("nop"); |
baxterja | 2:3771b3195c7b | 15 | } |
DeWayneDennis | 7:af255a90505e | 16 | |
baxterja | 2:3771b3195c7b | 17 | #endif |