Skip to content

Commit

Permalink
Merge pull request #49 from thnkslprpt/fix-48-comment-and-empty-line-…
Browse files Browse the repository at this point in the history
…cleanup

Fix #48, Remove redundant/inconsistent comments (/* end of function */, /* end if */ etc.) and clean up empty lines.
  • Loading branch information
dzbaker authored Oct 18, 2022
2 parents 0a01977 + c80459f commit 919896a
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 549 deletions.
23 changes: 6 additions & 17 deletions fsw/src/hs_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ void HS_AppMain(void)
*/
RunStatus = CFE_ES_RunStatus_APP_ERROR;
}

} /* end CFS_ES_RunLoop while */

/*
Expand Down Expand Up @@ -192,8 +191,7 @@ void HS_AppMain(void)
** Exit the application
*/
CFE_ES_ExitApp(RunStatus);

} /* end HS_AppMain */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -340,8 +338,7 @@ int32 HS_AppInit(void)
HS_MAJOR_VERSION, HS_MINOR_VERSION, HS_REVISION, HS_MISSION_REV);

return Status;

} /* end HS_AppInit */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -414,8 +411,7 @@ int32 HS_SbInit(void)
*/

return Status;

} /* End of HS_SbInit() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -531,8 +527,7 @@ int32 HS_TblInit(void)
HS_AcquirePointers();

return CFE_SUCCESS;

} /* End of HS_TblInit() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -602,8 +597,7 @@ int32 HS_ProcessMain(void)
}

return Status;

} /* End of HS_ProcessMain() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -670,9 +664,4 @@ int32 HS_ProcessCommands(void)
}

return Status;

} /* End of HS_ProcessCommands() */

/************************/
/* End of File Comment */
/************************/
}
45 changes: 18 additions & 27 deletions fsw/src/hs_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void HS_AppPipe(const CFE_SB_Buffer_t *BufPtr)

switch (CFE_SB_MsgIdToValue(MessageID))
{

/*
** Housekeeping telemetry request
*/
Expand Down Expand Up @@ -137,7 +136,7 @@ void HS_AppPipe(const CFE_SB_Buffer_t *BufPtr)
break;

} /* end MessageID switch */
} /* End HS_AppPipe */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -239,7 +238,6 @@ void HS_HousekeepingReq(const CFE_SB_Buffer_t *BufPtr)
*/
for (TableIndex = 0; TableIndex < HS_MAX_EXEC_CNT_SLOTS; TableIndex++)
{

ExeCount = HS_INVALID_EXECOUNT;

if (HS_AppData.ExeCountState == HS_STATE_ENABLED)
Expand Down Expand Up @@ -293,7 +291,7 @@ void HS_HousekeepingReq(const CFE_SB_Buffer_t *BufPtr)
CFE_SB_TransmitMsg(&HS_AppData.HkPacket.TlmHeader.Msg, true);

} /* end HS_VerifyMsgLength if */
} /* end HS_HousekeepingCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -314,7 +312,7 @@ void HS_NoopCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(HS_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command: Version %d.%d.%d.%d",
HS_MAJOR_VERSION, HS_MINOR_VERSION, HS_REVISION, HS_MISSION_REV);
}
} /* end HS_NoopCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -334,7 +332,7 @@ void HS_ResetCmd(const CFE_SB_Buffer_t *BufPtr)

CFE_EVS_SendEvent(HS_RESET_DBG_EID, CFE_EVS_EventType_DEBUG, "Reset counters command");
}
} /* end HS_ResetCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -347,7 +345,7 @@ void HS_ResetCounters(void)
HS_AppData.CmdErrCount = 0;
HS_AppData.EventsMonitoredCount = 0;
HS_AppData.MsgActExec = 0;
} /* end HS_ResetCounters */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -368,7 +366,7 @@ void HS_EnableAppMonCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentAppMonState = HS_STATE_ENABLED;
CFE_EVS_SendEvent(HS_ENABLE_APPMON_DBG_EID, CFE_EVS_EventType_DEBUG, "Application Monitoring Enabled");
}
} /* end HS_EnableAppMonCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -388,7 +386,7 @@ void HS_DisableAppMonCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentAppMonState = HS_STATE_DISABLED;
CFE_EVS_SendEvent(HS_DISABLE_APPMON_DBG_EID, CFE_EVS_EventType_DEBUG, "Application Monitoring Disabled");
}
} /* end HS_DisableAppMonCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -410,7 +408,6 @@ void HS_EnableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
*/
if (HS_AppData.CurrentEventMonState == HS_STATE_DISABLED)
{

Status = CFE_SB_SubscribeEx(CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), HS_AppData.EventPipe,
CFE_SB_DEFAULT_QOS, HS_EVENT_PIPE_DEPTH);

