fifo fill level included

This commit is contained in:
Dhanya Maliakal
2017-05-18 16:01:35 +02:00
parent 4aa73c607f
commit 781fea0a96
10 changed files with 67 additions and 16 deletions

View File

@ -17,7 +17,8 @@ Fifo::Fifo(uint32_t fifoItemSize, uint32_t fifoDepth, bool &success):
memory(0),
fifoBound(0),
fifoFree(0),
fifoStream(0){
fifoStream(0),
status_fifoBound(0){
FILE_LOG (logDEBUG) << __AT__ << " called";
index = NumberofFifoClassObjects++;
if(CreateFifos(fifoItemSize, fifoDepth) == FAIL)
@ -100,6 +101,9 @@ void Fifo::GetNewAddress(char*& address) {
void Fifo::PushAddress(char*& address) {
while(!fifoBound->push(address));
int temp = fifoBound->getSemValue();
if (temp > status_fifoBound)
status_fifoBound = temp;
}
void Fifo::PopAddress(char*& address) {
@ -114,3 +118,9 @@ void Fifo::PopAddressToStream(char*& address) {
fifoStream->pop(address);
}
int Fifo::GetMaxLevelForFifoBound() {
int temp = status_fifoBound;
status_fifoBound = 0;
return temp;
}