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

cFE Integration Candidate: Caelum+dev2 #2019

Merged
merged 21 commits into from
Jan 21, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9c86dd4
Fix #2009, Reuse CodeQL, Static Analysis, and Format Check
arielswalker Oct 27, 2021
0521523
Fix #1997, Mismatched foreach in cmake function
Nov 3, 2021
3a122b6
cFE Application Developers Guide.md: specify language for improved co…
Nodraak Nov 4, 2021
ed8d927
Fix #1823, FS Functional test
Nov 9, 2021
b2de386
Merge pull request #2015 from pavll/fix-1823-fs-functional-test
astrogeco Dec 8, 2021
efa4640
Merge pull request #2012 from pavll/fix-1997-mismatched-foreach-in-cm…
astrogeco Dec 8, 2021
5981da4
Fix #2022, Limit SBR UT loops
skliper Jan 18, 2022
3eaf3ea
Fix #2024, osal_id_t type conversion in es_UT.c
jphickey Jan 18, 2022
fbbd5a9
Fix #2026, CFE_FS_ParseInputFileNameEx avoid uninit var
skliper Jan 18, 2022
3333827
Fix #2028, Initialize BlockData in ES UT
skliper Jan 18, 2022
f598216
Fix #2030, array length calculation for perf structs
jphickey Jan 18, 2022
47d8d97
Merge pull request #2013 from Nodraak/patch-3
astrogeco Jan 19, 2022
5cc196e
Merge pull request #2027 from skliper/fix2026-handle_parse_input_null…
astrogeco Jan 19, 2022
f8661cf
Merge pull request #2031 from jphickey:fix-2030-es-perf-array-len
astrogeco Jan 19, 2022
3f4d4b0
Merge pull request #2023 from skliper/fix2022-sbr_ut_loops
astrogeco Jan 19, 2022
39f386c
Merge pull request #2029 from skliper/fix2028-uninit_es_ut_blockdata
astrogeco Jan 19, 2022
1e270eb
Merge pull request #2025 from jphickey:fix-2024-ut-osal-id-conversion
astrogeco Jan 19, 2022
3cd97e9
Fix #2032, Add CFE_ES_AppInfo_t element documentation
skliper Jan 20, 2022
c1aa63d
Merge pull request #2011 from nasa/fix-2009-reuse-workflows
astrogeco Jan 20, 2022
47d613c
Merge pull request #2033 from skliper/fix2032-appinfo_element_doc
astrogeco Jan 21, 2022
b4fb004
Bump to v7.0.0-rc4+dev60
astrogeco Jan 21, 2022
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
Prev Previous commit
Next Next commit
cFE Application Developers Guide.md: specify language for improved co…
…de highlighting
  • Loading branch information
Nodraak authored Nov 4, 2021
commit 3a122b6a7c9a173ca3d4f10c9f3e080dc4ad8343
99 changes: 51 additions & 48 deletions docs/cFE Application Developers Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ headers, while files listed in the second table (without suffix) should be used

Finally, to simplify application headers, a single "all-inclusive" cFE header is also provided:

```
```c
#include "cfe.h" /* Define cFE API prototypes and data types */
```

Expand Down Expand Up @@ -779,7 +779,7 @@ clock tick. This can also be used to calculate the appropriate number of
system clock ticks for a specific delta time. An example can be seen
below:

```
```c
uint32 ConvertSecs2Ticks(uint32 Seconds)
{
uint32 NumOfTicks,TickDurationInMicroSec;
Expand Down Expand Up @@ -839,20 +839,20 @@ success, the OS_BinSemCreate function sets the sem_id parameter to the ID of
the newly-created resource. This ID is used in all other functions that use
the binary semaphore.

```
```c
int32 OS_BinSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME,
uint32 sem_initial_value, uint32 options);
```

There are two options for pending on a binary semaphore:

```
```c
int32 OS_BinSemTake( uint32 xxx_SEM_ID );
```

which waits indefinitely for a semaphore to become available, and

```
```c
int32 OS_BinSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds );
```

Expand All @@ -861,7 +861,7 @@ has not become available.

A binary semaphore is given by using this function:

```
```c
int32 OS_BinSemGive( uint32 xxx_SEM_ID );
```

Expand All @@ -886,25 +886,26 @@ Upon success, the OS_CountSemCreate function sets the sem_id parameter to the
ID of the newly-created resource. This ID is used in all other functions that
use the binary semaphore.

```
```c
int32 OS_CountSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME,
uint32 sem_initial_value, uint32 options);
```

There are two options for pending on a counting semaphore:

```
```c
int32 OS_CountSemTake( uint32 xxx_SEM_ID );
```

which waits indefinitely for a semaphore to become available, and

```
```c
int32 OS_CountSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds );
```

