Skip to content

Commit

Permalink
Fix #142, scrub header guards
Browse files Browse the repository at this point in the history
Use a consistent header guard on all sample app header files.
Also convert file-scope block comments to doxygen format.
  • Loading branch information
jphickey committed Mar 24, 2021
1 parent dac28c0 commit dbed84b
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 117 deletions.
24 changes: 10 additions & 14 deletions fsw/mission_inc/sample_app_perfids.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app_perfids.h
**
** Purpose:
** Define Sample App Performance IDs
**
** Notes:
**
*************************************************************************/
#ifndef _sample_app_perfids_h_
#define _sample_app_perfids_h_

#define SAMPLE_APP_PERF_ID 91
/**
* @file
*
* Define Sample App Performance IDs
*/

#ifndef SAMPLE_APP_PERFIDS_H
#define SAMPLE_APP_PERFIDS_H

#endif /* _sample_app_perfids_h_ */
#define SAMPLE_APP_PERF_ID 91

/************************/
/* End of File Comment */
/************************/
#endif /* SAMPLE_APP_PERFIDS_H */
28 changes: 11 additions & 17 deletions fsw/platform_inc/sample_app_msgids.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,23 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app_msgids.h
**
** Purpose:
** Define Sample App Message IDs
**
** Notes:
** Message ID bits relate to the message header based on which version
** of the message id implementation is being used
**
*************************************************************************/
#ifndef _sample_app_msgids_h_
#define _sample_app_msgids_h_

/* The Sample App assumes default configuration which uses V1 of message id implementation */
/**
* @file
*
* Define Sample App Message IDs
*
* \note The Sample App assumes default configuration which uses V1 of message id implementation
*/

#ifndef SAMPLE_APP_MSGIDS_H
#define SAMPLE_APP_MSGIDS_H

/* V1 Command Message IDs must be 0x18xx */
#define SAMPLE_APP_CMD_MID 0x1882
#define SAMPLE_APP_SEND_HK_MID 0x1883
/* V1 Telemetry Message IDs must be 0x08xx */
#define SAMPLE_APP_HK_TLM_MID 0x0883

#endif /* _sample_app_msgids_h_ */

/************************/
/* End of File Comment */
/************************/
#endif /* SAMPLE_APP_MSGIDS_H */
25 changes: 10 additions & 15 deletions fsw/platform_inc/sample_app_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app_table.h
**
** Purpose:
** Define sample app table
**
** Notes:
**
**
*******************************************************************************/
#ifndef _sample_app_table_h_
#define _sample_app_table_h_

/**
* @file
*
* Define sample app table
*/

#ifndef SAMPLE_APP_TABLE_H
#define SAMPLE_APP_TABLE_H

/*
** Table structure
Expand All @@ -40,8 +39,4 @@ typedef struct

} SAMPLE_APP_Table_t;

#endif /* _sample_app_table_h_ */

/************************/
/* End of File Comment */
/************************/
#endif /* SAMPLE_APP_TABLE_H */
18 changes: 9 additions & 9 deletions fsw/src/sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app.h
**
** Purpose:
** This file is main hdr file for the SAMPLE application.
**
**
*******************************************************************************/

#ifndef _sample_app_h_
#define _sample_app_h_
/**
* @file
*
* Main header file for the SAMPLE application
*/

#ifndef SAMPLE_APP_H
#define SAMPLE_APP_H

/*
** Required header files.
Expand Down Expand Up @@ -115,4 +115,4 @@ int32 SAMPLE_APP_TblValidationFunc(void *TblData);

bool SAMPLE_APP_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength);

#endif /* _sample_app_h_ */
#endif /* SAMPLE_APP_H */
24 changes: 10 additions & 14 deletions fsw/src/sample_app_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app_events.h
**
** Purpose:
** Define SAMPLE App Events IDs
**
** Notes:
**
*************************************************************************/
#ifndef _sample_app_events_h_
#define _sample_app_events_h_

/**
* @file
*
* Define SAMPLE App Events IDs
*/

#ifndef SAMPLE_APP_EVENTS_H
#define SAMPLE_APP_EVENTS_H

