Minor Update:

- BufferCore: Set BufSize as class constant
- TimingCore: Add new function Timeout()
This commit is contained in:
Charl Wentzel
2016-06-02 09:36:08 +02:00
parent 59facdf1bd
commit 630583bbc6
3 changed files with 9 additions and 2 deletions

View File

@@ -20,8 +20,8 @@ class CBuffer
{
private:
// Buffer Definition
char * Buffer; // Memory allocated to buffer
int BufSize; // Size of allocated buffer
char * Buffer; // Memory allocated to buffer
const int BufSize; // Size of allocated buffer
// Buffer pointers
int BufStart; // First unread characters on buffer

View File

@@ -49,3 +49,9 @@ long TimePassed( timeval StartTime )
return Duration;
}
//---------------------------------------------------------------------------
bool Timeout( timeval StartTime, long MilliSeconds )
{
return ((TimePassed(StartTime) > MilliSeconds)? true : false);
}
//---------------------------------------------------------------------------

View File

@@ -19,6 +19,7 @@
void SetInterval( timeval *Time, long MilliSeconds );
void SetStartTime( timeval *StartTime );
long TimePassed( timeval StartTime );
bool Timeout( timeval StartTime, long MilliSeconds );
//---------------------------------------------------------------------------