Arduino functions millis, micros and eventually some more to come
Dependents: DigitalCamera_OV5642_WIZwiki-W7500 BMC F746NG_TestAll Prelude_OV5642_dev
Arduino basic compatibility millis(), micros(), evtl. more to come.
micros() and millis() are uint32_t and have a correct overflow at 2^32-1. micros() has a granularity/resolution of 50. This can be changed by a define. 1 microsecond is not realistic because every count needs an irq. A resolution of 50 microseconds means 20KHz irq. That should not take away more than 1 percent overall processing time.
Diff: millis.h
- Revision:
- 0:571ea8a1bbae
- Child:
- 1:d1b960698e70
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/millis.h Mon Nov 24 17:02:21 2014 +0000 @@ -0,0 +1,15 @@ +// millis as in Arduino... + +#ifndef MILLIS_H_ +#define MILLIS_H_ + +#include "mbed.h" + +// Get millis value similar to arduino +uint32_t millis (); + +// Must be called to start milli seconds timer! +void StartMillis (); + +#endif // See #ifndef MILLIS_H_ +// End of file \ No newline at end of file