fifo features and stopwatch enhancement
This commit is contained in:
parent
ee2ee745c7
commit
44d4678089
@ -59,6 +59,26 @@ public:
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t peek(T * value) {
|
||||
if(empty()) {
|
||||
return EMPTY;
|
||||
} else {
|
||||
*value = data[readIndex];
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t pop() {
|
||||
if(empty()) {
|
||||
return EMPTY;
|
||||
} else {
|
||||
readIndex = next(readIndex);
|
||||
--currentSize;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
}
|
||||
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::FIFO_CLASS;
|
||||
static const ReturnValue_t FULL = MAKE_RETURN_CODE(1);
|
||||
static const ReturnValue_t EMPTY = MAKE_RETURN_CODE(2);
|
||||
|
@ -56,12 +56,13 @@ public:
|
||||
|
||||
StopwatchDisplayMode getDisplayMode() const;
|
||||
void setDisplayMode(StopwatchDisplayMode displayMode);
|
||||
bool displayOnDestruction = true;
|
||||
private:
|
||||
timeval startTime {0, 0};
|
||||
timeval elapsedTime {0, 0};
|
||||
|
||||
StopwatchDisplayMode displayMode = StopwatchDisplayMode::MILLIS;
|
||||
bool displayOnDestruction = true;
|
||||
|
||||
void stopInternal();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user