Jared's DAC Code

Dependencies:   mbed

Dependents:   DCS_FINAL_CODE

Fork of Chemical_Sensor_DMA by Jared Baxter

pause.cpp

Committer:
baxterja
Date:
2015-10-29
Revision:
2:3771b3195c7b
Child:
7:af255a90505e

File content as of revision 2:3771b3195c7b:

#ifndef PAUSE_CPP
#define PAUSE_CPP
#include "mbed.h"
// 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