A counting semaphore is given by using this function:

```
```c
int32 OS_CountSemGive( uint32 xxx_SEM_ID );
```

Expand Down Expand Up @@ -940,7 +941,7 @@ being done in the protected region. The Take and Give functions should
have the same level of indentation, and there should be exactly one
entry point and one exit point to the protected region.

```
```c
int32 OS_MutSemTake( uint32 xxx_MUT_ID );

/* protected region */
Expand All @@ -965,25 +966,25 @@ of the entire system.

An application creates a mutex by calling:

```
```c
int32 OS_MutSemCreate (uint32 *sem_id, const char *sem_name, uint32 options);
```

and deletes it by calling:

```
```c
int32 OS_MutSemDelete (uint32 sem_id);
```

An application takes a mutex by calling:

```
```c
int32 OS_MutSemTake( uint32 xxx_MUT_ID );
```

and gives it by calling:

```
```c
int32 OS_MutSemGive( uint32 xxx_MUT_ID );
```

Expand All @@ -1009,22 +1010,22 @@ Similar to interrupt service routines, handlers can be associated with
specific exceptions. The following function specifies a handler for an
exception:

```
```c
OS_ExcAttachHandler( uint32 ExceptionNumber, void *ExceptionHandler, int32 Param );
```

The ExceptionHandler is a function that will be called when the
exception is detected and should have a prototype that looks like the
following:

```
```c
void ExceptionHandler( int32 Param );
```

There are addition functions for enabling/masking and
disabling/unmasking specific exceptions. These are as follows:

```
```c
OS_ExcEnable( uint32 ExceptionNumber );
OS_ExcDisable( uint32 ExceptionNumber );
```
Expand All @@ -1035,22 +1036,22 @@ In addition to the exception handlers identified above, a similar
paradigm exists for handling floating point processor exceptions. The
following function specifies a handler for an FPU exception:

```
```c
OS_FPUExcAttachHandler( uint32 ExceptionNumber, void *ExceptionHandler, int32 Param );
```

The ExceptionHandler is a function that will be called when the
exception is detected and should have a prototype that looks like the
following:

```
```c
void ExceptionHandler( int32 Param );
```

There are addition functions for enabling/masking and
disabling/unmasking specific exceptions. These are as follows:

```
```c
OS_FPUExcEnable( uint32 ExceptionNumber );
OS_FPUExcDisable( uint32 ExceptionNumber );
```
Expand Down Expand Up @@ -1367,7 +1368,7 @@ significant Event that cannot be recorded using the CFE_EVS_SendEvent
function, then the Developer can use the CFE_ES_WriteToSysLog
function. This function has the following prototype:

```
```c
int32 CFE_ES_WriteToSysLog(const char *pSpecString, ...);
```

Expand Down Expand Up @@ -2313,7 +2314,7 @@ used to uniquely identify an application event. The Event ID is defined
and supplied to the EVS by the application requesting services. The
hexadecimal bit mask represents the filtering frequency for the event.

```
```c
typedef struct
{
uint16 EventID,
Expand Down Expand Up @@ -2342,7 +2343,7 @@ section 7.4) regardless of whether the message was sent.
An example of an Application registering with Event Services and
specifying its binary filters is shown below:

```
```c
FILE: sample_app.h

...
Expand Down Expand Up @@ -2415,7 +2416,7 @@ reset the filter counter for a specified Event ID. The latter function
resets all event filter counters for the Application. An example of
resetting a specific Event ID filter counter is shown below:

```
```c
FILE: sample_app.c

