From 6a5779cddbaf01623539c7a3006890edab54d880 Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Thu, 6 Jun 2024 13:10:56 +0200 Subject: [PATCH] move success event into managetable --- .vscode/settings.json | 22 ++++++++++++++++++++++ fsw/inc/sc_events.h | 10 ---------- fsw/src/sc_cmds.c | 19 ++++++++----------- 3 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8ef408d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#fa1b49", + "activityBar.background": "#fa1b49", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "activityBarBadge.background": "#155e02", + "activityBarBadge.foreground": "#e7e7e7", + "commandCenter.border": "#e7e7e799", + "sash.hoverBorder": "#fa1b49", + "statusBar.background": "#dd0531", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#fa1b49", + "statusBarItem.remoteBackground": "#dd0531", + "statusBarItem.remoteForeground": "#e7e7e7", + "titleBar.activeBackground": "#dd0531", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#dd053199", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.color": "#dd0531" +} diff --git a/fsw/inc/sc_events.h b/fsw/inc/sc_events.h index 4b69999..e0905bf 100644 --- a/fsw/inc/sc_events.h +++ b/fsw/inc/sc_events.h @@ -1354,16 +1354,6 @@ */ #define SC_AUTOSTART_RTS_INV_ID_ERR_EID 138 -/** - * \brief SC Table Manage Request Table ID Invalid Event ID - * - * \par Type: INFORMATION - * - * \par Cause: - * This event message is issued when a #SC_MANAGE_TABLE_CC command was received and executed successfully - - */ -#define SC_MANAGE_TABLE_INF_EID 111 /**\}*/ #endif diff --git a/fsw/src/sc_cmds.c b/fsw/src/sc_cmds.c index e7c9cd8..53170f5 100644 --- a/fsw/src/sc_cmds.c +++ b/fsw/src/sc_cmds.c @@ -608,7 +608,6 @@ void SC_ManageTableCmd(const SC_ManageTableCmd_t *Cmd) { int32 ArrayIndex; int32 TableID = Cmd->Payload.Parameter; - CFE_Status_t Status = CFE_SUCCESS; /* Manage selected table as appropriate for each table type */ if ((TableID >= SC_TBL_ID_ATS_0) && (TableID < (SC_TBL_ID_ATS_0 + SC_NUMBER_OF_ATS))) @@ -654,16 +653,6 @@ void SC_ManageTableCmd(const SC_ManageTableCmd_t *Cmd) else { /* Invalid table ID */ - Status = SC_ERROR; - } - - if (Status == CFE_SUCCESS) - { - CFE_EVS_SendEvent(SC_MANAGE_TABLE_INF_EID, CFE_EVS_EventType_INFORMATION, - "Table manage command."); - } - else - { CFE_EVS_SendEvent(SC_TABLE_MANAGE_ID_ERR_EID, CFE_EVS_EventType_ERROR, "Table manage command packet error: table ID = %d", (int)TableID); @@ -762,6 +751,8 @@ void SC_ManageTable(SC_TableType type, int32 ArrayIndex) { SC_UpdateAppend(); } + + Result = CFE_SUCCESS; } else if ((Result != CFE_SUCCESS) && (Result != CFE_TBL_ERR_NEVER_LOADED)) { @@ -785,4 +776,10 @@ void SC_ManageTable(SC_TableType type, int32 ArrayIndex) } } + if ((Result == CFE_SUCCESS) || (Result == CFE_TBL_INFO_UPDATED)) + { + CFE_EVS_SendEvent(SC_TABLE_MANAGE_INF_EID, CFE_EVS_EventType_INFORMATION, + "Table manage command."); + } + } /* End SC_ManageTable() */