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: DetectFreqAboveTH RN41
myTimer.cpp
- Committer:
- AkinoriHashimoto
- Date:
- 2015-10-06
- Revision:
- 2:3060a6604f13
- Parent:
- 1:685c0f37a569
- Child:
- 3:de4737751df6
File content as of revision 2:3060a6604f13:
#include "myTimer.h"
myTimer::myTimer()
{
this->stop();
this->reset();
}
void myTimer::stop()
{
this->timer.stop();
return;
}
void myTimer::reset()
{
this->timer.reset();
return;
}
void myTimer::start(bool _RESET)
{
if(_RESET)
this->reset();
this->timer.start();
return;
}
int myTimer::read_ms(bool _START, bool _RESET, bool _STOP)
{
int ans= 0;
if(_STOP)
this->stop();
ans= this->timer.read_ms();
if(_RESET)
this->reset();
if(_START)
this->start();
return ans;
}
void myTimer::wait_ms(int waitTime, bool _START, bool _RESET, bool _STOP)
{
int wt= waitTime- this->read_ms(_START, _RESET, _STOP);
if(wt <= 0)
return;
wait_ms(wt);
return;
}