|
void CS_EnableEntryIDEepromCmd(const CS_EntryCmd_t *CmdPtr) |
|
{ |
|
/* command verification variables */ |
|
CS_Res_EepromMemory_Table_Entry_t *ResultsEntry = NULL; |
|
uint16 EntryID = 0; |
|
uint16 State = CS_STATE_EMPTY; |
|
|
|
if (CS_CheckRecomputeOneshot() == false) |
|
{ |
|
EntryID = CmdPtr->Payload.EntryID; |
|
|
|
if ((EntryID < CS_MAX_NUM_EEPROM_TABLE_ENTRIES) && |
|
(CS_AppData.ResEepromTblPtr[EntryID].State != CS_STATE_EMPTY)) |
|
{ |
|
ResultsEntry = &CS_AppData.ResEepromTblPtr[EntryID]; |
|
|
|
ResultsEntry->State = CS_STATE_ENABLED; |
|
|
|
CFE_EVS_SendEvent(CS_ENABLE_EEPROM_ENTRY_INF_EID, CFE_EVS_EventType_INFORMATION, |
|
"Checksumming of EEPROM Entry ID %d is Enabled", EntryID); |
|
|
|
if (CS_AppData.DefEepromTblPtr[EntryID].State != CS_STATE_EMPTY) |
|
{ |
|
CS_AppData.DefEepromTblPtr[EntryID].State = CS_STATE_ENABLED; |
|
CS_ResetTablesTblResultEntry(CS_AppData.EepResTablesTblPtr); |
|
CFE_TBL_Modified(CS_AppData.DefEepromTableHandle); |
|
} |
|
else |
|
{ |
|
CFE_EVS_SendEvent(CS_ENABLE_EEPROM_DEF_EMPTY_DBG_EID, CFE_EVS_EventType_DEBUG, |
|
"CS unable to update EEPROM definition table for entry %d, State: %d", EntryID, |
|
State); |
|
} |
|
|
|
CS_AppData.HkPacket.Payload.CmdCounter++; |
|
} |
|
else |
|
{ |
|
if (EntryID >= CS_MAX_NUM_EEPROM_TABLE_ENTRIES) |
|
{ |
|
State = CS_STATE_UNDEFINED; |
|
} |
|
else |
|
{ |
|
State = CS_AppData.ResEepromTblPtr[EntryID].State; |
|
} |
|
|
|
CFE_EVS_SendEvent(CS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EID, CFE_EVS_EventType_ERROR, |
|
"Enable EEPROM entry failed, invalid Entry ID: %d, State: %d, Max ID: %d", EntryID, |
|
State, (CS_MAX_NUM_EEPROM_TABLE_ENTRIES - 1)); |
|
CS_AppData.HkPacket.Payload.CmdErrCounter++; |
|
} |
|
} /* end InProgress if */ |
|
} |
Checklist
Describe the bug
It seems like the error event (
CS_ENABLE_EEPROM_DEF_EMPTY_DBG_EID) inCS_EnableEntryIDEepromCmdprobably wants theCS_AppData.DefEepromTblPtr[EntryID]State, not the local functionStatevariable, which is intended for use in theCS_ENABLE_EEPROM_INVALID_ENTRY_ERR_EIDevent message.Code snips
CS/fsw/src/cs_eeprom_cmds.c
Lines 223 to 276 in f958cc0
Expected behavior
Use the correct
Statein the error event.Reporter Info
Avi Weiss @thnkslprpt