Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: DigitalCamera_OV5642_WIZwiki-W7500 BMC F746NG_TestAll Prelude_OV5642_dev
millis.cpp
- Committer:
- eduardoG26
- Date:
- 2014-11-24
- Revision:
- 0:571ea8a1bbae
- Child:
- 1:d1b960698e70
File content as of revision 0:571ea8a1bbae:
// millis as in Arduino...
#include "mbed.h"
#include "millis.h"
static volatile uint32_t MilliSeconds_u32;
static Ticker MilliSecondsTicker;
static void MilliSecondsTickerIRQ()
{
MilliSeconds_u32 ++;
}
uint32_t millis ()
{
return MilliSeconds_u32;
}
void StartMillis ()
{
MilliSecondsTicker.attach_us (&MilliSecondsTickerIRQ, 1000);
}
// End of file