{
Expand All @@ -2434,7 +2435,7 @@ or the CFE_EVS_SendTimedEvent() function, which are both analogous to
the C printf() function in how strings are formatted. An example of each
function call is shown below:

```
```c
CFE_EVS_SendEvent(EventID, EventType, "Unknown stream on cmd pipe:
0x%04X", sid);
```
Expand All @@ -2451,7 +2452,7 @@ sent.
The other function that can be called to send an event message is shown
below:

```
```c
CFE_EVS_SendTimedEvent(PktTime, EventID, EventType, "CSS Data Bad:
0x%04X", CssData);
```
Expand Down Expand Up @@ -2644,7 +2645,7 @@ it should use the CFE_TBL_Share API instead. The CFE_TBL_Share API will locate
the specified Table by name and return a Table Handle to the calling
Application. An example of Table sharing is shown below:

```
```c
FILE: SAMPLE_app.c

CFE_TBL_Handle_t MyTableHandle; /* Handle to MyTable */
Expand Down Expand Up @@ -2679,7 +2680,7 @@ Application can obtain a pointer to the start of the data within the
Table using the CFE_TBL_GetAddress or CFE_TBL_GetAddresses APIs. An example
of this is shown in Section 8.5.1.

```
```c
{
int32 Status = CFE_SUCCESS;
SAMPLE_MyTable_t *MyTblPtr;
Expand Down Expand Up @@ -2772,7 +2773,7 @@ assigning and creating a validation function is a fairly simple process.
To use the function, the Application should periodically identify when a
Table Validation Request has been made as shown below:

```
```c
{
int32 Status = CFE_SUCCESS;
boolean FinishedManaging = FALSE;
Expand Down Expand Up @@ -2821,7 +2822,7 @@ the Table with default values or when the Application is changing modes
and wishes to use a different parameter set. An example of this can be
seen below:

```
```c
FILE: sample_app.c

CFE_TBL_Handle_t MyTableHandle /* Handle to MyTable */
Expand All @@ -2847,7 +2848,7 @@ SAMPLE_MyTable_t MyTblInitData = { 0x1234, 0x5678, { 2, 3, 4, ... }, ...};
If a developer wishes to load the table from a file rather than from a
memory image, the code would look something like the following:

```
```c
{
int32 Status;

Expand Down Expand Up @@ -2898,6 +2899,7 @@ A typical layout of table-related files within an application (xx) is shown
below. Note that this does not show all of an application's files, just those
related to tables.

```
xx
|----fsw
|----src
Expand All @@ -2910,27 +2912,28 @@ xx
|
|----platform_inc
|----xx_platform_cfg.h
```

The xx_app.h file is included in this layout only because table handles are
typically stored in an application's AppData_t structure.
The `xx_app.h` file is included in this layout only because table handles are
typically stored in an application's `AppData_t` structure.

The file xx_tbldefs.h (sometimes just named xx_tbl.h) typically contains the
The file `xx_tbldefs.h` (sometimes just named `xx_tbl.h`) typically contains the
structure definition of a single table entry. This file is included in the
xx_table1.c file where the table itself is defined. It may also contain
`xx_table1.c` file where the table itself is defined. It may also contain
declarations for table-related utility functions.

The xx_tbl.c file typically contains table-related utility functions. For
The `xx_tbl.c` file typically contains table-related utility functions. For
instance, many applications define table initialization and validation functions
in this file.

The xx_table1.c file is the source code for a table itself.
The `xx_table1.c` file is the source code for a table itself.

The xx_platform_cfg.h file contains configuration parameters for applications,
The `xx_platform_cfg.h` file contains configuration parameters for applications,
and there are typically several configuration parameters associated with tables.

### 8.5.1 Table Files Example

```
```c
FILE: xx_app.h

...
Expand All @@ -2945,7 +2948,7 @@ XX_AppData_t XX_AppData;
...
```

```
```c
FILE: xx_tbldefs.h

...
Expand All @@ -2968,7 +2971,7 @@ int32 XX_ValidateTable(void *TableData);
...
```

```
```c
FILE: xx_tbl.c

#include xx_tbldefs.h
Expand Down Expand Up @@ -3028,7 +3031,7 @@ int32 XX_ValidateTable(void *TableData)
}
```

```
```c
FILE: xx_table1.c

#include "cfe.h"
Expand All @@ -3054,7 +3057,7 @@ XX_MyTable_t XX_MyTable =
};
```

```
```c
FILE: xx_platform_cfg.h

#define XX_APP_NAME "XX"
Expand All @@ -3071,7 +3074,7 @@ In order to build application tables with the CMake build system, the
application is structured with a "Tables" directory, another
"aux_source_directory" may need to be added as well.

```
```cmake
aux_source_directory(fsw/tables APP_TABLE_FILES)

# Create the app module
Expand Down Expand Up @@ -3106,7 +3109,7 @@ standard file header.

The structure of the standard file header is as follows:

```
```c
typedef struct
{
uint32 ContentType; /* Identifies the content type (magic #=’cFE1’) */
Expand Down Expand Up @@ -3215,7 +3218,7 @@ integer represents the number of seconds and the second integer
represents the number of `2^-32` seconds. The data structure for this
representation of time is as follows:

```
```c
typedef struct {
uint32 Seconds; /* Number of seconds */
uint32 Subseconds; /* Number of 2^(-32) subseconds */
Expand Down Expand Up @@ -3420,7 +3423,7 @@ the first time in the subtraction. Otherwise, as shown above, the delta
time between two absolute times could either be 5 hours or 7 hours. An
example of a delta time computation function is shown below:

```
```c
CFE_TIME_SysTime_t ComputeDeltaTime(CFE_TIME_SysTime_t TimeA,
CFE_TIME_SysTime_t TimeB)
{
Expand Down