#define SAMPLE_APP_RESERVED_EID 0
#define SAMPLE_APP_STARTUP_INF_EID 1
Expand All @@ -40,8 +40,4 @@

#define SAMPLE_APP_EVENT_COUNTS 7

#endif /* _sample_app_events_h_ */

/************************/
/* End of File Comment */
/************************/
#endif /* SAMPLE_APP_EVENTS_H */
25 changes: 10 additions & 15 deletions fsw/src/sample_app_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
** See the License for the specific language governing permissions and
** limitations under the License.
**
** File: sample_app_msg.h
**
** Purpose:
** Define SAMPLE App Messages and info
**
** Notes:
**
**
*******************************************************************************/
#ifndef _sample_app_msg_h_
#define _sample_app_msg_h_

/**
* @file
*
* Define SAMPLE App Messages and info
*/

#ifndef SAMPLE_APP_MSG_H
#define SAMPLE_APP_MSG_H

/*
** SAMPLE App command codes
Expand Down Expand Up @@ -76,8 +75,4 @@ typedef struct
SAMPLE_APP_HkTlm_Payload_t Payload; /**< \brief Telemetry payload */
} SAMPLE_APP_HkTlm_t;

#endif /* _sample_app_msg_h_ */

/************************/
/* End of File Comment */
/************************/
#endif /* SAMPLE_APP_MSG_H */
9 changes: 2 additions & 7 deletions fsw/src/sample_app_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
**
*************************************************************************/

/*! @file sample_app_version.h
* @brief Purpose:
/**
* @file
*
* The Sample App header file containing version information
*
*/

#ifndef SAMPLE_APP_VERSION_H
Expand Down Expand Up @@ -62,7 +61,3 @@
", Last Official Release: v1.1.0" /* For full support please use this version */

#endif /* SAMPLE_APP_VERSION_H */

/************************/
/* End of File Comment */
/************************/
17 changes: 8 additions & 9 deletions unit-test/coveragetest/sample_app_coveragetest_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
** limitations under the License.
*/

/*
** File: sample_app_coveragetest_common.h
**
** Purpose:
** Common definitions for all sample_app coverage tests
*/
/**
* @file
*
* Common definitions for all sample_app coverage tests
*/

#ifndef _SAMPLE_APP_COVERAGETEST_COMMON_H_
#define _SAMPLE_APP_COVERAGETEST_COMMON_H_
#ifndef SAMPLE_APP_COVERAGETEST_COMMON_H
#define SAMPLE_APP_COVERAGETEST_COMMON_H

/*
* Includes
Expand Down Expand Up @@ -66,4 +65,4 @@ void Sample_UT_Setup(void);
*/
void Sample_UT_TearDown(void);

#endif
#endif /* SAMPLE_APP_COVERAGETEST_COMMON_H */
36 changes: 19 additions & 17 deletions unit-test/inc/ut_sample_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@
** limitations under the License.
*/

/*
** File: ut_sample_app.h
**
** Purpose:
** Extra scaffolding functions for the sample_app unit test
**
** Notes:
** This is an extra UT-specific extern declaration
** to obtain access to an internal data structure
**
** UT often needs to modify internal data structures in ways that
** actual applications never would (bypassing the normal API) in
** order to exercise or set up for off-nominal cases.
*/
#ifndef _UT_SAMPLE_APP_H_
#define _UT_SAMPLE_APP_H_
/**
* @file
*
*
* Purpose:
* Extra scaffolding functions for the sample_app unit test
*
* Notes:
* This is an extra UT-specific extern declaration
* to obtain access to an internal data structure
*
* UT often needs to modify internal data structures in ways that
* actual applications never would (bypassing the normal API) in
* order to exercise or set up for off-nominal cases.
*/

#ifndef UT_SAMPLE_APP_H
#define UT_SAMPLE_APP_H

/*
* Necessary to include these here to get the definition of the
Expand All @@ -47,4 +49,4 @@
*/
extern SAMPLE_APP_Data_t SAMPLE_APP_Data;

#endif /* _UT_SAMPLE_APP_H_ */
#endif /* UT_SAMPLE_APP_H */

0 comments on commit dbed84b

Please sign in to comment.