Skip to content

Commit

Permalink
Merge pull request #102 from astrogeco/integration-candidate
Browse files Browse the repository at this point in the history
sch_lab Integration candidate: Caelum+dev1
  • Loading branch information
astrogeco authored Dec 6, 2021
2 parents 8124041 + 5605524 commit 8074e8e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ To change the list of packets that sch_lab sends out, edit the schedule table lo

## Version History

### Development Build: v2.5.0-rc4+dev6

- Use separate address variable
- Use CFE_MSG_PTR conversion macro
- Update baseline for cFS-Caelum-rc4: v2.5.0-rc4
- See <https://github.com/nasa/sch_lab/pull/102> and <https://github.com/nasa/cFS/pull/390>

### Development Build: v2.4.0-rc1+dev53

- Apply CFE_SB_ValueToMsgId where required
Expand Down
13 changes: 8 additions & 5 deletions fsw/src/sch_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;
CFE_MSG_CommandHeader_t CommandHeader;
uint32 PacketRate;
uint32 Counter;
} SCH_LAB_StateEntry_t;
Expand Down Expand Up @@ -119,7 +119,7 @@ void SCH_Lab_AppMain(void)
if (LocalStateEntry->Counter >= LocalStateEntry->PacketRate)
{
LocalStateEntry->Counter = 0;
CFE_SB_TransmitMsg(&LocalStateEntry->CmdHeader.Msg, true);
CFE_SB_TransmitMsg(CFE_MSG_PTR(LocalStateEntry->CommandHeader), true);
}
}
++LocalStateEntry;
Expand All @@ -144,6 +144,7 @@ int32 SCH_LAB_AppInit(void)
SCH_LAB_ScheduleTable_t * ConfigTable;
SCH_LAB_ScheduleTableEntry_t *ConfigEntry;
SCH_LAB_StateEntry_t * LocalStateEntry;
void * TableAddr;

memset(&SCH_LAB_Global, 0, sizeof(SCH_LAB_Global));

Expand Down Expand Up @@ -177,7 +178,7 @@ int32 SCH_LAB_AppInit(void)
/*
** Get Table Address
*/
Status = CFE_TBL_GetAddress((void **)&ConfigTable, SCH_LAB_Global.TblHandle);
Status = CFE_TBL_GetAddress(&TableAddr, SCH_LAB_Global.TblHandle);
if (Status != CFE_SUCCESS && Status != CFE_TBL_INFO_UPDATED)
{
CFE_ES_WriteToSysLog("SCH_LAB: Error Getting Table's Address SCH_LAB_SchTbl, RC = 0x%08lX\n",
Expand All @@ -189,14 +190,16 @@ int32 SCH_LAB_AppInit(void)
/*
** Initialize the command headers
*/
ConfigTable = TableAddr;
ConfigEntry = ConfigTable->Config;
LocalStateEntry = SCH_LAB_Global.State;
for (i = 0; i < SCH_LAB_MAX_SCHEDULE_ENTRIES; i++)
{
if (ConfigEntry->PacketRate != 0)
{
CFE_MSG_Init(&LocalStateEntry->CmdHeader.Msg, ConfigEntry->MessageID, sizeof(LocalStateEntry->CmdHeader));
CFE_MSG_SetFcnCode(&LocalStateEntry->CmdHeader.Msg, ConfigEntry->FcnCode);
CFE_MSG_Init(CFE_MSG_PTR(LocalStateEntry->CommandHeader), ConfigEntry->MessageID,
sizeof(LocalStateEntry->CommandHeader));
CFE_MSG_SetFcnCode(CFE_MSG_PTR(LocalStateEntry->CommandHeader), ConfigEntry->FcnCode);
LocalStateEntry->PacketRate = ConfigEntry->PacketRate;
}
++ConfigEntry;
Expand Down
13 changes: 10 additions & 3 deletions fsw/src/sch_lab_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,23 @@
*/

/* Development Build Macro Definitions */
#define SCH_LAB_BUILD_NUMBER 53 /*!< Development Build: Number of commits since baseline */
#define SCH_LAB_BUILD_NUMBER 6 /*!< Development Build: Number of commits since baseline */
#define SCH_LAB_BUILD_BASELINE \
"v2.4.0-rc1" /*!< Development Build: git tag that is the base for the current development */
"v2.5.0-rc4" /*!< Development Build: git tag that is the base for the current development */

/* Version Macro Definitions */

#define SCH_LAB_MAJOR_VERSION 2 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */
#define SCH_LAB_MINOR_VERSION 3 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */
#define SCH_LAB_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */
#define SCH_LAB_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */

/*!
* @brief Mission revision.
*
* Set to 0 on OFFICIAL releases, and set to 255 (0xFF) on development versions.
* Values 1-254 are reserved for mission use to denote patches/customizations as needed.
*/
#define SCH_LAB_MISSION_REV 0xFF

#define SCH_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */
#define SCH_LAB_STR(x) SCH_LAB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */
Expand Down

0 comments on commit 8074e8e

Please sign in to comment.