@@ -501,7 +501,7 @@ headers, while files listed in the second table (without suffix) should be used
501501
502502Finally, to simplify application headers, a single "all-inclusive" cFE header is also provided:
503503
504- ```
504+ ``` c
505505#include " cfe.h" /* Define cFE API prototypes and data types */
506506```
507507
@@ -779,7 +779,7 @@ clock tick. This can also be used to calculate the appropriate number of
779779system clock ticks for a specific delta time. An example can be seen
780780below:
781781
782- ```
782+ ``` c
783783uint32 ConvertSecs2Ticks (uint32 Seconds)
784784{
785785 uint32 NumOfTicks,TickDurationInMicroSec;
@@ -839,20 +839,20 @@ success, the OS_BinSemCreate function sets the sem_id parameter to the ID of
839839the newly-created resource. This ID is used in all other functions that use
840840the binary semaphore.
841841
842- ```
842+ ```c
843843int32 OS_BinSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME,
844844 uint32 sem_initial_value, uint32 options);
845845```
846846
847847There are two options for pending on a binary semaphore:
848848
849- ```
849+ ``` c
850850int32 OS_BinSemTake ( uint32 xxx_SEM_ID );
851851```
852852
853853which waits indefinitely for a semaphore to become available, and
854854
855- ```
855+ ```c
856856int32 OS_BinSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds );
857857```
858858
@@ -861,7 +861,7 @@ has not become available.
861861
862862A binary semaphore is given by using this function:
863863
864- ```
864+ ``` c
865865int32 OS_BinSemGive ( uint32 xxx_SEM_ID );
866866```
867867
@@ -886,25 +886,26 @@ Upon success, the OS_CountSemCreate function sets the sem_id parameter to the
886886ID of the newly-created resource. This ID is used in all other functions that
887887use the binary semaphore.
888888
889- ```
889+ ```c
890890int32 OS_CountSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME,
891891 uint32 sem_initial_value, uint32 options);
892892```
893893
894894There are two options for pending on a counting semaphore:
895895
896- ```
896+ ``` c
897897int32 OS_CountSemTake ( uint32 xxx_SEM_ID );
898898```
899899
900900which waits indefinitely for a semaphore to become available, and
901901
902- ```
902+ ```c
903903int32 OS_CountSemTimedWait( uint32 xxx_SEM_ID , uint32 timeout_in_milliseconds );
904904```
905+
905906A counting semaphore is given by using this function:
906907
907- ```
908+ ``` c
908909int32 OS_CountSemGive ( uint32 xxx_SEM_ID );
909910```
910911
@@ -940,7 +941,7 @@ being done in the protected region. The Take and Give functions should
940941have the same level of indentation, and there should be exactly one
941942entry point and one exit point to the protected region.
942943
943- ```
944+ ```c
944945int32 OS_MutSemTake( uint32 xxx_MUT_ID );
945946
946947 /* protected region */
@@ -965,25 +966,25 @@ of the entire system.
965966
966967An application creates a mutex by calling:
967968
968- ```
969+ ``` c
969970int32 OS_MutSemCreate (uint32 * sem_id, const char * sem_name, uint32 options);
970971```
971972
972973and deletes it by calling:
973974
974- ```
975+ ```c
975976int32 OS_MutSemDelete (uint32 sem_id);
976977```
977978
978979An application takes a mutex by calling:
979980
980- ```
981+ ``` c
981982int32 OS_MutSemTake ( uint32 xxx_MUT_ID );
982983```
983984
984985and gives it by calling:
985986
986- ```
987+ ```c
987988int32 OS_MutSemGive( uint32 xxx_MUT_ID );
988989```
989990
@@ -1009,22 +1010,22 @@ Similar to interrupt service routines, handlers can be associated with
10091010specific exceptions. The following function specifies a handler for an
10101011exception:
10111012
1012- ```
1013+ ``` c
10131014OS_ExcAttachHandler ( uint32 ExceptionNumber, void * ExceptionHandler, int32 Param );
10141015```
10151016
10161017The ExceptionHandler is a function that will be called when the
10171018exception is detected and should have a prototype that looks like the
10181019following:
10191020
1020- ```
1021+ ```c
10211022void ExceptionHandler( int32 Param );
10221023```
10231024
10241025There are addition functions for enabling/masking and
10251026disabling/unmasking specific exceptions. These are as follows:
10261027
1027- ```
1028+ ``` c
10281029OS_ExcEnable ( uint32 ExceptionNumber );
10291030OS_ExcDisable( uint32 ExceptionNumber );
10301031```
@@ -1035,22 +1036,22 @@ In addition to the exception handlers identified above, a similar
10351036paradigm exists for handling floating point processor exceptions. The
10361037following function specifies a handler for an FPU exception:
10371038
1038- ```
1039+ ```c
10391040OS_FPUExcAttachHandler( uint32 ExceptionNumber, void *ExceptionHandler, int32 Param );
10401041```
10411042
10421043The ExceptionHandler is a function that will be called when the
10431044exception is detected and should have a prototype that looks like the
10441045following:
10451046
1046- ```
1047+ ``` c
10471048void ExceptionHandler ( int32 Param );
10481049```
10491050
10501051There are addition functions for enabling/masking and
10511052disabling/unmasking specific exceptions. These are as follows:
10521053
1053- ```
1054+ ```c
10541055OS_FPUExcEnable( uint32 ExceptionNumber );
10551056OS_FPUExcDisable( uint32 ExceptionNumber );
10561057```
@@ -1367,7 +1368,7 @@ significant Event that cannot be recorded using the CFE_EVS_SendEvent
13671368function, then the Developer can use the CFE_ES_WriteToSysLog
13681369function. This function has the following prototype:
13691370
1370- ```
1371+ ```c
13711372int32 CFE_ES_WriteToSysLog(const char *pSpecString, ...);
13721373```
13731374
@@ -2313,7 +2314,7 @@ used to uniquely identify an application event. The Event ID is defined
23132314and supplied to the EVS by the application requesting services. The
23142315hexadecimal bit mask represents the filtering frequency for the event.
23152316
2316- ```
2317+ ``` c
23172318typedef struct
23182319{
23192320 uint16 EventID,
@@ -2342,7 +2343,7 @@ section 7.4) regardless of whether the message was sent.
23422343An example of an Application registering with Event Services and
23432344specifying its binary filters is shown below:
23442345
2345- ```
2346+ ``` c
23462347FILE: sample_app.h
23472348
23482349...
@@ -2415,7 +2416,7 @@ reset the filter counter for a specified Event ID. The latter function
24152416resets all event filter counters for the Application. An example of
24162417resetting a specific Event ID filter counter is shown below:
24172418
2418- ```
2419+ ``` c
24192420FILE: sample_app.c
24202421
24212422{
@@ -2434,7 +2435,7 @@ or the CFE_EVS_SendTimedEvent() function, which are both analogous to
24342435the C printf() function in how strings are formatted. An example of each
24352436function call is shown below:
24362437
2437- ```
2438+ ``` c
24382439CFE_EVS_SendEvent (EventID, EventType, "Unknown stream on cmd pipe:
243924400x%04X", sid);
24402441```
@@ -2451,7 +2452,7 @@ sent.
24512452The other function that can be called to send an event message is shown
24522453below:
24532454
2454- ```
2455+ ```c
24552456CFE_EVS_SendTimedEvent(PktTime, EventID, EventType, "CSS Data Bad:
245624570x%04X", CssData);
24572458```
@@ -2644,7 +2645,7 @@ it should use the CFE_TBL_Share API instead. The CFE_TBL_Share API will locate
26442645the specified Table by name and return a Table Handle to the calling
26452646Application. An example of Table sharing is shown below:
26462647
2647- ```
2648+ ``` c
26482649FILE: SAMPLE_app.c
26492650
26502651CFE_TBL_Handle_t MyTableHandle; /* Handle to MyTable */
@@ -2679,7 +2680,7 @@ Application can obtain a pointer to the start of the data within the
26792680Table using the CFE_TBL_GetAddress or CFE_TBL_GetAddresses APIs. An example
26802681of this is shown in Section 8.5.1.
26812682
2682- ```
2683+ ``` c
26832684{
26842685 int32 Status = CFE_SUCCESS;
26852686 SAMPLE_MyTable_t * MyTblPtr;
@@ -2772,7 +2773,7 @@ assigning and creating a validation function is a fairly simple process.
27722773To use the function, the Application should periodically identify when a
27732774Table Validation Request has been made as shown below:
27742775
2775- ```
2776+ ``` c
27762777{
27772778 int32 Status = CFE_SUCCESS;
27782779 boolean FinishedManaging = FALSE;
@@ -2821,7 +2822,7 @@ the Table with default values or when the Application is changing modes
28212822and wishes to use a different parameter set. An example of this can be
28222823seen below:
28232824
2824- ```
2825+ ``` c
28252826FILE: sample_app.c
28262827
28272828CFE_TBL_Handle_t MyTableHandle /* Handle to MyTable */
@@ -2847,7 +2848,7 @@ SAMPLE_MyTable_t MyTblInitData = { 0x1234, 0x5678, { 2, 3, 4, ... }, ...};
28472848If a developer wishes to load the table from a file rather than from a
28482849memory image, the code would look something like the following:
28492850
2850- ```
2851+ ```c
28512852{
28522853 int32 Status;
28532854
@@ -2898,6 +2899,7 @@ A typical layout of table-related files within an application (xx) is shown
28982899below. Note that this does not show all of an application's files, just those
28992900related to tables.
29002901
2902+ ```
29012903xx
29022904 |----fsw
29032905 |----src
@@ -2910,27 +2912,28 @@ xx
29102912 |
29112913 |----platform_inc
29122914 |----xx_platform_cfg.h
2915+ ```
29132916
2914- The xx_app.h file is included in this layout only because table handles are
2915- typically stored in an application's AppData_t structure.
2917+ The ` xx_app.h ` file is included in this layout only because table handles are
2918+ typically stored in an application's ` AppData_t ` structure.
29162919
2917- The file xx_tbldefs.h (sometimes just named xx_tbl.h) typically contains the
2920+ The file ` xx_tbldefs.h ` (sometimes just named ` xx_tbl.h ` ) typically contains the
29182921structure definition of a single table entry. This file is included in the
2919- xx_table1.c file where the table itself is defined. It may also contain
2922+ ` xx_table1.c ` file where the table itself is defined. It may also contain
29202923declarations for table-related utility functions.
29212924
2922- The xx_tbl.c file typically contains table-related utility functions. For
2925+ The ` xx_tbl.c ` file typically contains table-related utility functions. For
29232926instance, many applications define table initialization and validation functions
29242927in this file.
29252928
2926- The xx_table1.c file is the source code for a table itself.
2929+ The ` xx_table1.c ` file is the source code for a table itself.
29272930
2928- The xx_platform_cfg.h file contains configuration parameters for applications,
2931+ The ` xx_platform_cfg.h ` file contains configuration parameters for applications,
29292932and there are typically several configuration parameters associated with tables.
29302933
29312934### 8.5.1 Table Files Example
29322935
2933- ```
2936+ ``` c
29342937FILE: xx_app.h
29352938
29362939...
@@ -2945,7 +2948,7 @@ XX_AppData_t XX_AppData;
29452948...
29462949```
29472950
2948- ```
2951+ ``` c
29492952FILE: xx_tbldefs.h
29502953
29512954...
@@ -2968,7 +2971,7 @@ int32 XX_ValidateTable(void *TableData);
29682971...
29692972```
29702973
2971- ```
2974+ ```c
29722975FILE: xx_tbl.c
29732976
29742977#include xx_tbldefs.h
@@ -3028,7 +3031,7 @@ int32 XX_ValidateTable(void *TableData)
30283031}
30293032```
30303033
3031- ```
3034+ ``` c
30323035FILE: xx_table1.c
30333036
30343037#include " cfe.h"
@@ -3054,7 +3057,7 @@ XX_MyTable_t XX_MyTable =
30543057};
30553058```
30563059
3057- ```
3060+ ```c
30583061FILE: xx_platform_cfg.h
30593062
30603063#define XX_APP_NAME "XX"
@@ -3071,7 +3074,7 @@ In order to build application tables with the CMake build system, the
30713074application is structured with a "Tables" directory, another
30723075"aux_source_directory" may need to be added as well.
30733076
3074- ```
3077+ ``` cmake
30753078aux_source_directory(fsw/tables APP_TABLE_FILES)
30763079
30773080# Create the app module
@@ -3106,7 +3109,7 @@ standard file header.
31063109
31073110The structure of the standard file header is as follows:
31083111
3109- ```
3112+ ``` c
31103113typedef struct
31113114{
31123115 uint32 ContentType; /* Identifies the content type (magic #=’cFE1’) */
@@ -3215,7 +3218,7 @@ integer represents the number of seconds and the second integer
32153218represents the number of ` 2^-32 ` seconds. The data structure for this
32163219representation of time is as follows:
32173220
3218- ```
3221+ ``` c
32193222typedef struct {
32203223 uint32 Seconds; /* Number of seconds */
32213224 uint32 Subseconds; /* Number of 2^(-32) subseconds */
@@ -3420,7 +3423,7 @@ the first time in the subtraction. Otherwise, as shown above, the delta
34203423time between two absolute times could either be 5 hours or 7 hours. An
34213424example of a delta time computation function is shown below:
34223425
3423- ```
3426+ ``` c
34243427CFE_TIME_SysTime_t ComputeDeltaTime (CFE_TIME_SysTime_t TimeA,
34253428 CFE_TIME_SysTime_t TimeB)
34263429{
0 commit comments