Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #70, update global symbol names for consistency #74

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
460 changes: 230 additions & 230 deletions docs/dox_src/cfs_lc.dox

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions fsw/inc/lc_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@
*
* This event message is issued when the #LC_SET_AP_STATE_CC command
* has been received and the current actionpoint state is either
* #LC_ACTION_NOT_USED or #LC_APSTATE_PERMOFF which can only be changed
* #LC_APSTATE_NOT_USED or #LC_APSTATE_PERMOFF which can only be changed
* with a table load.
*/
#define LC_APSTATE_CURR_ERR_EID 31
Expand Down Expand Up @@ -484,7 +484,7 @@
*
* \par Cause:
*
* This event message is issued when the #LC_SET_AP_PERMOFF_CC command
* This event message is issued when the #LC_SET_AP_PERM_OFF_CC command
* has been received with an invalid actionpoint number specified
*/
#define LC_APOFF_APNUM_ERR_EID 34
Expand All @@ -496,7 +496,7 @@
*
* \par Cause:
*
* This event message is issued when the #LC_SET_AP_PERMOFF_CC command
* This event message is issued when the #LC_SET_AP_PERM_OFF_CC command
* has been received and the current actionpoint state is not
* #LC_APSTATE_DISABLED
*/
Expand All @@ -509,7 +509,7 @@
*
* \par Cause:
*
* This event message is issued when the #LC_SET_AP_PERMOFF_CC command
* This event message is issued when the #LC_SET_AP_PERM_OFF_CC command
* has been successfully executed
*/
#define LC_APOFF_INF_EID 36
Expand Down Expand Up @@ -772,7 +772,7 @@
*
* This event message is issued when the #LC_SAMPLE_AP_MID message
* has been received and the current state for the specified
* actionpoint state is either #LC_ACTION_NOT_USED or #LC_APSTATE_PERMOFF.
* actionpoint state is either #LC_APSTATE_NOT_USED or #LC_APSTATE_PERMOFF.
*/
#define LC_APSAMPLE_CURR_ERR_EID 57

