![](/media/cache/group/SAM_2404.JPG.50x50_q85.jpg)
Jared's DAC Code
Dependencies: mbed
Fork of Chemical_Sensor_DMA by
pause.cpp@2:3771b3195c7b, 2015-10-29 (annotated)
- Committer:
- baxterja
- Date:
- Thu Oct 29 17:15:20 2015 +0000
- Revision:
- 2:3771b3195c7b
- Child:
- 7:af255a90505e
Accessible Sample folder
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 | } |
baxterja | 2:3771b3195c7b | 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 | } |
baxterja | 2:3771b3195c7b | 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 | } |
baxterja | 2:3771b3195c7b | 16 | |
baxterja | 2:3771b3195c7b | 17 | #endif |