Akinori Hashimoto / myTimer

Dependents:   DetectFreqAboveTH RN41

myTimer.cpp

Committer:
AkinoriHashimoto
Date:
2015-09-02
Revision:
0:04c9087b9ca9
Child:
1:685c0f37a569

File content as of revision 0:04c9087b9ca9:

#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()
{
    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;
}