Expand Down
2 changes: 1 addition & 1 deletion fsw/inc/lc_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef struct
/**
* \brief Set AP (Actionpoint) Permanently Off
*
* For command details see #LC_SET_AP_PERMOFF_CC
* For command details see #LC_SET_AP_PERM_OFF_CC
*/
typedef struct
{
Expand Down
13 changes: 9 additions & 4 deletions fsw/inc/lc_msgdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
* \name Actionpoint States
* \{
*/
#define LC_ACTION_NOT_USED 0xFF /**< \brief Actionpoint unused, not valid command argument */
#define LC_APSTATE_NOT_USED 0xFF /**< \brief Actionpoint unused, not valid command argument */
#define LC_APSTATE_ACTIVE 1 /**< \brief Actionpoint state active */
#define LC_APSTATE_PASSIVE 2 /**< \brief Actionpoint state passive */
#define LC_APSTATE_DISABLED 3 /**< \brief Actionpoint state disabled */
#define LC_APSTATE_PERMOFF 4 /**< \brief Actionpoint state permanently off, see #LC_SET_AP_PERMOFF_CC */
#define LC_APSTATE_PERMOFF 4 /**< \brief Actionpoint state permanently off, see #LC_SET_AP_PERM_OFF_CC */
/**\}*/

/**
Expand Down Expand Up @@ -238,7 +238,7 @@
* - Invalid actionpoint state specified in command message
* - Actionpoint number specified in command message is
* out of range
* - Actionpoint current state is either #LC_ACTION_NOT_USED
* - Actionpoint current state is either #LC_APSTATE_NOT_USED
* or #LC_APSTATE_PERMOFF
*
* \par Evidence of failure may be found in the following telemetry:
Expand Down Expand Up @@ -287,7 +287,7 @@
* None
*
*/
#define LC_SET_AP_PERMOFF_CC 4
#define LC_SET_AP_PERM_OFF_CC 4

/**
* \brief Reset AP Statistics
Expand Down Expand Up @@ -359,4 +359,9 @@

/**\}*/

#ifndef LC_OMIT_DEPRECATED
#define LC_SET_AP_PERMOFF_CC LC_SET_AP_PERM_OFF_CC
#define LC_ACTION_NOT_USED LC_APSTATE_NOT_USED
#endif

#endif
57 changes: 40 additions & 17 deletions fsw/inc/lc_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
* \name Watchpoint Definition Table (WDT) DataType Enumerated Types
* \{
*/
#define LC_WATCH_NOT_USED 0xFF /**< \brief Use for empty entries */
#define LC_DATA_BYTE 1 /**< \brief 8 bit signed byte */
#define LC_DATA_UBYTE 2 /**< \brief 8 bit unsigned byte */
#define LC_DATA_WORD_BE 3 /**< \brief 16 bit signed word big endian byte order */
#define LC_DATA_WORD_LE 4 /**< \brief 16 bit signed word little endian byte order */
#define LC_DATA_UWORD_BE 5 /**< \brief 16 bit unsigned word big endian byte order */
#define LC_DATA_UWORD_LE 6 /**< \brief 16 bit unsigned word little endian byte order */
#define LC_DATA_DWORD_BE 7 /**< \brief 32 bit signed double word big endian byte order */
#define LC_DATA_DWORD_LE 8 /**< \brief 32 bit signed double word little endian byte order */
#define LC_DATA_UDWORD_BE 9 /**< \brief 32 bit unsigned double word big endian byte order */
#define LC_DATA_UDWORD_LE 10 /**< \brief 32 bit unsigned double word little endian byte order */
#define LC_DATA_FLOAT_BE \
#define LC_DATA_WATCH_NOT_USED 0xFF /**< \brief Use for empty entries */
#define LC_DATA_WATCH_BYTE 1 /**< \brief 8 bit signed byte */
#define LC_DATA_WATCH_UBYTE 2 /**< \brief 8 bit unsigned byte */
#define LC_DATA_WATCH_WORD_BE 3 /**< \brief 16 bit signed word big endian byte order */
#define LC_DATA_WATCH_WORD_LE 4 /**< \brief 16 bit signed word little endian byte order */
#define LC_DATA_WATCH_UWORD_BE 5 /**< \brief 16 bit unsigned word big endian byte order */
#define LC_DATA_WATCH_UWORD_LE 6 /**< \brief 16 bit unsigned word little endian byte order */
#define LC_DATA_WATCH_DWORD_BE 7 /**< \brief 32 bit signed double word big endian byte order */
#define LC_DATA_WATCH_DWORD_LE 8 /**< \brief 32 bit signed double word little endian byte order */
#define LC_DATA_WATCH_UDWORD_BE 9 /**< \brief 32 bit unsigned double word big endian byte order */
#define LC_DATA_WATCH_UDWORD_LE 10 /**< \brief 32 bit unsigned double word little endian byte order */
#define LC_DATA_WATCH_FLOAT_BE \
11 /**< \brief 32 bit single precision IEEE-754 floating point number, \
* big endian byte order \
*/
#define LC_DATA_FLOAT_LE \
#define LC_DATA_WATCH_FLOAT_LE \
12 /**< \brief 32 bit single precision IEEE-754 floating point number, \
* little endian byte order \
*/
Expand All @@ -74,7 +74,7 @@
* \name Watchpoint Definition Table (WDT) OperatorID Enumerated Types
* \{
*/
#define LC_NO_OPER 0xFF /**< \brief Use for empty entries */
#define LC_OPER_NONE 0xFF /**< \brief Use for empty entries */
#define LC_OPER_LT 1 /**< \brief Less Than (<) */
#define LC_OPER_LE 2 /**< \brief Less Than or Equal To (<=) */
#define LC_OPER_NE 3 /**< \brief Not Equal (!=) */
Expand All @@ -88,7 +88,7 @@
* \name Watchpoint Definition Table (WDT) BitMask Enumerated Types
* \{
*/
#define LC_NO_BITMASK 0xFFFFFFFF /**< \brief Use for no masking */
#define LC_BITMASK_NONE 0xFFFFFFFF /**< \brief Use for no masking */
/**\}*/

/**
Expand Down Expand Up @@ -126,7 +126,7 @@
* \name Watchpoint Definition Table (WDT) Validation Error Enumerated Types
* \{
*/
#define LC_WDTVAL_NO_ERR 0 /**< \brief No error */
#define LC_WDTVAL_ERR_NONE 0 /**< \brief No error */
#define LC_WDTVAL_ERR_DATATYPE 1 /**< \brief Invalid DataType */
#define LC_WDTVAL_ERR_OPER 2 /**< \brief Invalid OperatorID */
#define LC_WDTVAL_ERR_MID 3 /**< \brief Invalid MessageID */
Expand All @@ -138,12 +138,35 @@
* \name Actionpoint Definition Table (ADT) Validation Error Enumerated Types
* \{
*/
#define LC_ADTVAL_NO_ERR 0 /**< \brief No error */
#define LC_ADTVAL_ERR_NONE 0 /**< \brief No error */
#define LC_ADTVAL_ERR_DEFSTATE 1 /**< \brief Invalid DefaultState */
#define LC_ADTVAL_ERR_RTSID 2 /**< \brief Invalid RTSId */
#define LC_ADTVAL_ERR_FAILCNT 3 /**< \brief MaxFailsBeforeRTS is zero */
#define LC_ADTVAL_ERR_EVTTYPE 4 /**< \brief Invalid EventType */
#define LC_ADTVAL_ERR_RPN 5 /**< \brief Invalid Reverse Polish Expression */
/**\}*/

#ifndef LC_OMIT_DEPRECATED

#define LC_NO_OPER LC_OPER_NONE
#define LC_NO_BITMASK LC_BITMASK_NONE
#define LC_ADTVAL_NO_ERR LC_ADTVAL_ERR_NONE
#define LC_WDTVAL_NO_ERR LC_WDTVAL_ERR_NONE

#define LC_DATA_NOT_USED LC_DATA_WATCH_NOT_USED
#define LC_DATA_BYTE LC_DATA_WATCH_BYTE
#define LC_DATA_UBYTE LC_DATA_WATCH_UBYTE
#define LC_DATA_WORD_BE LC_DATA_WATCH_WORD_BE
#define LC_DATA_WORD_LE LC_DATA_WATCH_WORD_LE
#define LC_DATA_UWORD_BE LC_DATA_WATCH_UWORD_BE
#define LC_DATA_UWORD_LE LC_DATA_WATCH_UWORD_LE
#define LC_DATA_DWORD_BE LC_DATA_WATCH_DWORD_BE
#define LC_DATA_DWORD_LE LC_DATA_WATCH_DWORD_LE
#define LC_DATA_UDWORD_BE LC_DATA_WATCH_UDWORD_BE
#define LC_DATA_UDWORD_LE LC_DATA_WATCH_UDWORD_LE
#define LC_DATA_FLOAT_BE LC_DATA_WATCH_FLOAT_BE
#define LC_DATA_FLOAT_LE LC_DATA_WATCH_FLOAT_LE

#endif

#endif
14 changes: 7 additions & 7 deletions fsw/src/lc_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void LC_SampleAPs(uint16 StartIndex, uint16 EndIndex)
{
CurrentAPState = LC_OperData.ARTPtr[StartIndex].CurrentState;

if ((CurrentAPState != LC_ACTION_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
if ((CurrentAPState != LC_APSTATE_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
{
/*
** Sample the specified actionpoint
Expand Down Expand Up @@ -483,7 +483,7 @@ int32 LC_ValidateADT(void *TableData)
{
LC_ADTEntry_t *TableArray = (LC_ADTEntry_t *)TableData;

int32 EntryResult = LC_ADTVAL_NO_ERR;
int32 EntryResult = LC_ADTVAL_ERR_NONE;
int32 TableResult = CFE_SUCCESS;
int32 TableIndex;

Expand Down Expand Up @@ -511,7 +511,7 @@ int32 LC_ValidateADT(void *TableData)
RPNPtr = TableArray[TableIndex].RPNEquation;
EventType = TableArray[TableIndex].EventType;

if (DefaultState == LC_ACTION_NOT_USED)
if (DefaultState == LC_APSTATE_NOT_USED)
{
/*
** Unused table entry
Expand Down Expand Up @@ -560,7 +560,7 @@ int32 LC_ValidateADT(void *TableData)
*/
EntryResult = LC_ValidateRPN(RPNPtr, &RPNIndex, &RPNStackDepth);

if (EntryResult != LC_ADTVAL_NO_ERR)
if (EntryResult != LC_ADTVAL_ERR_NONE)
{
BadCount++;
}
Expand All @@ -573,7 +573,7 @@ int32 LC_ValidateADT(void *TableData)
/*
** Generate detailed event for "first" error
*/
if ((EntryResult != LC_ADTVAL_NO_ERR) && (TableResult == CFE_SUCCESS))
if ((EntryResult != LC_ADTVAL_ERR_NONE) && (TableResult == CFE_SUCCESS))
{
if (EntryResult == LC_ADTVAL_ERR_RPN)
{
Expand Down Expand Up @@ -610,7 +610,7 @@ int32 LC_ValidateADT(void *TableData)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int32 LC_ValidateRPN(const uint16 *RPNPtr, int32 *IndexValue, int32 *StackDepthValue)
{
int32 Result = LC_ADTVAL_NO_ERR;
int32 Result = LC_ADTVAL_ERR_NONE;
int32 BufferIndex;
int32 StackDepth;
uint16 BufferItem;
Expand Down Expand Up @@ -686,7 +686,7 @@ int32 LC_ValidateRPN(const uint16 *RPNPtr, int32 *IndexValue, int32 *StackDepthV
*/
if ((BufferItem == LC_RPN_EQUAL) && (StackDepth == 1))
{
Result = LC_ADTVAL_NO_ERR;
Result = LC_ADTVAL_ERR_NONE;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/lc_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ uint8 LC_EvaluateRPN(uint16 APNumber);
* stack depth value if an error is detected
*
* \return Actionpoint definition table reverse polish notation validation status
* \retval #LC_ADTVAL_NO_ERR \copydoc LC_ADTVAL_NO_ERR
* \retval #LC_ADTVAL_ERR_NONE \copydoc LC_ADTVAL_ERR_NONE
* \retval #LC_ADTVAL_ERR_RPN \copydoc LC_ADTVAL_ERR_RPN
*
* \sa #LC_ValidateADT
Expand Down
10 changes: 5 additions & 5 deletions fsw/src/lc_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int32 LC_AppPipe(const CFE_SB_Buffer_t *BufPtr)
LC_SetAPStateCmd(BufPtr);
break;

case LC_SET_AP_PERMOFF_CC:
case LC_SET_AP_PERM_OFF_CC:
LC_SetAPPermOffCmd(BufPtr);
break;

Expand Down Expand Up @@ -361,7 +361,7 @@ int32 LC_HousekeepingReq(const CFE_MSG_CommandHeader_t *MsgPtr)
*/
switch (LC_OperData.ARTPtr[TableIndex + 1].CurrentState)
{
case LC_ACTION_NOT_USED:
case LC_APSTATE_NOT_USED:
ByteData = LC_HKAR_STATE_NOT_USED << 6;
break;

Expand Down Expand Up @@ -421,7 +421,7 @@ int32 LC_HousekeepingReq(const CFE_MSG_CommandHeader_t *MsgPtr)
*/
switch (LC_OperData.ARTPtr[TableIndex].CurrentState)
{
case LC_ACTION_NOT_USED:
case LC_APSTATE_NOT_USED:
ByteData = (ByteData | (LC_HKAR_STATE_NOT_USED << 2));
break;

Expand Down Expand Up @@ -648,7 +648,7 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr)
{
CurrentAPState = LC_OperData.ARTPtr[TableIndex].CurrentState;

if ((CurrentAPState != LC_ACTION_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
if ((CurrentAPState != LC_APSTATE_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
{
LC_OperData.ARTPtr[TableIndex].CurrentState = CmdPtr->NewAPState;
}
Expand All @@ -666,7 +666,7 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr)
TableIndex = CmdPtr->APNumber;
CurrentAPState = LC_OperData.ARTPtr[TableIndex].CurrentState;

if ((CurrentAPState != LC_ACTION_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
if ((CurrentAPState != LC_APSTATE_NOT_USED) && (CurrentAPState != LC_APSTATE_PERMOFF))
{
/*
** Update state for single actionpoint specified
Expand Down
2 changes: 1 addition & 1 deletion fsw/src/lc_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void LC_SetAPStateCmd(const CFE_SB_Buffer_t *BufPtr);
*
* \param[in] BufPtr Pointer to Software Bus buffer
*
* \sa #LC_SET_AP_PERMOFF_CC
* \sa #LC_SET_AP_PERM_OFF_CC
*/
void LC_SetAPPermOffCmd(const CFE_SB_Buffer_t *BufPtr);

Expand Down
Loading