diff --git a/README.md b/README.md index 6fccd16..4452ef2 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,17 @@ ## Introduction The Stored Command application (SC) is a core Flight System (cFS) application -that is a plug in to the Core Flight Executive (cFE) component of the cFS. - +that is a plug in to the Core Flight Executive (cFE) component of the cFS. + The SC application allows a system to be autonomously commanded -using sequences of commands that are loaded to SC. Each command has a time tag -associated with it, permitting the command to be released for distribution at -predetermined times. SC supports both Absolute Time tagged command Sequences -(ATSs) and multiple Relative Time tagged command Sequences (RTSs). The -purpose of ATS commands is to be able to specify commands to be executed at a -specific time. The purpose of Relative Time Sequence commands is to be able -to specify commands to be executed at a relative time. +using sequences of commands that are loaded into SC. Each command has a time tag +or wakeup count associated with it, permitting the command to be released for +distribution at predetermined times or wakeup counts. SC supports both +Absolute Time tagged command Sequences (ATSs) and multiple Relative Time tagged +command Sequences (RTSs). The purpose of ATS commands is to be able to specify +commands to be executed at a specific time. The purpose of Relative Time +Sequence commands is to be able to specify commands to be executed at a +relative wakeup count. The SC application is written in C and depends on the cFS Operating System Abstraction Layer (OSAL) and cFE components. There is additional SC application diff --git a/config/default_sc_internal_cfg.h b/config/default_sc_internal_cfg.h index a4a0f50..dc95f7d 100644 --- a/config/default_sc_internal_cfg.h +++ b/config/default_sc_internal_cfg.h @@ -342,7 +342,7 @@ * \brief Defines the TIME SC should use for its commands * * \par Description: - * This parameter defines what type of time SC should use for sending uot its commands + * This parameter defines what type of time SC should use for sending out its commands * * \par Limits: * Must be SC_TimeRef_USE_CFE_TIME, SC_TimeRef_USE_TAI, or SC_TimeRef_USE_UTC */ diff --git a/config/default_sc_msgdefs.h b/config/default_sc_msgdefs.h index 687bab7..9d4de42 100644 --- a/config/default_sc_msgdefs.h +++ b/config/default_sc_msgdefs.h @@ -101,6 +101,7 @@ typedef uint8 SC_Process_Enum_t; #endif #define SC_MAX_TIME 0xFFFFFFFF /**< \brief Maximum time in SC */ +#define SC_MAX_WAKEUP_CNT 0xFFFFFFFF /**< \brief Maximum wakeup count in SC */ /** * Enumeration for ATS identifiers @@ -216,7 +217,7 @@ typedef struct uint16 AppendLoadCount; /**< \brief Total number of Append ATS table loads */ uint32 AtpCmdNumber; /**< \brief Current command number */ uint32 AtpFreeBytes[SC_NUMBER_OF_ATS]; /**< \brief Free Bytes in each ATS */ - uint32 NextRtsTime; /**< \brief Next RTS cmd Absolute Time */ + uint32 NextRtsWakeupCnt; /**< \brief Next RTS Command Absolute Wakeup Count */ uint32 NextAtsTime; /**< \brief Next ATS Command Time (seconds) */ uint16 RtsExecutingStatus[(SC_NUMBER_OF_RTS + (SC_NUMBER_OF_RTS_IN_UINT16 - 1)) / SC_NUMBER_OF_RTS_IN_UINT16]; diff --git a/config/default_sc_tbldefs.h b/config/default_sc_tbldefs.h index 123c093..5ccef9b 100644 --- a/config/default_sc_tbldefs.h +++ b/config/default_sc_tbldefs.h @@ -60,10 +60,15 @@ typedef uint32 SC_AbsTimeTag_t; /** - * \brief Relative time tag for RTC's + * \brief Relative time tag */ typedef uint32 SC_RelTimeTag_t; +/** + * \brief Relative wakeup count + */ +typedef uint32 SC_RelWakeupCount_t; + /** * \brief ATS Table Entry Header Type */ @@ -97,12 +102,12 @@ typedef struct */ typedef struct { - SC_RelTimeTag_t TimeTag; /**< \brief Relative time tag */ + SC_RelWakeupCount_t WakeupCount; /**< \brief Relative wakeup count */ /* * Note: the command packet data is variable length, * the command packet header (not shown here), - * comes directly after Time tag. + * comes directly after WakeupCount. */ } SC_RtsEntryHeader_t; diff --git a/docs/dox_src/cfs_sc.dox b/docs/dox_src/cfs_sc.dox index c0f8e53..fd1e54e 100644 --- a/docs/dox_src/cfs_sc.dox +++ b/docs/dox_src/cfs_sc.dox @@ -107,12 +107,12 @@ /** \page cfsscovr CFS Stored Command Overview - The CFS Stored Command appliaction allows the spacecraft to be commanded + The CFS Stored Command application allows the spacecraft to be commanded using sequences of commands that are loaded from the ground. Each - command has a time tag associated with it, permitting the command to be - released for distribution at predetermined times. SC supports both Absolute - Time tagged command Sequences (ATSs) and multiple Relative Time tagged - command Sequences (RTSs). + command has a time tag or wakeup count associated with it, permitting the command to be + released for distribution at predetermined times or wakeup counts. SC supports both Absolute + Time tagged command Sequences (ATSs) and multiple Relative Time tagged command Sequences (RTSs), + where RTSs use wakeup counts instead of time tags. \section SC Design Overview @@ -243,7 +243,7 @@

Relative Time Processor (RTP)

When the sequence is started, the RTP reads the delay of the first command. - After the amount of seconds listed in the delay, the RTP will fetch the + After the amount of wakeup counts listed in the delay, the RTP will fetch the command, check the checksum of the command, and send the command out to the data system. The RTP will then fetch the next command in the sequence and determine when this command needs to execute. @@ -273,12 +273,12 @@ a priority associated with it. The priority is assigned by the buffer number. In other words, RTS buffer 1 has the highest priority and the last RTS buffer has the lowest priority. This priority only comes into play when there is more - than one RTS that has commands to be executed in the SAME SECOND. For example, - if RTS 1 has a command to go out at 12:00:01 and RTS 50 has 8 commands to go - out at 12:00:00, all 8 commands from RTS 50 will be executed before RTS 1 - executes it's command. However, if the 8 commands from RTS 50 are scheduled to - go out at 12:00:01, then the command from RTS 1 will be sent first, followed - by 7 commands from RTS 50. At 12:00:02, the 8th command from RTS 50 will be + than one RTS that has commands to be executed on the same wakeup count. For example, + if RTS 1 has a command to go out on the 103rd wakeup of SC and RTS 50 has 8 commands to go + out on the 102nd wakeup, all 8 commands from RTS 50 will be executed before RTS 1 + executes its command. However, if the 8 commands from RTS 50 are scheduled to + go out on the 103rd wakeup, then the command from RTS 1 will be sent first, followed + by 7 commands from RTS 50. On the 104th wakeup, the 8th command from RTS 50 will be sent.

RTP Error Handling