Expand Down Expand Up @@ -446,7 +443,7 @@ void HS_EnableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CmdErrCount++;
}
}
} /* end HS_EnableEventMonCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -463,13 +460,11 @@ void HS_DisableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
*/
if (HS_VerifyMsgLength(&BufPtr->Msg, ExpectedLength))
{

/*
** Unsubscribe from Event Messages if currently enabled
*/
if (HS_AppData.CurrentEventMonState == HS_STATE_ENABLED)
{

Status = CFE_SB_Unsubscribe(CFE_SB_ValueToMsgId(CFE_EVS_LONG_EVENT_MSG_MID), HS_AppData.EventPipe);

if (Status != CFE_SUCCESS)
Expand Down Expand Up @@ -503,7 +498,7 @@ void HS_DisableEventMonCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CmdErrCount++;
}
}
} /* end HS_DisableEventMonCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -523,7 +518,7 @@ void HS_EnableAlivenessCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentAlivenessState = HS_STATE_ENABLED;
CFE_EVS_SendEvent(HS_ENABLE_ALIVENESS_DBG_EID, CFE_EVS_EventType_DEBUG, "Aliveness Indicator Enabled");
}
} /* end HS_EnableAlivenessCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -543,7 +538,7 @@ void HS_DisableAlivenessCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentAlivenessState = HS_STATE_DISABLED;
CFE_EVS_SendEvent(HS_DISABLE_ALIVENESS_DBG_EID, CFE_EVS_EventType_DEBUG, "Aliveness Indicator Disabled");
}
} /* end HS_DisableAlivenessCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -563,7 +558,7 @@ void HS_EnableCPUHogCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentCPUHogState = HS_STATE_ENABLED;
CFE_EVS_SendEvent(HS_ENABLE_CPUHOG_DBG_EID, CFE_EVS_EventType_DEBUG, "CPU Hogging Indicator Enabled");
}
} /* end HS_EnableCPUHogCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -583,7 +578,7 @@ void HS_DisableCPUHogCmd(const CFE_SB_Buffer_t *BufPtr)
HS_AppData.CurrentCPUHogState = HS_STATE_DISABLED;
CFE_EVS_SendEvent(HS_DISABLE_CPUHOG_DBG_EID, CFE_EVS_EventType_DEBUG, "CPU Hogging Indicator Disabled");
}
} /* end HS_DisableCPUHogCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -604,7 +599,7 @@ void HS_ResetResetsPerformedCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(HS_RESET_RESETS_DBG_EID, CFE_EVS_EventType_DEBUG,
"Processor Resets Performed by HS Counter has been Reset");
}
} /* end HS_ResetResetsPerformedCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -629,7 +624,7 @@ void HS_SetMaxResetsCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(HS_SET_MAX_RESETS_DBG_EID, CFE_EVS_EventType_DEBUG,
"Max Resets Performable by HS has been set to %d", HS_AppData.CDSData.MaxResets);
}
} /* end HS_SetMaxResetsCmd */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -834,7 +829,7 @@ void HS_AcquirePointers(void)
}

#endif
} /* End of HS_AcquirePointers */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -873,7 +868,7 @@ void HS_AppMonStatusRefresh(void)
(TableIndex % HS_BITS_PER_APPMON_ENABLE));
}
}
} /* end HS_AppMonStatusRefresh */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -891,8 +886,4 @@ void HS_MsgActsStatusRefresh(void)
{
HS_AppData.MsgActCooldown[TableIndex] = 0;
}
} /* end HS_MsgActsStatusRefresh */

