diff --git a/modules/evs/fsw/src/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c index 63ed9b541..9b2a9130f 100644 --- a/modules/evs/fsw/src/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -42,20 +42,15 @@ void EVS_AddLog(CFE_EVS_LongEventTlm_t *EVS_PktPtr) /* Serialize access to event log control variables */ OS_MutSemTake(CFE_EVS_Global.EVS_SharedDataMutexID); - if ((CFE_EVS_Global.EVS_LogPtr->LogFullFlag == true) && - (CFE_EVS_Global.EVS_LogPtr->LogMode == CFE_EVS_LogMode_DISCARD)) + if (CFE_EVS_Global.EVS_LogPtr->LogFullFlag == true) { - /* If log is full and in discard mode, just count the event */ CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter++; } - else - { - if (CFE_EVS_Global.EVS_LogPtr->LogFullFlag == true) - { - /* If log is full and in wrap mode, count it and store it */ - CFE_EVS_Global.EVS_LogPtr->LogOverflowCounter++; - } + /* If the log is not full, _or_ if it is in OVERWRITE mode, add the event to the log */ + if ((CFE_EVS_Global.EVS_LogPtr->LogFullFlag == false) || + (CFE_EVS_Global.EVS_LogPtr->LogMode == CFE_EVS_LogMode_OVERWRITE)) + { /* Copy the event data to the next available entry in the log */ memcpy(&CFE_EVS_Global.EVS_LogPtr->LogEntry[CFE_EVS_Global.EVS_LogPtr->Next], EVS_PktPtr, sizeof(*EVS_PktPtr));