@@ -305,7 +305,7 @@ \page cfsscdg CFS Stored Command Deployment Guide While the SC application does not require a great deal of work for platform - deployment, the following are some general guidlines. + deployment, the following are some general guidelines. CFS Stored Command requires that two message ID's be put in the CFS Scheduler table for proper operation. Those message ID's are #SC_SEND_HK_MID, which @@ -427,18 +427,19 @@ two hours. If SC is conifured to use TAI time, and the ATS is started, and the leap seconds are changed, SC time will not be affected. - The effect of adjusting time on Relative Time Sequences is a little more - complicated. As mentioned in the Scheduling section, the next RTS command for - each sequence actually has an absolute time associated with it. With this - absolute time, it is possible for SC to know when to send out each RTS - command. From the Absolute time a delay time is computed, which is used to - tell SC how long to delay. When time is adjusted on an RTS, the command that - is currently waiting to execute gets "thrown off". Depending on the time - adjustment, the command could go out sooner or later than expected. Once the - "current" command is out, however, the remaining commands in the sequence will - execute as scheduled because they are relative to the previous command. - - The point of this discussion is that SC will not react well to time changes. + RTSs, on the other hand, use wakeup counts instead of time tags, meaning + commands are scheduled based on the number of wakeups since the previous + command. Each command in an RTS is associated with a relative wakeup count, + and this value determines when the command will execute relative to the last + executed command. For example, if a command is scheduled to execute after 2 + wakeups, the system will calculate the absolute wakeup count by adding 2 to + the current absolute wakeup count. The command will execute at that absolute + wakeup count, regardless of any adjustments to the system time. This means + that time shifts are not expected to affect the time at which the commands + are executed, since they are based on wakeup counts rather than specific + time values. + + Despite this, time adjustments can introduce risks or unintended behaviors. It is recommended that SC be idle during large time adjustments (1 second or greater). Small adjustments can be tolerated if there is not an exact second tolerance for every command being executed. @@ -449,9 +450,9 @@ sequences. The time tags for both ATS commands and RTS commands have one second resolution. However, there is a way to send multiple commands in one second. For ATS commands, set the time tags to the same second. For RTS - commands, set the delays to zero. As noted earlier, SC will send out the - commands as fast as possible up to a certain number of commands per second. - With this in mind, it is possible to pack the ATSs and a few RTSs with + commands, set the relative wakeup counts to zero. As noted earlier, SC will + send out the commands as fast as possible up to a certain number of commands + per second. With this in mind, it is possible to pack the ATSs and a few RTSs with commands that want to go out in the same second. When all of these sequences are run, SC will get behind in sending out the commands. SC will keep going until all of the commands are executed, but do not expect "to the second" diff --git a/fsw/src/sc_app.c b/fsw/src/sc_app.c index 32768a6..9fabce0 100644 --- a/fsw/src/sc_app.c +++ b/fsw/src/sc_app.c @@ -160,7 +160,7 @@ CFE_Status_t SC_AppInit(void) /* SAD: SC_Process_ATP is 0, within the valid index range of NextCmdTime array, which has 2 elements */ SC_AppData.NextCmdTime[SC_Process_ATP] = SC_MAX_TIME; /* SAD: SC_Process_RTP is 1, within the valid index range of NextCmdTime array, which has 2 elements */ - SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_TIME; + SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_WAKEUP_CNT; /* Initialize the SC housekeeping packet */ CFE_MSG_Init(CFE_MSG_PTR(SC_OperData.HkPacket.TelemetryHeader), CFE_SB_ValueToMsgId(SC_HK_TLM_MID), @@ -287,7 +287,7 @@ CFE_Status_t SC_InitTables(void) { RtsInfoPtr = SC_GetRtsInfoObject(SC_RTS_IDX_C(i)); - RtsInfoPtr->NextCommandTime = SC_MAX_TIME; + RtsInfoPtr->NextCommandTgtWakeup = SC_MAX_WAKEUP_CNT; RtsInfoPtr->NextCommandPtr = SC_ENTRY_OFFSET_FIRST; RtsInfoPtr->RtsStatus = SC_Status_EMPTY; RtsInfoPtr->DisabledFlag = true; diff --git a/fsw/src/sc_app.h b/fsw/src/sc_app.h index 3e54bf3..f4fc3fa 100644 --- a/fsw/src/sc_app.h +++ b/fsw/src/sc_app.h @@ -89,13 +89,13 @@ typedef struct */ typedef struct { - SC_Status_Enum_t RtsStatus; /**< \brief status of the RTS */ - bool DisabledFlag; /**< \brief disabled/enabled flag */ - uint8 CmdCtr; /**< \brief Cmds executed in current rts */ - uint8 CmdErrCtr; /**< \brief errs in current RTS */ - SC_AbsTimeTag_t NextCommandTime; /**< \brief next command time for RTS */ - SC_EntryOffset_t NextCommandPtr; /**< \brief where next rts cmd is */ - uint16 UseCtr; /**< \brief how many times RTS is run */ + SC_Status_Enum_t RtsStatus; /**< \brief status of the RTS */ + bool DisabledFlag; /**< \brief disabled/enabled flag */ + uint8 CmdCtr; /**< \brief Cmds executed in current rts */ + uint8 CmdErrCtr; /**< \brief errs in current RTS */ + uint32 NextCommandTgtWakeup; /**< \brief target wakeup count for next RTS command */ + SC_EntryOffset_t NextCommandPtr; /**< \brief where next rts cmd is */ + uint16 UseCtr; /**< \brief how many times RTS is run */ } SC_RtsInfoEntry_t; /** @@ -368,11 +368,12 @@ typedef struct bool EnableHeaderUpdate; /**< \brief whether to update headers in outgoing messages */ - SC_Process_Enum_t NextProcNumber; /**< \brief the next command processor number */ - SC_AbsTimeTag_t NextCmdTime[2]; /**< \brief The overall next command time 0 - ATP, 1- RTP*/ - SC_AbsTimeTag_t CurrentTime; /**< \brief this is the current time for SC */ - SC_RtsNum_t AutoStartRTS; /**< \brief Start selected auto-exec RTS after init */ - uint16 AppendWordCount; /**< \brief Size of cmd entries in current Append ATS table */ + SC_Process_Enum_t NextProcNumber; /**< \brief the next command processor number */ + uint32 NextCmdTime[2]; /**< \brief The overall next command time for ATP (0) and command wakeup count for RTP (1) */ + SC_AbsTimeTag_t CurrentTime; /**< \brief this is the current time for SC */ + uint32 CurrentWakeupCount; /**< \brief this is the current wakeup count for SC */ + SC_RtsNum_t AutoStartRTS; /**< \brief Start selected auto-exec RTS after init */ + uint16 AppendWordCount; /**< \brief Size of cmd entries in current Append ATS table */ } SC_AppData_t; /************************************************************************ diff --git a/fsw/src/sc_cmds.c b/fsw/src/sc_cmds.c index 570c5b6..195e7da 100644 --- a/fsw/src/sc_cmds.c +++ b/fsw/src/sc_cmds.c @@ -298,7 +298,7 @@ void SC_ProcessRtpCommand(void) /* ** The following conditions must be met before a RTS command is executed: - ** 1.) The next command time must be <= the current time + ** 1.) The next command wakeup count must be <= the current wakeup count ** 2.) The next processor number must be SC_Process_RTP ** 3.) The RTS number in the RTP control block must be valid and ** 4.) the RTS must be EXECUTING @@ -312,8 +312,8 @@ void SC_ProcessRtpCommand(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); - if ((SC_AppData.NextCmdTime[SC_AppData.NextProcNumber] <= SC_AppData.CurrentTime) && - (SC_AppData.NextProcNumber == SC_Process_RTP) && (RtsInfoPtr->RtsStatus == SC_Status_EXECUTING)) + if ((SC_AppData.NextProcNumber == SC_Process_RTP) && + (SC_AppData.NextCmdTime[SC_Process_RTP] <= SC_AppData.CurrentWakeupCount) && (RtsInfoPtr->RtsStatus == SC_Status_EXECUTING)) { /* ** Count the command for the rate limiter @@ -443,9 +443,9 @@ void SC_SendHkPacket(void) ** Fill out the RTP control block information */ - SC_OperData.HkPacket.Payload.NumRtsActive = SC_OperData.RtsCtrlBlckAddr->NumRtsActive; - SC_OperData.HkPacket.Payload.RtsNum = SC_OperData.RtsCtrlBlckAddr->CurrRtsNum; - SC_OperData.HkPacket.Payload.NextRtsTime = SC_AppData.NextCmdTime[SC_Process_RTP]; + SC_OperData.HkPacket.Payload.NumRtsActive = SC_OperData.RtsCtrlBlckAddr->NumRtsActive; + SC_OperData.HkPacket.Payload.RtsNum = SC_OperData.RtsCtrlBlckAddr->CurrRtsNum; + SC_OperData.HkPacket.Payload.NextRtsWakeupCnt = SC_AppData.NextCmdTime[SC_Process_RTP]; /* ** Fill out the RTS status bit mask @@ -538,6 +538,7 @@ void SC_ResetCountersCmd(const SC_ResetCountersCmd_t *Cmd) void SC_OneHzWakeupCmd(const SC_OneHzWakeupCmd_t *Cmd) { bool IsThereAnotherCommandToExecute = false; + SC_AppData.CurrentWakeupCount++; /* * Time to execute a command in the SC memory @@ -565,8 +566,10 @@ void SC_OneHzWakeupCmd(const SC_OneHzWakeupCmd_t *Cmd) } SC_UpdateNextTime(); + if ((SC_AppData.NextProcNumber == SC_Process_NONE) || - (SC_AppData.NextCmdTime[SC_AppData.NextProcNumber] > SC_AppData.CurrentTime)) + ((SC_AppData.NextProcNumber == SC_Process_ATP) && (SC_AppData.NextCmdTime[SC_Process_ATP] > SC_AppData.CurrentTime)) || + ((SC_AppData.NextProcNumber == SC_Process_RTP) && (SC_AppData.NextCmdTime[SC_Process_RTP] > SC_AppData.CurrentWakeupCount))) { SC_OperData.NumCmdsSec = 0; IsThereAnotherCommandToExecute = false; diff --git a/fsw/src/sc_loads.c b/fsw/src/sc_loads.c index 0cb629e..e779fec 100644 --- a/fsw/src/sc_loads.c +++ b/fsw/src/sc_loads.c @@ -377,12 +377,12 @@ void SC_LoadRts(SC_RtsIndex_t RtsIndex) /* Clear out the RTS info table */ RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); - RtsInfoPtr->RtsStatus = SC_Status_LOADED; - RtsInfoPtr->UseCtr = 0; - RtsInfoPtr->CmdCtr = 0; - RtsInfoPtr->CmdErrCtr = 0; - RtsInfoPtr->NextCommandTime = 0; - RtsInfoPtr->NextCommandPtr = SC_ENTRY_OFFSET_FIRST; + RtsInfoPtr->RtsStatus = SC_Status_LOADED; + RtsInfoPtr->UseCtr = 0; + RtsInfoPtr->CmdCtr = 0; + RtsInfoPtr->CmdErrCtr = 0; + RtsInfoPtr->NextCommandTgtWakeup = 0; + RtsInfoPtr->NextCommandPtr = SC_ENTRY_OFFSET_FIRST; /* Make sure the RTS is disabled */ RtsInfoPtr->DisabledFlag = true; @@ -449,7 +449,7 @@ bool SC_ParseRts(uint32 Buffer32[]) if (!CFE_SB_IsValidMsgId(MessageID)) { - if (EntryPtr->Header.TimeTag == 0) + if (EntryPtr->Header.WakeupCount == 0) { Done = true; /* assumed end of file */ } diff --git a/fsw/src/sc_rtsrq.c b/fsw/src/sc_rtsrq.c index 1f3bcbc..0f9169f 100644 --- a/fsw/src/sc_rtsrq.c +++ b/fsw/src/sc_rtsrq.c @@ -95,10 +95,10 @@ void SC_StartRtsCmd(const SC_StartRtsCmd_t *Cmd) RtsInfoPtr->UseCtr++; /* - ** Get the absolute time for the RTSs next_cmd_time - ** using the current time and the relative time tag. + ** Get the absolute wakeup count for the RTS's next_command_tgt_wakeup + ** using the current wakeup count and the relative wakeup count. */ - RtsInfoPtr->NextCommandTime = SC_ComputeAbsTime(RtsEntryPtr->TimeTag); + RtsInfoPtr->NextCommandTgtWakeup = SC_ComputeAbsWakeup(RtsEntryPtr->WakeupCount); /* ** Last, Increment some global counters associated with the @@ -203,9 +203,9 @@ void SC_StartRtsGrpCmd(const SC_StartRtsGrpCmd_t *Cmd) RtsInfoPtr->NextCommandPtr = SC_ENTRY_OFFSET_FIRST; RtsInfoPtr->UseCtr++; - /* get absolute time for 1st cmd in the RTS */ - RtsInfoPtr->NextCommandTime = - SC_ComputeAbsTime(SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST)->Header.TimeTag); + /* get absolute wakeup count for 1st cmd in the RTS */ + RtsInfoPtr->NextCommandTgtWakeup = + SC_ComputeAbsWakeup(SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST)->Header.WakeupCount); /* maintain counters associated with starting RTS */ SC_OperData.RtsCtrlBlckAddr->NumRtsActive++; @@ -547,7 +547,7 @@ void SC_KillRts(SC_RtsIndex_t RtsIndex) ** Stop the RTS from executing */ RtsInfoPtr->RtsStatus = SC_Status_LOADED; - RtsInfoPtr->NextCommandTime = SC_MAX_TIME; + RtsInfoPtr->NextCommandTgtWakeup = SC_MAX_WAKEUP_CNT; /* ** Note: the rest of the fields are left alone diff --git a/fsw/src/sc_state.c b/fsw/src/sc_state.c index 4afd1d1..3be3311 100644 --- a/fsw/src/sc_state.c +++ b/fsw/src/sc_state.c @@ -19,9 +19,9 @@ /** * @file - * This file contains functions to handle getting the next time of - * commands for the ATP and RTP as well as updating the time for - * Stored Command. + * This file contains functions to handle getting the next time + * or wakeup count of commands for the ATP and RTP, as well as + * updating the time for Stored Command. */ /************************************************************************** @@ -52,33 +52,33 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ -/* Gets the time of the next RTS command */ +/* Gets the wakeup count of the next RTS command */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ void SC_GetNextRtsTime(void) { - int16 i; /* loop counter MUST be SIGNED !*/ - SC_RtsIndex_t NextRts; /* the next rts to schedule */ - SC_AbsTimeTag_t NextTime; /* the next time for the RTS */ + int16 i; /* loop counter MUST be SIGNED !*/ + SC_RtsIndex_t NextRts; /* the next rts to schedule */ + uint32 NextWakeupCnt; /* the next wakeup count for the RTS */ SC_RtsInfoEntry_t *RtsInfoPtr; NextRts = SC_INVALID_RTS_INDEX; - NextTime = SC_MAX_TIME; + NextWakeupCnt = SC_MAX_WAKEUP_CNT; /* ** Go through the table backwards to account for the RTS priority ** Lower number RTSs get higher priority ** Backward processing ensures selection of the lowest RTS number - ** when multiple RTSs have the same next command time + ** when multiple RTSs have the same next command wakeup count */ for (i = SC_NUMBER_OF_RTS - 1; i >= 0; i--) { RtsInfoPtr = SC_GetRtsInfoObject(SC_RTS_IDX_C(i)); if (RtsInfoPtr->RtsStatus == SC_Status_EXECUTING) { - if (RtsInfoPtr->NextCommandTime <= NextTime) + if (RtsInfoPtr->NextCommandTgtWakeup <= NextWakeupCnt) { - NextTime = RtsInfoPtr->NextCommandTime; + NextWakeupCnt = RtsInfoPtr->NextCommandTgtWakeup; NextRts = SC_RTS_IDX_C(i); } /* end if */ } /* end if */ @@ -87,12 +87,12 @@ void SC_GetNextRtsTime(void) if (!SC_RtsIndexIsValid(NextRts)) { SC_OperData.RtsCtrlBlckAddr->CurrRtsNum = SC_RTS_NUM_NULL; - SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_TIME; + SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_WAKEUP_CNT; } else { SC_OperData.RtsCtrlBlckAddr->CurrRtsNum = SC_RtsIndexToNum(NextRts); - SC_AppData.NextCmdTime[SC_Process_RTP] = NextTime; + SC_AppData.NextCmdTime[SC_Process_RTP] = NextWakeupCnt; } /* end if */ } @@ -132,10 +132,14 @@ void SC_UpdateNextTime(void) ** the RTP time is less than the ATP time. Otherwise ** the ATP has priority */ - if (SC_AppData.NextCmdTime[SC_Process_RTP] < SC_AppData.NextCmdTime[SC_Process_ATP]) - { - SC_AppData.NextProcNumber = SC_Process_RTP; - } + + /* TODO */ + // if (SC_AppData.NextCmdTime[SC_Process_RTP] < SC_AppData.NextCmdTime[SC_Process_ATP]) + // { + // SC_AppData.NextProcNumber = SC_Process_RTP; + // } + + SC_AppData.NextProcNumber = SC_Process_RTP; } /* end if */ } @@ -226,9 +230,9 @@ void SC_GetNextRtsCommand(void) { /* ** Everything passed! - ** Update the proper next command time for that RTS + ** Update the proper next command wakeup count for that RTS */ - RtsInfoPtr->NextCommandTime = SC_ComputeAbsTime(EntryPtr->Header.TimeTag); + RtsInfoPtr->NextCommandTgtWakeup = SC_ComputeAbsWakeup(EntryPtr->Header.WakeupCount); /* ** Update the appropriate RTS info table current command pointer diff --git a/fsw/src/sc_state.h b/fsw/src/sc_state.h index 8fca58d..c751cea 100644 --- a/fsw/src/sc_state.h +++ b/fsw/src/sc_state.h @@ -19,22 +19,23 @@ /** * @file - * This file contains functions to handle getting the next time of - * commands for the ATP and RTP as well as updating the time for - * Stored Command. + * This file contains functions to handle getting the next time + * or wakeup count of commands for the ATP and RTP, as well as + * updating the time for Stored Command. */ + #ifndef SC_STATE_H #define SC_STATE_H #include "cfe.h" /** - * \brief Gets the next time for an RTS command to run + * \brief Gets the next wakeup count for an RTS command to run * * \par Description * This function searches the RTS info table to find - * the next RTS that needs to run based on the time that the - * rts needs to run and it's priority. + * the next RTS that needs to run based on the wakeup + * count that the RTS needs to run and it's priority. * * \par Assumptions, External Events, and Notes: * None diff --git a/fsw/src/sc_utils.c b/fsw/src/sc_utils.c index 3b3cfdf..db9da37 100644 --- a/fsw/src/sc_utils.c +++ b/fsw/src/sc_utils.c @@ -122,6 +122,16 @@ SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime) return ResultTimeWSubs.Seconds; } +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* */ +/* Compute absolute wakeup count from relative wakeup count */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +uint32 SC_ComputeAbsWakeup(uint32 RelWakeup) +{ + return SC_AppData.CurrentWakeupCount + RelWakeup; +} + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* Compare absolute times */ diff --git a/fsw/src/sc_utils.h b/fsw/src/sc_utils.h index 00c4545..058e274 100644 --- a/fsw/src/sc_utils.h +++ b/fsw/src/sc_utils.h @@ -70,6 +70,23 @@ SC_AbsTimeTag_t SC_GetAtsEntryTime(SC_AtsEntryHeader_t *Entry); */ SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime); +/** + * \brief Computes an absolute wakeup count from a relative wakeup count + * + * \par Description + * This function computes an absolute wakeup count based on the + * current wakeup count and the relative wakeup count passed into + * the function + * + * \par Assumptions, External Events, and Notes: + * None + * + * \param [in] RelWakeup The relative wakeup count to compute from + * + * \return The absolute wakeup count + */ +uint32 SC_ComputeAbsWakeup(uint32 RelWakeup); + /** * \brief Compares absolute time * diff --git a/fsw/tables/sc_rts001.c b/fsw/tables/sc_rts001.c index ee6a8ae..984130b 100644 --- a/fsw/tables/sc_rts001.c +++ b/fsw/tables/sc_rts001.c @@ -29,9 +29,9 @@ * This source file creates a sample RTS table that contains only * the following commands that are scheduled as follows: * - * SC NOOP command, execution time relative to start of RTS = 0 - * SC Enable RTS #2 command, execution time relative to prev cmd = 5 - * SC Start RTS #2 command, execution time relative to prev cmd = 5 + * SC NOOP command, execution wakeup count relative to start of RTS = 0 + * SC Enable RTS #2 command, execution wakeup count relative to prev cmd = 5 + * SC Start RTS #2 command, execution wakeup count relative to prev cmd = 5 */ #include "cfe.h" @@ -78,17 +78,17 @@ typedef union /* Used designated initializers to be verbose, modify as needed/desired */ SC_RtsTable001_t SC_Rts001 = { /* 1 */ - .rts.hdr1.TimeTag = 0, + .rts.hdr1.WakeupCount = 0, .rts.cmd1.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd1), SC_NOOP_CC, SC_NOOP_CKSUM), /* 2 */ - .rts.hdr2.TimeTag = 5, + .rts.hdr2.WakeupCount = 5, .rts.cmd2.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd2), SC_ENABLE_RTS_CC, SC_ENABLE_RTS2_CKSUM), .rts.cmd2.Payload.RtsNum = SC_RTS_NUM_INITIALIZER(2), /* 3 */ - .rts.hdr3.TimeTag = 5, + .rts.hdr3.WakeupCount = 5, .rts.cmd3.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd3), SC_START_RTS_CC, SC_START_RTS2_CKSUM), .rts.cmd3.Payload.RtsNum = SC_RTS_NUM_INITIALIZER(2)}; diff --git a/fsw/tables/sc_rts002.c b/fsw/tables/sc_rts002.c index a246ede..b34fced 100644 --- a/fsw/tables/sc_rts002.c +++ b/fsw/tables/sc_rts002.c @@ -29,9 +29,9 @@ * This source file creates a sample RTS table that contains only * the following commands that are scheduled as follows: * - * SC NOOP command, execution time relative to start of RTS = 0 - * SC NOOP command, execution time relative to prev cmd = 5 - * SC NOOP command, execution time relative to prev cmd = 5 + * SC NOOP command, execution wakeup count relative to start of RTS = 0 + * SC NOOP command, execution wakeup count relative to prev cmd = 1 + * SC NOOP command, execution wakeup count relative to prev cmd = 1 */ #include "cfe.h" @@ -72,16 +72,17 @@ typedef union /* Used designated initializers to be verbose, modify as needed/desired */ SC_RtsTable002_t SC_Rts002 = { /* 1 */ - .rts.hdr1.TimeTag = 0, + .rts.hdr1.WakeupCount = 0, .rts.cmd1.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd1), SC_NOOP_CC, SC_NOOP_CKSUM), /* 2 */ - .rts.hdr2.TimeTag = 5, - .rts.cmd2.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd1), SC_NOOP_CC, SC_NOOP_CKSUM), + .rts.hdr2.WakeupCount = 5, + .rts.cmd2.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd2), SC_NOOP_CC, SC_NOOP_CKSUM), /* 3 */ - .rts.hdr3.TimeTag = 5, - .rts.cmd3.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd1), SC_NOOP_CC, SC_NOOP_CKSUM)}; + .rts.hdr3.WakeupCount = 5, + .rts.cmd3.CommandHeader = CFE_MSG_CMD_HDR_INIT(SC_CMD_MID, SC_MEMBER_SIZE(cmd3), SC_NOOP_CC, SC_NOOP_CKSUM) + }; /* Macro for table structure */ CFE_TBL_FILEDEF(SC_Rts002, SC.RTS_TBL002, SC Example RTS_TBL002, sc_rts002.tbl) diff --git a/unit-test/sc_app_tests.c b/unit-test/sc_app_tests.c index 0bb3a40..3fa7041 100644 --- a/unit-test/sc_app_tests.c +++ b/unit-test/sc_app_tests.c @@ -148,7 +148,7 @@ void SC_AppInit_Test_NominalPowerOnReset(void) Expected_SC_AppData.NextProcNumber = SC_Process_NONE; Expected_SC_AppData.NextCmdTime[SC_Process_ATP] = SC_MAX_TIME; - Expected_SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_TIME; + Expected_SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_WAKEUP_CNT; Expected_SC_AppData.AutoStartRTS = SC_RTS_NUM_C(RTS_ID_AUTO_POWER_ON); UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &TestMsgId, sizeof(TestMsgId), false); @@ -212,7 +212,7 @@ void SC_AppInit_Test_Nominal(void) Expected_SC_AppData.NextProcNumber = SC_Process_NONE; Expected_SC_AppData.NextCmdTime[SC_Process_ATP] = SC_MAX_TIME; - Expected_SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_TIME; + Expected_SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_WAKEUP_CNT; Expected_SC_AppData.AutoStartRTS = SC_RTS_NUM_C(RTS_ID_AUTO_PROCESSOR); Expected_SC_OperData.HkPacket.Payload.ContinueAtsOnFailureFlag = SC_AtsCont_TRUE; diff --git a/unit-test/sc_atsrq_tests.c b/unit-test/sc_atsrq_tests.c index 569dfc5..210ba29 100644 --- a/unit-test/sc_atsrq_tests.c +++ b/unit-test/sc_atsrq_tests.c @@ -824,7 +824,7 @@ void SC_JumpAtsCmd_Test_SkipOneCmd(void) SC_Assert_ID_EQ(SC_OperData.AtsCtrlBlckAddr->CmdNumber, SC_GetAtsCommandNumAtSeq(AtsIndex, SC_SEQUENCE_IDX_C(1))->CmdNum); SC_Assert_IDX_VALUE(SC_OperData.AtsCtrlBlckAddr->TimeIndexPtr, 1); - UtAssert_True(SC_AppData.NextCmdTime[0] == 0, "SC_AppData.NextCmdTime[0] == 0"); + UtAssert_True(SC_AppData.NextCmdTime[SC_Process_ATP] == 0, "SC_AppData.NextCmdTime[SC_Process_ATP] == 0"); UtAssert_True(SC_OperData.HkPacket.Payload.CmdCtr == 1, "SC_OperData.HkPacket.Payload.CmdCtr == 1"); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, SC_JUMP_ATS_INF_EID); @@ -928,7 +928,7 @@ void SC_JumpAtsCmd_Test_AtsNotLoaded(void) SC_Assert_ID_EQ(SC_OperData.AtsCtrlBlckAddr->CmdNumber, SC_GetAtsCommandNumAtSeq(AtsIndex, SC_SEQUENCE_IDX_C(1))->CmdNum); SC_Assert_IDX_VALUE(SC_OperData.AtsCtrlBlckAddr->TimeIndexPtr, 1); - UtAssert_True(SC_AppData.NextCmdTime[0] == 0, "SC_AppData.NextCmdTime[0] == 0"); + UtAssert_True(SC_AppData.NextCmdTime[SC_Process_ATP] == 0, "SC_AppData.NextCmdTime[SC_Process_ATP] == 0"); UtAssert_True(SC_OperData.HkPacket.Payload.CmdCtr == 1, "SC_OperData.HkPacket.Payload.CmdCtr == 1"); UtAssert_INT32_EQ(context_CFE_EVS_SendEvent[1].EventID, SC_JUMP_ATS_INF_EID); diff --git a/unit-test/sc_cmds_tests.c b/unit-test/sc_cmds_tests.c index 0800fff..041f2e9 100644 --- a/unit-test/sc_cmds_tests.c +++ b/unit-test/sc_cmds_tests.c @@ -936,8 +936,8 @@ void SC_SendHkPacket_Test(void) SC_OperData.AtsCtrlBlckAddr->AtpState = (SC_Status_Enum_t)18; SC_OperData.AtsCtrlBlckAddr->CmdNumber = SC_COMMAND_NUM_C(19); SC_OperData.AtsCtrlBlckAddr->SwitchPendFlag = 0; - SC_AppData.NextCmdTime[0] = 0; - SC_AppData.NextCmdTime[1] = 0; + SC_AppData.NextCmdTime[SC_Process_ATP] = 0; + SC_AppData.NextCmdTime[SC_Process_RTP] = 0; SC_OperData.RtsCtrlBlckAddr->NumRtsActive = 20; SC_OperData.RtsCtrlBlckAddr->CurrRtsNum = SC_RTS_NUM_C(21); SC_OperData.HkPacket.Payload.ContinueAtsOnFailureFlag = SC_AtsCont_TRUE; @@ -1001,7 +1001,7 @@ void SC_SendHkPacket_Test(void) UtAssert_True(SC_OperData.HkPacket.Payload.NextAtsTime == 0, "SC_OperData.HkPacket.Payload.NextAtsTime == 0"); UtAssert_True(SC_OperData.HkPacket.Payload.NumRtsActive == 20, "SC_OperData.HkPacket.Payload.NumRtsActive == 20"); SC_Assert_ID_VALUE(SC_OperData.HkPacket.Payload.RtsNum, 21); - UtAssert_True(SC_OperData.HkPacket.Payload.NextRtsTime == 0, "SC_OperData.HkPacket.Payload.NextRtsTime == 0"); + UtAssert_True(SC_OperData.HkPacket.Payload.NextRtsWakeupCnt == 0, "SC_OperData.HkPacket.Payload.NextRtsWakeupCnt == 0"); UtAssert_BOOL_TRUE(SC_OperData.HkPacket.Payload.ContinueAtsOnFailureFlag); /* Check first element */ diff --git a/unit-test/sc_loads_tests.c b/unit-test/sc_loads_tests.c index c6c75f6..81f8974 100644 --- a/unit-test/sc_loads_tests.c +++ b/unit-test/sc_loads_tests.c @@ -130,13 +130,13 @@ SC_AtsEntryHeader_t *UT_SC_AppendSingleAtsEntry(void **TailPtr, uint16 CmdNumber return Entry; } -SC_RtsEntryHeader_t *UT_SC_AppendSingleRtsEntry(void **TailPtr, SC_RelTimeTag_t TimeTag, size_t MsgSize) +SC_RtsEntryHeader_t *UT_SC_AppendSingleRtsEntry(void **TailPtr, SC_RelWakeupCount_t WakeupCount, size_t MsgSize) { SC_RtsEntryHeader_t *Entry = (SC_RtsEntryHeader_t *)(*TailPtr); UT_SC_AdvanceTailPtr(TailPtr, SC_RTS_HEADER_SIZE, MsgSize); - Entry->TimeTag = TimeTag; + Entry->WakeupCount = WakeupCount; return Entry; } @@ -150,7 +150,7 @@ SC_AtsEntryHeader_t *UT_SC_SetupSingleAtsEntry(SC_AtsIndex_t AtsIndex, uint16 Cm return UT_SC_AppendSingleAtsEntry(&TailPtr, CmdNumber, MsgSize); } -SC_RtsEntryHeader_t *UT_SC_SetupSingleRtsEntry(SC_RtsIndex_t RtsIndex, CFE_SB_MsgId_t MsgId, SC_RelTimeTag_t TimeTag, +SC_RtsEntryHeader_t *UT_SC_SetupSingleRtsEntry(SC_RtsIndex_t RtsIndex, CFE_SB_MsgId_t MsgId, SC_RelWakeupCount_t WakeupCount, size_t MsgSize) { void *TailPtr; @@ -158,7 +158,7 @@ SC_RtsEntryHeader_t *UT_SC_SetupSingleRtsEntry(SC_RtsIndex_t RtsIndex, CFE_SB_Ms UT_SC_SetMsgId(MsgId); TailPtr = UT_SC_GetRtsTable(RtsIndex); - return UT_SC_AppendSingleRtsEntry(&TailPtr, TimeTag, MsgSize); + return UT_SC_AppendSingleRtsEntry(&TailPtr, WakeupCount, MsgSize); } uint32 UT_SC_GetEntryWordCount(size_t HdrSize, size_t MsgSize) @@ -259,7 +259,7 @@ void UT_SC_RtsEntryInit(void *EntryPtr, size_t Idx, size_t MsgSize) { SC_RtsEntryHeader_t *Entry = EntryPtr; - Entry->TimeTag = 1; + Entry->WakeupCount = 1; } SC_RtsEntryHeader_t *UT_SC_SetupRtsTable(SC_RtsIndex_t RtsIndex, CFE_SB_MsgId_t MsgId, size_t MsgSize, diff --git a/unit-test/sc_rtsrq_tests.c b/unit-test/sc_rtsrq_tests.c index 0a01362..ca49b5a 100644 --- a/unit-test/sc_rtsrq_tests.c +++ b/unit-test/sc_rtsrq_tests.c @@ -53,7 +53,7 @@ void SC_StartRtsCmd_Test_Nominal(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; UT_CmdBuf.StartRtsCmd.Payload.RtsNum = SC_RtsIndexToNum(RtsIndex); @@ -97,7 +97,7 @@ void SC_StartRtsCmd_Test_StartRtsNoEvents(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; RtsInfoPtr->DisabledFlag = false; RtsInfoPtr->RtsStatus = SC_Status_LOADED; @@ -146,7 +146,7 @@ void SC_StartRtsCmd_Test_InvalidCommandLength1(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; UT_CmdBuf.StartRtsCmd.Payload.RtsNum = SC_RtsIndexToNum(RtsIndex); @@ -177,7 +177,7 @@ void SC_StartRtsCmd_Test_InvalidCommandLength2(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; UT_CmdBuf.StartRtsCmd.Payload.RtsNum = SC_RtsIndexToNum(RtsIndex); @@ -207,7 +207,7 @@ void SC_StartRtsCmd_Test_RtsNotLoadedOrInUse(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; UT_CmdBuf.StartRtsCmd.Payload.RtsNum = SC_RtsIndexToNum(RtsIndex); @@ -231,7 +231,7 @@ void SC_StartRtsCmd_Test_RtsDisabled(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); Entry = (SC_RtsEntryHeader_t *)SC_GetRtsEntryAtOffset(RtsIndex, SC_ENTRY_OFFSET_FIRST); - Entry->TimeTag = 0; + Entry->WakeupCount = 0; UT_CmdBuf.StartRtsCmd.Payload.RtsNum = SC_RtsIndexToNum(RtsIndex); @@ -988,7 +988,7 @@ void SC_KillRts_Test(void) /* Verify results */ UtAssert_True(RtsInfoPtr->RtsStatus == SC_Status_LOADED, "RtsInfoPtr->RtsStatus == SC_Status_LOADED"); - UtAssert_True(RtsInfoPtr->NextCommandTime == SC_MAX_TIME, "RtsInfoPtr->NextCommandTime == SC_MAX_TIME"); + UtAssert_True(RtsInfoPtr->NextCommandTgtWakeup == SC_MAX_WAKEUP_CNT, "RtsInfoPtr->NextCommandTgtWakeup == SC_MAX_WAKEUP_CNT"); UtAssert_True(SC_OperData.RtsCtrlBlckAddr->NumRtsActive == 0, "SC_OperData.RtsCtrlBlckAddr->NumRtsActive == 0"); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); @@ -1009,7 +1009,7 @@ void SC_KillRts_Test_NoActiveRts(void) /* Verify results */ UtAssert_True(RtsInfoPtr->RtsStatus == SC_Status_LOADED, "RtsInfoPtr->RtsStatus == SC_Status_LOADED"); - UtAssert_True(RtsInfoPtr->NextCommandTime == SC_MAX_TIME, "RtsInfoPtr->NextCommandTime == SC_MAX_TIME"); + UtAssert_True(RtsInfoPtr->NextCommandTgtWakeup == SC_MAX_WAKEUP_CNT, "RtsInfoPtr->NextCommandTgtWakeup == SC_MAX_WAKEUP_CNT"); UtAssert_True(SC_OperData.RtsCtrlBlckAddr->NumRtsActive == 0, "SC_OperData.RtsCtrlBlckAddr->NumRtsActive == 0"); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); diff --git a/unit-test/sc_state_tests.c b/unit-test/sc_state_tests.c index 440ebab..56b994c 100644 --- a/unit-test/sc_state_tests.c +++ b/unit-test/sc_state_tests.c @@ -62,14 +62,14 @@ void SC_GetNextRtsTime_Test_Nominal(void) RtsInfoPtr = SC_GetRtsInfoObject(RtsIndex); RtsInfoPtr->RtsStatus = SC_Status_EXECUTING; - RtsInfoPtr->NextCommandTime = SC_MAX_TIME; + RtsInfoPtr->NextCommandTgtWakeup = SC_MAX_WAKEUP_CNT; /* Execute the function being tested */ UtAssert_VOIDCALL(SC_GetNextRtsTime()); /* Verify results */ SC_Assert_ID_VALUE(SC_OperData.RtsCtrlBlckAddr->CurrRtsNum, 1); - UtAssert_True(SC_AppData.NextCmdTime[1] == SC_MAX_TIME, "SC_AppData.NextCmdTime[1] == SC_MAX_TIME"); + UtAssert_True(SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT, "SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT"); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); } @@ -91,8 +91,8 @@ void SC_GetNextRtsTime_Test_InvalidRtsNum(void) /* Verify results */ SC_Assert_ID_EQ(SC_OperData.RtsCtrlBlckAddr->CurrRtsNum, SC_RTS_NUM_NULL); - UtAssert_True(SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_TIME, - "SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_TIME"); + UtAssert_True(SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT, + "SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT"); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); } @@ -106,17 +106,17 @@ void SC_GetNextRtsTime_Test_RtsPriority(void) RtsInfoPtr1 = SC_GetRtsInfoObject(SC_RTS_IDX_C(1)); RtsInfoPtr0->RtsStatus = SC_Status_EXECUTING; - RtsInfoPtr0->NextCommandTime = SC_MAX_TIME; + RtsInfoPtr0->NextCommandTgtWakeup = SC_MAX_WAKEUP_CNT; RtsInfoPtr1->RtsStatus = SC_Status_EXECUTING; - RtsInfoPtr1->NextCommandTime = SC_MAX_TIME - 1; + RtsInfoPtr1->NextCommandTgtWakeup = SC_MAX_WAKEUP_CNT - 1; /* Execute the function being tested */ UtAssert_VOIDCALL(SC_GetNextRtsTime()); /* Verify results */ SC_Assert_ID_VALUE(SC_OperData.RtsCtrlBlckAddr->CurrRtsNum, 2); - UtAssert_True(SC_AppData.NextCmdTime[1] == SC_MAX_TIME - 1, "SC_AppData.NextCmdTime[1] == SC_MAX_TIME - 1"); + UtAssert_True(SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT - 1, "SC_AppData.NextCmdTime[SC_Process_RTP] == SC_MAX_WAKEUP_CNT - 1"); UtAssert_STUB_COUNT(CFE_EVS_SendEvent, 0); } @@ -162,7 +162,7 @@ void SC_UpdateNextTime_Test_Rtp(void) SC_AppData.NextCmdTime[SC_Process_ATP] = 10; RtsInfoPtr->RtsStatus = SC_Status_EXECUTING; - RtsInfoPtr->NextCommandTime = 1; + RtsInfoPtr->NextCommandTgtWakeup = 1; /* Execute the function being tested */ UtAssert_VOIDCALL(SC_UpdateNextTime()); @@ -185,7 +185,7 @@ void SC_UpdateNextTime_Test_RtpAtpPriority(void) SC_AppData.NextCmdTime[SC_Process_ATP] = 0; RtsInfoPtr->RtsStatus = SC_Status_EXECUTING; - RtsInfoPtr->NextCommandTime = 1; + RtsInfoPtr->NextCommandTgtWakeup = 1; /* Execute the function being tested */ UtAssert_VOIDCALL(SC_UpdateNextTime()); diff --git a/unit-test/stubs/sc_app_stubs.c b/unit-test/stubs/sc_app_stubs.c index ba62bd9..e6d99e9 100644 --- a/unit-test/stubs/sc_app_stubs.c +++ b/unit-test/stubs/sc_app_stubs.c @@ -31,13 +31,12 @@ * Generated stub function for SC_AppInit() * ---------------------------------------------------- */ -CFE_Status_t SC_AppInit(void) -{ - UT_GenStub_SetupReturnBuffer(SC_AppInit, CFE_Status_t); +CFE_Status_t SC_AppInit(void) { + UT_GenStub_SetupReturnBuffer(SC_AppInit, CFE_Status_t); - UT_GenStub_Execute(SC_AppInit, Basic, NULL); + UT_GenStub_Execute(SC_AppInit, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_AppInit, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_AppInit, CFE_Status_t); } /* @@ -45,24 +44,19 @@ CFE_Status_t SC_AppInit(void) * Generated stub function for SC_AppMain() * ---------------------------------------------------- */ -void SC_AppMain(void) -{ - - UT_GenStub_Execute(SC_AppMain, Basic, NULL); -} +void SC_AppMain(void) { UT_GenStub_Execute(SC_AppMain, Basic, NULL); } /* * ---------------------------------------------------- * Generated stub function for SC_GetDumpTablePointers() * ---------------------------------------------------- */ -CFE_Status_t SC_GetDumpTablePointers(void) -{ - UT_GenStub_SetupReturnBuffer(SC_GetDumpTablePointers, CFE_Status_t); +CFE_Status_t SC_GetDumpTablePointers(void) { + UT_GenStub_SetupReturnBuffer(SC_GetDumpTablePointers, CFE_Status_t); - UT_GenStub_Execute(SC_GetDumpTablePointers, Basic, NULL); + UT_GenStub_Execute(SC_GetDumpTablePointers, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_GetDumpTablePointers, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_GetDumpTablePointers, CFE_Status_t); } /* @@ -70,13 +64,12 @@ CFE_Status_t SC_GetDumpTablePointers(void) * Generated stub function for SC_GetLoadTablePointers() * ---------------------------------------------------- */ -CFE_Status_t SC_GetLoadTablePointers(void) -{ - UT_GenStub_SetupReturnBuffer(SC_GetLoadTablePointers, CFE_Status_t); +CFE_Status_t SC_GetLoadTablePointers(void) { + UT_GenStub_SetupReturnBuffer(SC_GetLoadTablePointers, CFE_Status_t); - UT_GenStub_Execute(SC_GetLoadTablePointers, Basic, NULL); + UT_GenStub_Execute(SC_GetLoadTablePointers, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_GetLoadTablePointers, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_GetLoadTablePointers, CFE_Status_t); } /* @@ -84,13 +77,12 @@ CFE_Status_t SC_GetLoadTablePointers(void) * Generated stub function for SC_InitTables() * ---------------------------------------------------- */ -CFE_Status_t SC_InitTables(void) -{ - UT_GenStub_SetupReturnBuffer(SC_InitTables, CFE_Status_t); +CFE_Status_t SC_InitTables(void) { + UT_GenStub_SetupReturnBuffer(SC_InitTables, CFE_Status_t); - UT_GenStub_Execute(SC_InitTables, Basic, NULL); + UT_GenStub_Execute(SC_InitTables, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_InitTables, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_InitTables, CFE_Status_t); } /* @@ -98,10 +90,9 @@ CFE_Status_t SC_InitTables(void) * Generated stub function for SC_LoadDefaultTables() * ---------------------------------------------------- */ -void SC_LoadDefaultTables(void) -{ +void SC_LoadDefaultTables(void) { - UT_GenStub_Execute(SC_LoadDefaultTables, Basic, NULL); + UT_GenStub_Execute(SC_LoadDefaultTables, Basic, NULL); } /* @@ -109,13 +100,12 @@ void SC_LoadDefaultTables(void) * Generated stub function for SC_RegisterAllTables() * ---------------------------------------------------- */ -CFE_Status_t SC_RegisterAllTables(void) -{ - UT_GenStub_SetupReturnBuffer(SC_RegisterAllTables, CFE_Status_t); +CFE_Status_t SC_RegisterAllTables(void) { + UT_GenStub_SetupReturnBuffer(SC_RegisterAllTables, CFE_Status_t); - UT_GenStub_Execute(SC_RegisterAllTables, Basic, NULL); + UT_GenStub_Execute(SC_RegisterAllTables, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_RegisterAllTables, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_RegisterAllTables, CFE_Status_t); } /* @@ -123,13 +113,12 @@ CFE_Status_t SC_RegisterAllTables(void) * Generated stub function for SC_RegisterDumpOnlyTables() * ---------------------------------------------------- */ -CFE_Status_t SC_RegisterDumpOnlyTables(void) -{ - UT_GenStub_SetupReturnBuffer(SC_RegisterDumpOnlyTables, CFE_Status_t); +CFE_Status_t SC_RegisterDumpOnlyTables(void) { + UT_GenStub_SetupReturnBuffer(SC_RegisterDumpOnlyTables, CFE_Status_t); - UT_GenStub_Execute(SC_RegisterDumpOnlyTables, Basic, NULL); + UT_GenStub_Execute(SC_RegisterDumpOnlyTables, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_RegisterDumpOnlyTables, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_RegisterDumpOnlyTables, CFE_Status_t); } /* @@ -137,13 +126,12 @@ CFE_Status_t SC_RegisterDumpOnlyTables(void) * Generated stub function for SC_RegisterLoadableTables() * ---------------------------------------------------- */ -CFE_Status_t SC_RegisterLoadableTables(void) -{ - UT_GenStub_SetupReturnBuffer(SC_RegisterLoadableTables, CFE_Status_t); +CFE_Status_t SC_RegisterLoadableTables(void) { + UT_GenStub_SetupReturnBuffer(SC_RegisterLoadableTables, CFE_Status_t); - UT_GenStub_Execute(SC_RegisterLoadableTables, Basic, NULL); + UT_GenStub_Execute(SC_RegisterLoadableTables, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_RegisterLoadableTables, CFE_Status_t); + return UT_GenStub_GetReturnValue(SC_RegisterLoadableTables, CFE_Status_t); } /* @@ -151,8 +139,7 @@ CFE_Status_t SC_RegisterLoadableTables(void) * Generated stub function for SC_RegisterManageCmds() * ---------------------------------------------------- */ -void SC_RegisterManageCmds(void) -{ +void SC_RegisterManageCmds(void) { - UT_GenStub_Execute(SC_RegisterManageCmds, Basic, NULL); + UT_GenStub_Execute(SC_RegisterManageCmds, Basic, NULL); } diff --git a/unit-test/stubs/sc_atsrq_stubs.c b/unit-test/stubs/sc_atsrq_stubs.c index f687d03..f2ba6bc 100644 --- a/unit-test/stubs/sc_atsrq_stubs.c +++ b/unit-test/stubs/sc_atsrq_stubs.c @@ -31,11 +31,10 @@ * Generated stub function for SC_AppendAtsCmd() * ---------------------------------------------------- */ -void SC_AppendAtsCmd(const SC_AppendAtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_AppendAtsCmd, const SC_AppendAtsCmd_t *, Cmd); +void SC_AppendAtsCmd(const SC_AppendAtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_AppendAtsCmd, const SC_AppendAtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_AppendAtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_AppendAtsCmd, Basic, NULL); } /* @@ -43,16 +42,15 @@ void SC_AppendAtsCmd(const SC_AppendAtsCmd_t *Cmd) * Generated stub function for SC_BeginAts() * ---------------------------------------------------- */ -bool SC_BeginAts(SC_AtsIndex_t AtsIndex, uint16 TimeOffset) -{ - UT_GenStub_SetupReturnBuffer(SC_BeginAts, bool); +bool SC_BeginAts(SC_AtsIndex_t AtsIndex, uint16 TimeOffset) { + UT_GenStub_SetupReturnBuffer(SC_BeginAts, bool); - UT_GenStub_AddParam(SC_BeginAts, SC_AtsIndex_t, AtsIndex); - UT_GenStub_AddParam(SC_BeginAts, uint16, TimeOffset); + UT_GenStub_AddParam(SC_BeginAts, SC_AtsIndex_t, AtsIndex); + UT_GenStub_AddParam(SC_BeginAts, uint16, TimeOffset); - UT_GenStub_Execute(SC_BeginAts, Basic, NULL); + UT_GenStub_Execute(SC_BeginAts, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_BeginAts, bool); + return UT_GenStub_GetReturnValue(SC_BeginAts, bool); } /* @@ -60,11 +58,11 @@ bool SC_BeginAts(SC_AtsIndex_t AtsIndex, uint16 TimeOffset) * Generated stub function for SC_ContinueAtsOnFailureCmd() * ---------------------------------------------------- */ -void SC_ContinueAtsOnFailureCmd(const SC_ContinueAtsOnFailureCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_ContinueAtsOnFailureCmd, const SC_ContinueAtsOnFailureCmd_t *, Cmd); +void SC_ContinueAtsOnFailureCmd(const SC_ContinueAtsOnFailureCmd_t *Cmd) { + UT_GenStub_AddParam(SC_ContinueAtsOnFailureCmd, + const SC_ContinueAtsOnFailureCmd_t *, Cmd); - UT_GenStub_Execute(SC_ContinueAtsOnFailureCmd, Basic, NULL); + UT_GenStub_Execute(SC_ContinueAtsOnFailureCmd, Basic, NULL); } /* @@ -72,13 +70,12 @@ void SC_ContinueAtsOnFailureCmd(const SC_ContinueAtsOnFailureCmd_t *Cmd) * Generated stub function for SC_InlineSwitch() * ---------------------------------------------------- */ -bool SC_InlineSwitch(void) -{ - UT_GenStub_SetupReturnBuffer(SC_InlineSwitch, bool); +bool SC_InlineSwitch(void) { + UT_GenStub_SetupReturnBuffer(SC_InlineSwitch, bool); - UT_GenStub_Execute(SC_InlineSwitch, Basic, NULL); + UT_GenStub_Execute(SC_InlineSwitch, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_InlineSwitch, bool); + return UT_GenStub_GetReturnValue(SC_InlineSwitch, bool); } /* @@ -86,11 +83,10 @@ bool SC_InlineSwitch(void) * Generated stub function for SC_JumpAtsCmd() * ---------------------------------------------------- */ -void SC_JumpAtsCmd(const SC_JumpAtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_JumpAtsCmd, const SC_JumpAtsCmd_t *, Cmd); +void SC_JumpAtsCmd(const SC_JumpAtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_JumpAtsCmd, const SC_JumpAtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_JumpAtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_JumpAtsCmd, Basic, NULL); } /* @@ -98,21 +94,16 @@ void SC_JumpAtsCmd(const SC_JumpAtsCmd_t *Cmd) * Generated stub function for SC_KillAts() * ---------------------------------------------------- */ -void SC_KillAts(void) -{ - - UT_GenStub_Execute(SC_KillAts, Basic, NULL); -} +void SC_KillAts(void) { UT_GenStub_Execute(SC_KillAts, Basic, NULL); } /* * ---------------------------------------------------- * Generated stub function for SC_ServiceSwitchPend() * ---------------------------------------------------- */ -void SC_ServiceSwitchPend(void) -{ +void SC_ServiceSwitchPend(void) { - UT_GenStub_Execute(SC_ServiceSwitchPend, Basic, NULL); + UT_GenStub_Execute(SC_ServiceSwitchPend, Basic, NULL); } /* @@ -120,11 +111,10 @@ void SC_ServiceSwitchPend(void) * Generated stub function for SC_StartAtsCmd() * ---------------------------------------------------- */ -void SC_StartAtsCmd(const SC_StartAtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StartAtsCmd, const SC_StartAtsCmd_t *, Cmd); +void SC_StartAtsCmd(const SC_StartAtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StartAtsCmd, const SC_StartAtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_StartAtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_StartAtsCmd, Basic, NULL); } /* @@ -132,11 +122,10 @@ void SC_StartAtsCmd(const SC_StartAtsCmd_t *Cmd) * Generated stub function for SC_StopAtsCmd() * ---------------------------------------------------- */ -void SC_StopAtsCmd(const SC_StopAtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StopAtsCmd, const SC_StopAtsCmd_t *, Cmd); +void SC_StopAtsCmd(const SC_StopAtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StopAtsCmd, const SC_StopAtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_StopAtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_StopAtsCmd, Basic, NULL); } /* @@ -144,9 +133,8 @@ void SC_StopAtsCmd(const SC_StopAtsCmd_t *Cmd) * Generated stub function for SC_SwitchAtsCmd() * ---------------------------------------------------- */ -void SC_SwitchAtsCmd(const SC_SwitchAtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_SwitchAtsCmd, const SC_SwitchAtsCmd_t *, Cmd); +void SC_SwitchAtsCmd(const SC_SwitchAtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_SwitchAtsCmd, const SC_SwitchAtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_SwitchAtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_SwitchAtsCmd, Basic, NULL); } diff --git a/unit-test/stubs/sc_cmds_stubs.c b/unit-test/stubs/sc_cmds_stubs.c index e3681b1..a46b78f 100644 --- a/unit-test/stubs/sc_cmds_stubs.c +++ b/unit-test/stubs/sc_cmds_stubs.c @@ -31,11 +31,10 @@ * Generated stub function for SC_ManageAtsTable() * ---------------------------------------------------- */ -void SC_ManageAtsTable(int32 ArrayIndex) -{ - UT_GenStub_AddParam(SC_ManageAtsTable, int32, ArrayIndex); +void SC_ManageAtsTable(int32 ArrayIndex) { + UT_GenStub_AddParam(SC_ManageAtsTable, int32, ArrayIndex); - UT_GenStub_Execute(SC_ManageAtsTable, Basic, NULL); + UT_GenStub_Execute(SC_ManageAtsTable, Basic, NULL); } /* @@ -43,11 +42,10 @@ void SC_ManageAtsTable(int32 ArrayIndex) * Generated stub function for SC_ManageRtsTable() * ---------------------------------------------------- */ -void SC_ManageRtsTable(int32 ArrayIndex) -{ - UT_GenStub_AddParam(SC_ManageRtsTable, int32, ArrayIndex); +void SC_ManageRtsTable(int32 ArrayIndex) { + UT_GenStub_AddParam(SC_ManageRtsTable, int32, ArrayIndex); - UT_GenStub_Execute(SC_ManageRtsTable, Basic, NULL); + UT_GenStub_Execute(SC_ManageRtsTable, Basic, NULL); } /* @@ -55,12 +53,11 @@ void SC_ManageRtsTable(int32 ArrayIndex) * Generated stub function for SC_ManageTable() * ---------------------------------------------------- */ -void SC_ManageTable(SC_TableType type, int32 ArrayIndex) -{ - UT_GenStub_AddParam(SC_ManageTable, SC_TableType, type); - UT_GenStub_AddParam(SC_ManageTable, int32, ArrayIndex); +void SC_ManageTable(SC_TableType type, int32 ArrayIndex) { + UT_GenStub_AddParam(SC_ManageTable, SC_TableType, type); + UT_GenStub_AddParam(SC_ManageTable, int32, ArrayIndex); - UT_GenStub_Execute(SC_ManageTable, Basic, NULL); + UT_GenStub_Execute(SC_ManageTable, Basic, NULL); } /* @@ -68,11 +65,10 @@ void SC_ManageTable(SC_TableType type, int32 ArrayIndex) * Generated stub function for SC_ManageTableCmd() * ---------------------------------------------------- */ -void SC_ManageTableCmd(const SC_ManageTableCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_ManageTableCmd, const SC_ManageTableCmd_t *, Cmd); +void SC_ManageTableCmd(const SC_ManageTableCmd_t *Cmd) { + UT_GenStub_AddParam(SC_ManageTableCmd, const SC_ManageTableCmd_t *, Cmd); - UT_GenStub_Execute(SC_ManageTableCmd, Basic, NULL); + UT_GenStub_Execute(SC_ManageTableCmd, Basic, NULL); } /* @@ -80,11 +76,10 @@ void SC_ManageTableCmd(const SC_ManageTableCmd_t *Cmd) * Generated stub function for SC_NoopCmd() * ---------------------------------------------------- */ -void SC_NoopCmd(const SC_NoopCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_NoopCmd, const SC_NoopCmd_t *, Cmd); +void SC_NoopCmd(const SC_NoopCmd_t *Cmd) { + UT_GenStub_AddParam(SC_NoopCmd, const SC_NoopCmd_t *, Cmd); - UT_GenStub_Execute(SC_NoopCmd, Basic, NULL); + UT_GenStub_Execute(SC_NoopCmd, Basic, NULL); } /* @@ -92,11 +87,10 @@ void SC_NoopCmd(const SC_NoopCmd_t *Cmd) * Generated stub function for SC_OneHzWakeupCmd() * ---------------------------------------------------- */ -void SC_OneHzWakeupCmd(const SC_OneHzWakeupCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_OneHzWakeupCmd, const SC_OneHzWakeupCmd_t *, Cmd); +void SC_OneHzWakeupCmd(const SC_OneHzWakeupCmd_t *Cmd) { + UT_GenStub_AddParam(SC_OneHzWakeupCmd, const SC_OneHzWakeupCmd_t *, Cmd); - UT_GenStub_Execute(SC_OneHzWakeupCmd, Basic, NULL); + UT_GenStub_Execute(SC_OneHzWakeupCmd, Basic, NULL); } /* @@ -104,10 +98,9 @@ void SC_OneHzWakeupCmd(const SC_OneHzWakeupCmd_t *Cmd) * Generated stub function for SC_ProcessAtpCmd() * ---------------------------------------------------- */ -void SC_ProcessAtpCmd(void) -{ +void SC_ProcessAtpCmd(void) { - UT_GenStub_Execute(SC_ProcessAtpCmd, Basic, NULL); + UT_GenStub_Execute(SC_ProcessAtpCmd, Basic, NULL); } /* @@ -115,10 +108,9 @@ void SC_ProcessAtpCmd(void) * Generated stub function for SC_ProcessRtpCommand() * ---------------------------------------------------- */ -void SC_ProcessRtpCommand(void) -{ +void SC_ProcessRtpCommand(void) { - UT_GenStub_Execute(SC_ProcessRtpCommand, Basic, NULL); + UT_GenStub_Execute(SC_ProcessRtpCommand, Basic, NULL); } /* @@ -126,11 +118,10 @@ void SC_ProcessRtpCommand(void) * Generated stub function for SC_ResetCountersCmd() * ---------------------------------------------------- */ -void SC_ResetCountersCmd(const SC_ResetCountersCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_ResetCountersCmd, const SC_ResetCountersCmd_t *, Cmd); +void SC_ResetCountersCmd(const SC_ResetCountersCmd_t *Cmd) { + UT_GenStub_AddParam(SC_ResetCountersCmd, const SC_ResetCountersCmd_t *, Cmd); - UT_GenStub_Execute(SC_ResetCountersCmd, Basic, NULL); + UT_GenStub_Execute(SC_ResetCountersCmd, Basic, NULL); } /* @@ -138,11 +129,10 @@ void SC_ResetCountersCmd(const SC_ResetCountersCmd_t *Cmd) * Generated stub function for SC_SendHkCmd() * ---------------------------------------------------- */ -void SC_SendHkCmd(const SC_SendHkCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_SendHkCmd, const SC_SendHkCmd_t *, Cmd); +void SC_SendHkCmd(const SC_SendHkCmd_t *Cmd) { + UT_GenStub_AddParam(SC_SendHkCmd, const SC_SendHkCmd_t *, Cmd); - UT_GenStub_Execute(SC_SendHkCmd, Basic, NULL); + UT_GenStub_Execute(SC_SendHkCmd, Basic, NULL); } /* @@ -150,8 +140,4 @@ void SC_SendHkCmd(const SC_SendHkCmd_t *Cmd) * Generated stub function for SC_SendHkPacket() * ---------------------------------------------------- */ -void SC_SendHkPacket(void) -{ - - UT_GenStub_Execute(SC_SendHkPacket, Basic, NULL); -} +void SC_SendHkPacket(void) { UT_GenStub_Execute(SC_SendHkPacket, Basic, NULL); } diff --git a/unit-test/stubs/sc_dispatch_stubs.c b/unit-test/stubs/sc_dispatch_stubs.c index 0cba02e..0d8199f 100644 --- a/unit-test/stubs/sc_dispatch_stubs.c +++ b/unit-test/stubs/sc_dispatch_stubs.c @@ -20,7 +20,8 @@ /** * @file * - * Auto-Generated stub implementations for functions defined in sc_dispatch header + * Auto-Generated stub implementations for functions defined in sc_dispatch + * header */ #include "sc_dispatch.h" @@ -31,11 +32,10 @@ * Generated stub function for SC_ProcessCommand() * ---------------------------------------------------- */ -void SC_ProcessCommand(const CFE_SB_Buffer_t *BufPtr) -{ - UT_GenStub_AddParam(SC_ProcessCommand, const CFE_SB_Buffer_t *, BufPtr); +void SC_ProcessCommand(const CFE_SB_Buffer_t *BufPtr) { + UT_GenStub_AddParam(SC_ProcessCommand, const CFE_SB_Buffer_t *, BufPtr); - UT_GenStub_Execute(SC_ProcessCommand, Basic, NULL); + UT_GenStub_Execute(SC_ProcessCommand, Basic, NULL); } /* @@ -43,11 +43,10 @@ void SC_ProcessCommand(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for SC_ProcessRequest() * ---------------------------------------------------- */ -void SC_ProcessRequest(const CFE_SB_Buffer_t *BufPtr) -{ - UT_GenStub_AddParam(SC_ProcessRequest, const CFE_SB_Buffer_t *, BufPtr); +void SC_ProcessRequest(const CFE_SB_Buffer_t *BufPtr) { + UT_GenStub_AddParam(SC_ProcessRequest, const CFE_SB_Buffer_t *, BufPtr); - UT_GenStub_Execute(SC_ProcessRequest, Basic, NULL); + UT_GenStub_Execute(SC_ProcessRequest, Basic, NULL); } /* @@ -55,14 +54,13 @@ void SC_ProcessRequest(const CFE_SB_Buffer_t *BufPtr) * Generated stub function for SC_VerifyCmdLength() * ---------------------------------------------------- */ -bool SC_VerifyCmdLength(const CFE_MSG_Message_t *Msg, size_t ExpectedLength) -{ - UT_GenStub_SetupReturnBuffer(SC_VerifyCmdLength, bool); +bool SC_VerifyCmdLength(const CFE_MSG_Message_t *Msg, size_t ExpectedLength) { + UT_GenStub_SetupReturnBuffer(SC_VerifyCmdLength, bool); - UT_GenStub_AddParam(SC_VerifyCmdLength, const CFE_MSG_Message_t *, Msg); - UT_GenStub_AddParam(SC_VerifyCmdLength, size_t, ExpectedLength); + UT_GenStub_AddParam(SC_VerifyCmdLength, const CFE_MSG_Message_t *, Msg); + UT_GenStub_AddParam(SC_VerifyCmdLength, size_t, ExpectedLength); - UT_GenStub_Execute(SC_VerifyCmdLength, Basic, NULL); + UT_GenStub_Execute(SC_VerifyCmdLength, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_VerifyCmdLength, bool); + return UT_GenStub_GetReturnValue(SC_VerifyCmdLength, bool); } diff --git a/unit-test/stubs/sc_loads_stubs.c b/unit-test/stubs/sc_loads_stubs.c index 1b99b7b..8309e14 100644 --- a/unit-test/stubs/sc_loads_stubs.c +++ b/unit-test/stubs/sc_loads_stubs.c @@ -31,11 +31,10 @@ * Generated stub function for SC_BuildTimeIndexTable() * ---------------------------------------------------- */ -void SC_BuildTimeIndexTable(SC_AtsIndex_t AtsIndex) -{ - UT_GenStub_AddParam(SC_BuildTimeIndexTable, SC_AtsIndex_t, AtsIndex); +void SC_BuildTimeIndexTable(SC_AtsIndex_t AtsIndex) { + UT_GenStub_AddParam(SC_BuildTimeIndexTable, SC_AtsIndex_t, AtsIndex); - UT_GenStub_Execute(SC_BuildTimeIndexTable, Basic, NULL); + UT_GenStub_Execute(SC_BuildTimeIndexTable, Basic, NULL); } /* @@ -43,11 +42,10 @@ void SC_BuildTimeIndexTable(SC_AtsIndex_t AtsIndex) * Generated stub function for SC_InitAtsTables() * ---------------------------------------------------- */ -void SC_InitAtsTables(SC_AtsIndex_t AtsIndex) -{ - UT_GenStub_AddParam(SC_InitAtsTables, SC_AtsIndex_t, AtsIndex); +void SC_InitAtsTables(SC_AtsIndex_t AtsIndex) { + UT_GenStub_AddParam(SC_InitAtsTables, SC_AtsIndex_t, AtsIndex); - UT_GenStub_Execute(SC_InitAtsTables, Basic, NULL); + UT_GenStub_Execute(SC_InitAtsTables, Basic, NULL); } /* @@ -55,13 +53,13 @@ void SC_InitAtsTables(SC_AtsIndex_t AtsIndex) * Generated stub function for SC_Insert() * ---------------------------------------------------- */ -void SC_Insert(SC_AtsIndex_t AtsIndex, SC_CommandIndex_t NewCmdIndex, uint32 ListLength) -{ - UT_GenStub_AddParam(SC_Insert, SC_AtsIndex_t, AtsIndex); - UT_GenStub_AddParam(SC_Insert, SC_CommandIndex_t, NewCmdIndex); - UT_GenStub_AddParam(SC_Insert, uint32, ListLength); +void SC_Insert(SC_AtsIndex_t AtsIndex, SC_CommandIndex_t NewCmdIndex, + uint32 ListLength) { + UT_GenStub_AddParam(SC_Insert, SC_AtsIndex_t, AtsIndex); + UT_GenStub_AddParam(SC_Insert, SC_CommandIndex_t, NewCmdIndex); + UT_GenStub_AddParam(SC_Insert, uint32, ListLength); - UT_GenStub_Execute(SC_Insert, Basic, NULL); + UT_GenStub_Execute(SC_Insert, Basic, NULL); } /* @@ -69,11 +67,10 @@ void SC_Insert(SC_AtsIndex_t AtsIndex, SC_CommandIndex_t NewCmdIndex, uint32 Lis * Generated stub function for SC_LoadAts() * ---------------------------------------------------- */ -void SC_LoadAts(SC_AtsIndex_t AtsIndex) -{ - UT_GenStub_AddParam(SC_LoadAts, SC_AtsIndex_t, AtsIndex); +void SC_LoadAts(SC_AtsIndex_t AtsIndex) { + UT_GenStub_AddParam(SC_LoadAts, SC_AtsIndex_t, AtsIndex); - UT_GenStub_Execute(SC_LoadAts, Basic, NULL); + UT_GenStub_Execute(SC_LoadAts, Basic, NULL); } /* @@ -81,11 +78,10 @@ void SC_LoadAts(SC_AtsIndex_t AtsIndex) * Generated stub function for SC_LoadRts() * ---------------------------------------------------- */ -void SC_LoadRts(SC_RtsIndex_t RtsIndex) -{ - UT_GenStub_AddParam(SC_LoadRts, SC_RtsIndex_t, RtsIndex); +void SC_LoadRts(SC_RtsIndex_t RtsIndex) { + UT_GenStub_AddParam(SC_LoadRts, SC_RtsIndex_t, RtsIndex); - UT_GenStub_Execute(SC_LoadRts, Basic, NULL); + UT_GenStub_Execute(SC_LoadRts, Basic, NULL); } /* @@ -93,13 +89,12 @@ void SC_LoadRts(SC_RtsIndex_t RtsIndex) * Generated stub function for SC_ParseRts() * ---------------------------------------------------- */ -bool SC_ParseRts(uint32 Buffer32[]) -{ - UT_GenStub_SetupReturnBuffer(SC_ParseRts, bool); +bool SC_ParseRts(uint32 Buffer32[]) { + UT_GenStub_SetupReturnBuffer(SC_ParseRts, bool); - UT_GenStub_Execute(SC_ParseRts, Basic, NULL); + UT_GenStub_Execute(SC_ParseRts, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ParseRts, bool); + return UT_GenStub_GetReturnValue(SC_ParseRts, bool); } /* @@ -107,11 +102,10 @@ bool SC_ParseRts(uint32 Buffer32[]) * Generated stub function for SC_ProcessAppend() * ---------------------------------------------------- */ -void SC_ProcessAppend(SC_AtsIndex_t AtsIndex) -{ - UT_GenStub_AddParam(SC_ProcessAppend, SC_AtsIndex_t, AtsIndex); +void SC_ProcessAppend(SC_AtsIndex_t AtsIndex) { + UT_GenStub_AddParam(SC_ProcessAppend, SC_AtsIndex_t, AtsIndex); - UT_GenStub_Execute(SC_ProcessAppend, Basic, NULL); + UT_GenStub_Execute(SC_ProcessAppend, Basic, NULL); } /* @@ -119,26 +113,21 @@ void SC_ProcessAppend(SC_AtsIndex_t AtsIndex) * Generated stub function for SC_UpdateAppend() * ---------------------------------------------------- */ -void SC_UpdateAppend(void) -{ - - UT_GenStub_Execute(SC_UpdateAppend, Basic, NULL); -} +void SC_UpdateAppend(void) { UT_GenStub_Execute(SC_UpdateAppend, Basic, NULL); } /* * ---------------------------------------------------- * Generated stub function for SC_ValidateAppend() * ---------------------------------------------------- */ -int32 SC_ValidateAppend(void *TableData) -{ - UT_GenStub_SetupReturnBuffer(SC_ValidateAppend, int32); +int32 SC_ValidateAppend(void *TableData) { + UT_GenStub_SetupReturnBuffer(SC_ValidateAppend, int32); - UT_GenStub_AddParam(SC_ValidateAppend, void *, TableData); + UT_GenStub_AddParam(SC_ValidateAppend, void *, TableData); - UT_GenStub_Execute(SC_ValidateAppend, Basic, NULL); + UT_GenStub_Execute(SC_ValidateAppend, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ValidateAppend, int32); + return UT_GenStub_GetReturnValue(SC_ValidateAppend, int32); } /* @@ -146,15 +135,14 @@ int32 SC_ValidateAppend(void *TableData) * Generated stub function for SC_ValidateAts() * ---------------------------------------------------- */ -int32 SC_ValidateAts(void *TableData) -{ - UT_GenStub_SetupReturnBuffer(SC_ValidateAts, int32); +int32 SC_ValidateAts(void *TableData) { + UT_GenStub_SetupReturnBuffer(SC_ValidateAts, int32); - UT_GenStub_AddParam(SC_ValidateAts, void *, TableData); + UT_GenStub_AddParam(SC_ValidateAts, void *, TableData); - UT_GenStub_Execute(SC_ValidateAts, Basic, NULL); + UT_GenStub_Execute(SC_ValidateAts, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ValidateAts, int32); + return UT_GenStub_GetReturnValue(SC_ValidateAts, int32); } /* @@ -162,15 +150,14 @@ int32 SC_ValidateAts(void *TableData) * Generated stub function for SC_ValidateRts() * ---------------------------------------------------- */ -int32 SC_ValidateRts(void *TableData) -{ - UT_GenStub_SetupReturnBuffer(SC_ValidateRts, int32); +int32 SC_ValidateRts(void *TableData) { + UT_GenStub_SetupReturnBuffer(SC_ValidateRts, int32); - UT_GenStub_AddParam(SC_ValidateRts, void *, TableData); + UT_GenStub_AddParam(SC_ValidateRts, void *, TableData); - UT_GenStub_Execute(SC_ValidateRts, Basic, NULL); + UT_GenStub_Execute(SC_ValidateRts, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ValidateRts, int32); + return UT_GenStub_GetReturnValue(SC_ValidateRts, int32); } /* @@ -178,17 +165,16 @@ int32 SC_ValidateRts(void *TableData) * Generated stub function for SC_VerifyAtsEntry() * ---------------------------------------------------- */ -int32 SC_VerifyAtsEntry(uint32 *Buffer32, int32 EntryIndex, int32 BufferWords) -{ - UT_GenStub_SetupReturnBuffer(SC_VerifyAtsEntry, int32); +int32 SC_VerifyAtsEntry(uint32 *Buffer32, int32 EntryIndex, int32 BufferWords) { + UT_GenStub_SetupReturnBuffer(SC_VerifyAtsEntry, int32); - UT_GenStub_AddParam(SC_VerifyAtsEntry, uint32 *, Buffer32); - UT_GenStub_AddParam(SC_VerifyAtsEntry, int32, EntryIndex); - UT_GenStub_AddParam(SC_VerifyAtsEntry, int32, BufferWords); + UT_GenStub_AddParam(SC_VerifyAtsEntry, uint32 *, Buffer32); + UT_GenStub_AddParam(SC_VerifyAtsEntry, int32, EntryIndex); + UT_GenStub_AddParam(SC_VerifyAtsEntry, int32, BufferWords); - UT_GenStub_Execute(SC_VerifyAtsEntry, Basic, NULL); + UT_GenStub_Execute(SC_VerifyAtsEntry, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_VerifyAtsEntry, int32); + return UT_GenStub_GetReturnValue(SC_VerifyAtsEntry, int32); } /* @@ -196,14 +182,13 @@ int32 SC_VerifyAtsEntry(uint32 *Buffer32, int32 EntryIndex, int32 BufferWords) * Generated stub function for SC_VerifyAtsTable() * ---------------------------------------------------- */ -int32 SC_VerifyAtsTable(uint32 *Buffer32, int32 BufferWords) -{ - UT_GenStub_SetupReturnBuffer(SC_VerifyAtsTable, int32); +int32 SC_VerifyAtsTable(uint32 *Buffer32, int32 BufferWords) { + UT_GenStub_SetupReturnBuffer(SC_VerifyAtsTable, int32); - UT_GenStub_AddParam(SC_VerifyAtsTable, uint32 *, Buffer32); - UT_GenStub_AddParam(SC_VerifyAtsTable, int32, BufferWords); + UT_GenStub_AddParam(SC_VerifyAtsTable, uint32 *, Buffer32); + UT_GenStub_AddParam(SC_VerifyAtsTable, int32, BufferWords); - UT_GenStub_Execute(SC_VerifyAtsTable, Basic, NULL); + UT_GenStub_Execute(SC_VerifyAtsTable, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_VerifyAtsTable, int32); + return UT_GenStub_GetReturnValue(SC_VerifyAtsTable, int32); } diff --git a/unit-test/stubs/sc_rtsrq_stubs.c b/unit-test/stubs/sc_rtsrq_stubs.c index 3d0cae7..a65216e 100644 --- a/unit-test/stubs/sc_rtsrq_stubs.c +++ b/unit-test/stubs/sc_rtsrq_stubs.c @@ -31,11 +31,10 @@ * Generated stub function for SC_AutoStartRts() * ---------------------------------------------------- */ -void SC_AutoStartRts(SC_RtsNum_t RtsNum) -{ - UT_GenStub_AddParam(SC_AutoStartRts, SC_RtsNum_t, RtsNum); +void SC_AutoStartRts(SC_RtsNum_t RtsNum) { + UT_GenStub_AddParam(SC_AutoStartRts, SC_RtsNum_t, RtsNum); - UT_GenStub_Execute(SC_AutoStartRts, Basic, NULL); + UT_GenStub_Execute(SC_AutoStartRts, Basic, NULL); } /* @@ -43,11 +42,10 @@ void SC_AutoStartRts(SC_RtsNum_t RtsNum) * Generated stub function for SC_DisableRtsCmd() * ---------------------------------------------------- */ -void SC_DisableRtsCmd(const SC_DisableRtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_DisableRtsCmd, const SC_DisableRtsCmd_t *, Cmd); +void SC_DisableRtsCmd(const SC_DisableRtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_DisableRtsCmd, const SC_DisableRtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_DisableRtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_DisableRtsCmd, Basic, NULL); } /* @@ -55,11 +53,10 @@ void SC_DisableRtsCmd(const SC_DisableRtsCmd_t *Cmd) * Generated stub function for SC_DisableRtsGrpCmd() * ---------------------------------------------------- */ -void SC_DisableRtsGrpCmd(const SC_DisableRtsGrpCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_DisableRtsGrpCmd, const SC_DisableRtsGrpCmd_t *, Cmd); +void SC_DisableRtsGrpCmd(const SC_DisableRtsGrpCmd_t *Cmd) { + UT_GenStub_AddParam(SC_DisableRtsGrpCmd, const SC_DisableRtsGrpCmd_t *, Cmd); - UT_GenStub_Execute(SC_DisableRtsGrpCmd, Basic, NULL); + UT_GenStub_Execute(SC_DisableRtsGrpCmd, Basic, NULL); } /* @@ -67,11 +64,10 @@ void SC_DisableRtsGrpCmd(const SC_DisableRtsGrpCmd_t *Cmd) * Generated stub function for SC_EnableRtsCmd() * ---------------------------------------------------- */ -void SC_EnableRtsCmd(const SC_EnableRtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_EnableRtsCmd, const SC_EnableRtsCmd_t *, Cmd); +void SC_EnableRtsCmd(const SC_EnableRtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_EnableRtsCmd, const SC_EnableRtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_EnableRtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_EnableRtsCmd, Basic, NULL); } /* @@ -79,11 +75,10 @@ void SC_EnableRtsCmd(const SC_EnableRtsCmd_t *Cmd) * Generated stub function for SC_EnableRtsGrpCmd() * ---------------------------------------------------- */ -void SC_EnableRtsGrpCmd(const SC_EnableRtsGrpCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_EnableRtsGrpCmd, const SC_EnableRtsGrpCmd_t *, Cmd); +void SC_EnableRtsGrpCmd(const SC_EnableRtsGrpCmd_t *Cmd) { + UT_GenStub_AddParam(SC_EnableRtsGrpCmd, const SC_EnableRtsGrpCmd_t *, Cmd); - UT_GenStub_Execute(SC_EnableRtsGrpCmd, Basic, NULL); + UT_GenStub_Execute(SC_EnableRtsGrpCmd, Basic, NULL); } /* @@ -91,11 +86,10 @@ void SC_EnableRtsGrpCmd(const SC_EnableRtsGrpCmd_t *Cmd) * Generated stub function for SC_KillRts() * ---------------------------------------------------- */ -void SC_KillRts(SC_RtsIndex_t RtsIndex) -{ - UT_GenStub_AddParam(SC_KillRts, SC_RtsIndex_t, RtsIndex); +void SC_KillRts(SC_RtsIndex_t RtsIndex) { + UT_GenStub_AddParam(SC_KillRts, SC_RtsIndex_t, RtsIndex); - UT_GenStub_Execute(SC_KillRts, Basic, NULL); + UT_GenStub_Execute(SC_KillRts, Basic, NULL); } /* @@ -103,11 +97,10 @@ void SC_KillRts(SC_RtsIndex_t RtsIndex) * Generated stub function for SC_StartRtsCmd() * ---------------------------------------------------- */ -void SC_StartRtsCmd(const SC_StartRtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StartRtsCmd, const SC_StartRtsCmd_t *, Cmd); +void SC_StartRtsCmd(const SC_StartRtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StartRtsCmd, const SC_StartRtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_StartRtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_StartRtsCmd, Basic, NULL); } /* @@ -115,11 +108,10 @@ void SC_StartRtsCmd(const SC_StartRtsCmd_t *Cmd) * Generated stub function for SC_StartRtsGrpCmd() * ---------------------------------------------------- */ -void SC_StartRtsGrpCmd(const SC_StartRtsGrpCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StartRtsGrpCmd, const SC_StartRtsGrpCmd_t *, Cmd); +void SC_StartRtsGrpCmd(const SC_StartRtsGrpCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StartRtsGrpCmd, const SC_StartRtsGrpCmd_t *, Cmd); - UT_GenStub_Execute(SC_StartRtsGrpCmd, Basic, NULL); + UT_GenStub_Execute(SC_StartRtsGrpCmd, Basic, NULL); } /* @@ -127,11 +119,10 @@ void SC_StartRtsGrpCmd(const SC_StartRtsGrpCmd_t *Cmd) * Generated stub function for SC_StopRtsCmd() * ---------------------------------------------------- */ -void SC_StopRtsCmd(const SC_StopRtsCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StopRtsCmd, const SC_StopRtsCmd_t *, Cmd); +void SC_StopRtsCmd(const SC_StopRtsCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StopRtsCmd, const SC_StopRtsCmd_t *, Cmd); - UT_GenStub_Execute(SC_StopRtsCmd, Basic, NULL); + UT_GenStub_Execute(SC_StopRtsCmd, Basic, NULL); } /* @@ -139,9 +130,8 @@ void SC_StopRtsCmd(const SC_StopRtsCmd_t *Cmd) * Generated stub function for SC_StopRtsGrpCmd() * ---------------------------------------------------- */ -void SC_StopRtsGrpCmd(const SC_StopRtsGrpCmd_t *Cmd) -{ - UT_GenStub_AddParam(SC_StopRtsGrpCmd, const SC_StopRtsGrpCmd_t *, Cmd); +void SC_StopRtsGrpCmd(const SC_StopRtsGrpCmd_t *Cmd) { + UT_GenStub_AddParam(SC_StopRtsGrpCmd, const SC_StopRtsGrpCmd_t *, Cmd); - UT_GenStub_Execute(SC_StopRtsGrpCmd, Basic, NULL); + UT_GenStub_Execute(SC_StopRtsGrpCmd, Basic, NULL); } diff --git a/unit-test/stubs/sc_state_stubs.c b/unit-test/stubs/sc_state_stubs.c index ec9c8cf..cc77ff0 100644 --- a/unit-test/stubs/sc_state_stubs.c +++ b/unit-test/stubs/sc_state_stubs.c @@ -31,10 +31,9 @@ * Generated stub function for SC_GetNextAtsCommand() * ---------------------------------------------------- */ -void SC_GetNextAtsCommand(void) -{ +void SC_GetNextAtsCommand(void) { - UT_GenStub_Execute(SC_GetNextAtsCommand, Basic, NULL); + UT_GenStub_Execute(SC_GetNextAtsCommand, Basic, NULL); } /* @@ -42,10 +41,9 @@ void SC_GetNextAtsCommand(void) * Generated stub function for SC_GetNextRtsCommand() * ---------------------------------------------------- */ -void SC_GetNextRtsCommand(void) -{ +void SC_GetNextRtsCommand(void) { - UT_GenStub_Execute(SC_GetNextRtsCommand, Basic, NULL); + UT_GenStub_Execute(SC_GetNextRtsCommand, Basic, NULL); } /* @@ -53,10 +51,9 @@ void SC_GetNextRtsCommand(void) * Generated stub function for SC_GetNextRtsTime() * ---------------------------------------------------- */ -void SC_GetNextRtsTime(void) -{ +void SC_GetNextRtsTime(void) { - UT_GenStub_Execute(SC_GetNextRtsTime, Basic, NULL); + UT_GenStub_Execute(SC_GetNextRtsTime, Basic, NULL); } /* @@ -64,8 +61,7 @@ void SC_GetNextRtsTime(void) * Generated stub function for SC_UpdateNextTime() * ---------------------------------------------------- */ -void SC_UpdateNextTime(void) -{ +void SC_UpdateNextTime(void) { - UT_GenStub_Execute(SC_UpdateNextTime, Basic, NULL); + UT_GenStub_Execute(SC_UpdateNextTime, Basic, NULL); } diff --git a/unit-test/stubs/sc_utils_stubs.c b/unit-test/stubs/sc_utils_stubs.c index caf0ef2..1886f5a 100644 --- a/unit-test/stubs/sc_utils_stubs.c +++ b/unit-test/stubs/sc_utils_stubs.c @@ -31,16 +31,15 @@ * Generated stub function for SC_CompareAbsTime() * ---------------------------------------------------- */ -bool SC_CompareAbsTime(SC_AbsTimeTag_t AbsTime1, SC_AbsTimeTag_t AbsTime2) -{ - UT_GenStub_SetupReturnBuffer(SC_CompareAbsTime, bool); +bool SC_CompareAbsTime(SC_AbsTimeTag_t AbsTime1, SC_AbsTimeTag_t AbsTime2) { + UT_GenStub_SetupReturnBuffer(SC_CompareAbsTime, bool); - UT_GenStub_AddParam(SC_CompareAbsTime, SC_AbsTimeTag_t, AbsTime1); - UT_GenStub_AddParam(SC_CompareAbsTime, SC_AbsTimeTag_t, AbsTime2); + UT_GenStub_AddParam(SC_CompareAbsTime, SC_AbsTimeTag_t, AbsTime1); + UT_GenStub_AddParam(SC_CompareAbsTime, SC_AbsTimeTag_t, AbsTime2); - UT_GenStub_Execute(SC_CompareAbsTime, Basic, NULL); + UT_GenStub_Execute(SC_CompareAbsTime, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_CompareAbsTime, bool); + return UT_GenStub_GetReturnValue(SC_CompareAbsTime, bool); } /* @@ -48,15 +47,29 @@ bool SC_CompareAbsTime(SC_AbsTimeTag_t AbsTime1, SC_AbsTimeTag_t AbsTime2) * Generated stub function for SC_ComputeAbsTime() * ---------------------------------------------------- */ -SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime) -{ - UT_GenStub_SetupReturnBuffer(SC_ComputeAbsTime, SC_AbsTimeTag_t); +SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime) { + UT_GenStub_SetupReturnBuffer(SC_ComputeAbsTime, SC_AbsTimeTag_t); - UT_GenStub_AddParam(SC_ComputeAbsTime, SC_RelTimeTag_t, RelTime); + UT_GenStub_AddParam(SC_ComputeAbsTime, SC_RelTimeTag_t, RelTime); - UT_GenStub_Execute(SC_ComputeAbsTime, Basic, NULL); + UT_GenStub_Execute(SC_ComputeAbsTime, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ComputeAbsTime, SC_AbsTimeTag_t); + return UT_GenStub_GetReturnValue(SC_ComputeAbsTime, SC_AbsTimeTag_t); +} + +/* + * ---------------------------------------------------- + * Generated stub function for SC_ComputeAbsWakeup() + * ---------------------------------------------------- + */ +uint32 SC_ComputeAbsWakeup(uint32 RelWakeup) { + UT_GenStub_SetupReturnBuffer(SC_ComputeAbsWakeup, uint32); + + UT_GenStub_AddParam(SC_ComputeAbsWakeup, uint32, RelWakeup); + + UT_GenStub_Execute(SC_ComputeAbsWakeup, Basic, NULL); + + return UT_GenStub_GetReturnValue(SC_ComputeAbsWakeup, uint32); } /* @@ -64,15 +77,14 @@ SC_AbsTimeTag_t SC_ComputeAbsTime(SC_RelTimeTag_t RelTime) * Generated stub function for SC_GetAtsEntryTime() * ---------------------------------------------------- */ -SC_AbsTimeTag_t SC_GetAtsEntryTime(SC_AtsEntryHeader_t *Entry) -{ - UT_GenStub_SetupReturnBuffer(SC_GetAtsEntryTime, SC_AbsTimeTag_t); +SC_AbsTimeTag_t SC_GetAtsEntryTime(SC_AtsEntryHeader_t *Entry) { + UT_GenStub_SetupReturnBuffer(SC_GetAtsEntryTime, SC_AbsTimeTag_t); - UT_GenStub_AddParam(SC_GetAtsEntryTime, SC_AtsEntryHeader_t *, Entry); + UT_GenStub_AddParam(SC_GetAtsEntryTime, SC_AtsEntryHeader_t *, Entry); - UT_GenStub_Execute(SC_GetAtsEntryTime, Basic, NULL); + UT_GenStub_Execute(SC_GetAtsEntryTime, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_GetAtsEntryTime, SC_AbsTimeTag_t); + return UT_GenStub_GetReturnValue(SC_GetAtsEntryTime, SC_AbsTimeTag_t); } /* @@ -80,10 +92,9 @@ SC_AbsTimeTag_t SC_GetAtsEntryTime(SC_AtsEntryHeader_t *Entry) * Generated stub function for SC_GetCurrentTime() * ---------------------------------------------------- */ -void SC_GetCurrentTime(void) -{ +void SC_GetCurrentTime(void) { - UT_GenStub_Execute(SC_GetCurrentTime, Basic, NULL); + UT_GenStub_Execute(SC_GetCurrentTime, Basic, NULL); } /* @@ -91,15 +102,14 @@ void SC_GetCurrentTime(void) * Generated stub function for SC_LookupTimeAccessor() * ---------------------------------------------------- */ -SC_TimeAccessor_t SC_LookupTimeAccessor(SC_TimeRef_Enum_t TimeRef) -{ - UT_GenStub_SetupReturnBuffer(SC_LookupTimeAccessor, SC_TimeAccessor_t); +SC_TimeAccessor_t SC_LookupTimeAccessor(SC_TimeRef_Enum_t TimeRef) { + UT_GenStub_SetupReturnBuffer(SC_LookupTimeAccessor, SC_TimeAccessor_t); - UT_GenStub_AddParam(SC_LookupTimeAccessor, SC_TimeRef_Enum_t, TimeRef); + UT_GenStub_AddParam(SC_LookupTimeAccessor, SC_TimeRef_Enum_t, TimeRef); - UT_GenStub_Execute(SC_LookupTimeAccessor, Basic, NULL); + UT_GenStub_Execute(SC_LookupTimeAccessor, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_LookupTimeAccessor, SC_TimeAccessor_t); + return UT_GenStub_GetReturnValue(SC_LookupTimeAccessor, SC_TimeAccessor_t); } /* @@ -107,11 +117,10 @@ SC_TimeAccessor_t SC_LookupTimeAccessor(SC_TimeRef_Enum_t TimeRef) * Generated stub function for SC_ToggleAtsIndex() * ---------------------------------------------------- */ -SC_AtsIndex_t SC_ToggleAtsIndex(void) -{ - UT_GenStub_SetupReturnBuffer(SC_ToggleAtsIndex, SC_AtsIndex_t); +SC_AtsIndex_t SC_ToggleAtsIndex(void) { + UT_GenStub_SetupReturnBuffer(SC_ToggleAtsIndex, SC_AtsIndex_t); - UT_GenStub_Execute(SC_ToggleAtsIndex, Basic, NULL); + UT_GenStub_Execute(SC_ToggleAtsIndex, Basic, NULL); - return UT_GenStub_GetReturnValue(SC_ToggleAtsIndex, SC_AtsIndex_t); + return UT_GenStub_GetReturnValue(SC_ToggleAtsIndex, SC_AtsIndex_t); }