/************************/
/* End of File Comment */
/************************/
}
31 changes: 11 additions & 20 deletions fsw/src/hs_custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void HS_IdleTask(void)

while (HS_CustomData.IdleTaskRunStatus == CFE_SUCCESS)
{

/* Check to see if we are to mark the time. */
if (((HS_CustomData.ThisIdleTaskExec & HS_CustomData.UtilMask) == HS_CustomData.UtilMask) &&
(HS_CustomData.ThisIdleTaskExec > HS_CustomData.UtilMask))
Expand All @@ -79,7 +78,7 @@ void HS_IdleTask(void)
/* Thread cancellation point/give up CPU */
OS_TaskDelay(0);
}
} /* End of HS_IdleTask() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -129,8 +128,7 @@ int32 HS_CustomInit(void)
HS_CustomData.UtilCallsPerMark = HS_UTIL_CALLS_PER_MARK;

return Status;

} /* end HS_CustomInit */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -155,8 +153,7 @@ void HS_CustomCleanup(void)
** Delete the Idle Task
*/
CFE_ES_DeleteChildTask(HS_CustomData.IdleTaskID);

} /* end HS_CustomCleanup */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -166,7 +163,7 @@ void HS_CustomCleanup(void)
void HS_UtilizationIncrement(void)
{
HS_CustomData.ThisIdleTaskExec++;
} /* end HS_UtilizationIncrement */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -185,7 +182,7 @@ void HS_UtilizationMark(void)
HS_CustomData.LastIdleTaskExec = HS_CustomData.ThisIdleTaskExec;
CycleCount = 0;
}
} /* end HS_UtilizationMark */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -198,7 +195,7 @@ void HS_MarkIdleCallback(void)
** Capture the CPU Utilization (at a consistant time)
*/
HS_UtilizationMark();
} /* End of HS_MarkIdleCallback() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand All @@ -215,8 +212,7 @@ void HS_CustomMonitorUtilization(void)
HS_MonitorUtilization();
HS_CustomData.UtilCycleCounter = 0;
}

} /* End of HS_CustomMonitorUtilization() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -256,8 +252,7 @@ int32 HS_CustomCommands(const CFE_SB_Buffer_t *BufPtr)
} /* end CommandCode switch */

return Status;

} /* End of HS_CustomCommands() */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -364,7 +359,7 @@ void HS_UtilDiagReport(void)
(unsigned int)HS_CustomData.UtilMask, (int)OutputValue[OutputOrdinal[0]], (int)OutputCount[OutputOrdinal[0]],
(int)OutputValue[OutputOrdinal[1]], (int)OutputCount[OutputOrdinal[1]], (int)OutputValue[OutputOrdinal[2]],
(int)OutputCount[OutputOrdinal[2]], (int)OutputValue[OutputOrdinal[3]], (int)OutputCount[OutputOrdinal[3]]);
} /* end HS_UtilDiagReport */
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
Expand Down Expand Up @@ -417,7 +412,7 @@ void HS_SetUtilParamsCmd(const CFE_SB_Buffer_t *BufPtr)
(int)CmdPtr->Mult1, (int)CmdPtr->Div, (int)CmdPtr->Mult2);
}
}
} /* end HS_SetUtilParamsCmd */
}

void HS_SetUtilDiagCmd(const CFE_SB_Buffer_t *BufPtr)
{
Expand All @@ -436,8 +431,4 @@ void HS_SetUtilDiagCmd(const CFE_SB_Buffer_t *BufPtr)
CFE_EVS_SendEvent(HS_SET_UTIL_DIAG_DBG_EID, CFE_EVS_EventType_DEBUG,
"Utilization Diagnostics Mask has been set to %08X", (unsigned int)HS_CustomData.UtilMask);
}
} /* end HS_SetUtilDiagCmd */

/************************/
/* End of File Comment */
/************************/
}
1 change: 0 additions & 1 deletion fsw/src/hs_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ typedef struct

int32 IdleTaskRunStatus; /**< \brief HS Idle Task Run Status */
CFE_ES_TaskId_t IdleTaskID; /**< \brief HS Idle Task Task ID */

} HS_CustomData_t;

/**
Expand Down
Loading

0 comments on commit 919896a

Please sign in to comment.