extern "C" { #include #include #include } #include #include "uinterval.h" // Public Methods ////////////////////////////////////////////////////////////// uint32_t uInterval::remains(void) { return _timeout - (micros() - _timefrom); } uint32_t uInterval::elapsed(void) { return micros() - _timefrom; } bool uInterval::expired(void) { if ((micros() - _timefrom) >= _timeout) return true; else return false; } void uInterval::set(uint32_t tmout) { _timefrom = micros(); _timeout = tmout; }