diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index bbfaaf947..9a2865a65 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -23,7 +23,7 @@ jobs: checkout-and-cache: name: Custom checkout and cache for cFS documents needs: checks-for-duplicates - if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' }} + if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'main') }} runs-on: ubuntu-latest steps: @@ -53,7 +53,7 @@ jobs: target: "[\"cfe-usersguide\"]" cache-key: cfs-doc-${{ github.run_number }} buildpdf: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} - deploy: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} + deploy: false # Note can't use cache with deploy, deploy in following job instead build-mission-doc: needs: checkout-and-cache @@ -65,3 +65,28 @@ jobs: cache-key: cfs-doc-${{ github.run_number }} deploy: false buildpdf: false # No need for mission pdf within cFE, done at bundle level + + deploy-documentation: + needs: build-cfe-usersguide + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} + name: Deploy documentation to gh-pages + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - name: Move pdfs to deployment directory + run: mkdir deploy; mv */*.pdf deploy + + - name: Deploy to GitHub + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: deploy + SINGLE_COMMIT: true diff --git a/README.md b/README.md index dd1db8ddc..6c76e80f7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,16 @@ The detailed cFE user's guide can be viewed at and + ### Development Build: v7.0.0-rc4+dev110 - Only increment SB InternalErrorCounter on errors diff --git a/cmake/sample_defs/arch_build_custom.cmake b/cmake/sample_defs/arch_build_custom.cmake index 77fc54a64..a7ebb1a6b 100644 --- a/cmake/sample_defs/arch_build_custom.cmake +++ b/cmake/sample_defs/arch_build_custom.cmake @@ -26,13 +26,15 @@ # and uses the same warning options that are applied at the mission level. # add_compile_options( - -std=c99 # Target the C99 standard (without gcc extensions) - -pedantic # Issue all the warnings demanded by strict ISO C - -Wall # Warn about most questionable operations - -Wstrict-prototypes # Warn about missing prototypes - -Wwrite-strings # Warn if not treating string literals as "const" - -Wpointer-arith # Warn about suspicious pointer operations - -Wcast-align # Warn about casts that increase alignment requirements - -Werror # Treat warnings as errors (code should be clean) + -std=c99 # Target the C99 standard (without gcc extensions) + -pedantic # Issue all the warnings demanded by strict ISO C + -Wall # Warn about most questionable operations + -Wstrict-prototypes # Warn about missing prototypes + -Wwrite-strings # Warn if not treating string literals as "const" + -Wpointer-arith # Warn about suspicious pointer operations + -Wcast-align # Warn about casts that increase alignment requirements + -Werror # Treat warnings as errors (code should be clean) + -Wno-format-truncation # Inhibit printf-style format truncation warnings + -Wno-stringop-truncation # Inhibit string operation truncation warnings ) diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index ca8601fe6..ed2332b2c 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -180,12 +180,14 @@ ** Hour - 0 to 23 ** Minute - 0 to 59 ** Second - 0 to 59 +** Micros - 0 to 999999 */ #define CFE_MISSION_TIME_EPOCH_YEAR 1980 #define CFE_MISSION_TIME_EPOCH_DAY 1 #define CFE_MISSION_TIME_EPOCH_HOUR 0 #define CFE_MISSION_TIME_EPOCH_MINUTE 0 #define CFE_MISSION_TIME_EPOCH_SECOND 0 +#define CFE_MISSION_TIME_EPOCH_MICROS 0 /** ** \cfetimecfg Time File System Factor diff --git a/cmake/sample_defs/toolchain-i686-rtems4.11.cmake b/cmake/sample_defs/toolchain-i686-rtems4.11.cmake index 92b9d73f7..8ae67d777 100644 --- a/cmake/sample_defs/toolchain-i686-rtems4.11.cmake +++ b/cmake/sample_defs/toolchain-i686-rtems4.11.cmake @@ -14,23 +14,63 @@ set(CMAKE_SYSTEM_NAME RTEMS) set(CMAKE_SYSTEM_PROCESSOR i386) set(CMAKE_SYSTEM_VERSION 4.11) +# The RTEMS BSP that will be used for this build +set(RTEMS_BSP "pc686") + +# these settings are specific to cFE/OSAL and determines which +# abstraction layers are built when using this toolchain +SET(CFE_SYSTEM_PSPNAME pc-rtems) +SET(OSAL_SYSTEM_BSPTYPE pc-rtems) +SET(OSAL_SYSTEM_OSTYPE rtems) + +# This is for version specific RTEMS ifdefs needed by the OSAL and PSP +ADD_DEFINITIONS(-DOS_RTEMS_4_DEPRECATED) + +# RTEMS_DYNAMIC_LOAD definition: +# - Set to FALSE for platforms that create a RTEMS executable and link it +# to the cFE core. +# - Set to TRUE for platforms that expect the cFE core to to be dynamically +# loaded into an existing runtime image. +# This is tied to the OSAL-BSP and PSP implementation so generally cannot +# be switched on a specific OSAL/PSP platform without modifications. +set(RTEMS_DYNAMIC_LOAD FALSE) + +set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") +set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) +set(RTEMS_BSP_SPECS_FLAGS "-specs bsp_specs") + +# This define is deprecated and will be removed +ADD_DEFINITIONS(-D_RTEMS_411_) + +# Info regarding the RELOCADDR: +#+--------------------------------------------------------------------------+ +#| Set the value of RELOCADDR to the address where you want your image to +#| load. If you'll be using GRUB to load the images it will have to be >= +#| 0x100000 (1024K). If you are using NetBoot to load the images it can be +#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory +#| top is of course another limit. Make sure there is enough space before the +#| upper memory limits for the image and the memory allocated by it to fit. +#| Make sure the value you choose is aligned to 4 bytes. +#+--------------------------------------------------------------------------+ +set(RTEMS_RELOCADDR 0x00100000) + +# Exception handling is very iffy. These two options disable eh_frame creation. +set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) + +#+---------------------------------------------------------------------------+ +#| Common RTEMS toolchain statements +#+---------------------------------------------------------------------------+ # The TOOLS and BSP are allowed to be installed in different locations. # If the README was followed they will both be installed under $HOME # By default it is assumed the BSP is installed to the same directory as the tools -SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH +SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH "RTEMS tools install directory") -SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH +SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH "RTEMS BSP install directory") -# The BSP that will be used for this build -set(RTEMS_BSP "pc686") - # specify the cross compiler - adjust accord to compiler installation -# This uses the compiler-wrapper toolchain that buildroot produces SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin") set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") -set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") -set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc") SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++") @@ -42,9 +82,6 @@ SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar") SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump") SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy") -# Exception handling is very iffy. These two options disable eh_frame creation. -set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) - # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -53,23 +90,3 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_PREFIX_PATH /) - -# these settings are specific to cFE/OSAL and determines which -# abstraction layers are built when using this toolchain -SET(CFE_SYSTEM_PSPNAME pc-rtems) -SET(OSAL_SYSTEM_BSPTYPE pc-rtems) -SET(OSAL_SYSTEM_OSTYPE rtems) - -# Info regarding the RELOCADDR: -#+--------------------------------------------------------------------------+ -#| Set the value of RELOCADDR to the address where you want your image to -#| load. If you'll be using GRUB to load the images it will have to be >= -#| 0x100000 (1024K). If you are using NetBoot to load the images it can be -#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory -#| top is of course another limit. Make sure there is enough space before the -#| upper memory limits for the image and the memory allocated by it to fit. -#| Make sure the value you choose is aligned to 4 bytes. -#+--------------------------------------------------------------------------+ -set(RTEMS_RELOCADDR 0x00100000) - - diff --git a/cmake/sample_defs/toolchain-i686-rtems5.cmake b/cmake/sample_defs/toolchain-i686-rtems5.cmake index fa1212832..16d74c437 100644 --- a/cmake/sample_defs/toolchain-i686-rtems5.cmake +++ b/cmake/sample_defs/toolchain-i686-rtems5.cmake @@ -14,24 +14,67 @@ set(CMAKE_SYSTEM_NAME RTEMS) set(CMAKE_SYSTEM_PROCESSOR i386) set(CMAKE_SYSTEM_VERSION 5) +# The RTEMS BSP that will be used for this build +set(RTEMS_BSP "pc686") + +# these settings are specific to cFE/OSAL and determines which +# abstraction layers are built when using this toolchain +SET(CFE_SYSTEM_PSPNAME pc-rtems) +SET(OSAL_SYSTEM_BSPTYPE pc-rtems) +SET(OSAL_SYSTEM_OSTYPE rtems) + +# This is for version specific RTEMS ifdefs needed by the OSAL and PSP +ADD_DEFINITIONS(-DOS_RTEMS_5) + +# RTEMS_DYNAMIC_LOAD definition: +# - Set to FALSE for platforms that create a RTEMS executable and link it +# to the cFE core. +# - Set to TRUE for platforms that expect the cFE core to to be dynamically +# loaded into an existing runtime image. +# This is tied to the OSAL-BSP and PSP implementation so generally cannot +# be switched on a specific OSAL/PSP platform without modifications. +set(RTEMS_DYNAMIC_LOAD FALSE) + +set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") +set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) +set(RTEMS_BSP_SPECS_FLAGS "-specs bsp_specs") + +# This define is deprecated and will be removed +ADD_DEFINITIONS(-D_RTEMS_5_) + +# Info regarding the RELOCADDR: +#+--------------------------------------------------------------------------+ +#| Set the value of RELOCADDR to the address where you want your image to +#| load. If you'll be using GRUB to load the images it will have to be >= +#| 0x100000 (1024K). If you are using NetBoot to load the images it can be +#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory +#| top is of course another limit. Make sure there is enough space before the +#| upper memory limits for the image and the memory allocated by it to fit. +#| Make sure the value you choose is aligned to 4 bytes. +#+--------------------------------------------------------------------------+ +set(RTEMS_RELOCADDR 0x00100000) + +# Exception handling is very iffy. These two options disable eh_frame creation. +set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) + +# Link libraries needed for a RTEMS 5+ executable +# This was handled by the bsp_specs file in 4.11 +set(LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu") + +#+---------------------------------------------------------------------------+ +#| Common RTEMS toolchain statements +#+---------------------------------------------------------------------------+ # The TOOLS and BSP are allowed to be installed in different locations. # If the README was followed they will both be installed under $HOME # By default it is assumed the BSP is installed to the same directory as the tools -SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH +SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH "RTEMS tools install directory") -SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH +SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH "RTEMS BSP install directory") -# The BSP that will be used for this build -set(RTEMS_BSP "pc686") - # specify the cross compiler - adjust accord to compiler installation -# This uses the compiler-wrapper toolchain that buildroot produces SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin") set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") -set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") -set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) - SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc") SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++") @@ -43,13 +86,6 @@ SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar") SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump") SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy") -# Exception handling is very iffy. These two options disable eh_frame creation. -set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) - -# Link libraries needed for an RTEMS 5.x executable -# This was handled by the bsp_specs file in 4.11 -set(LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu") - # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -58,26 +94,3 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_PREFIX_PATH /) - -# these settings are specific to cFE/OSAL and determines which -# abstraction layers are built when using this toolchain -SET(CFE_SYSTEM_PSPNAME pc-rtems) -SET(OSAL_SYSTEM_BSPTYPE pc-rtems) -SET(OSAL_SYSTEM_OSTYPE rtems) - -# This is for RTEMS 5 specific ifdefs needed by the OSAL -ADD_DEFINITIONS(-D_RTEMS_5_) - -# Info regarding the RELOCADDR: -#+--------------------------------------------------------------------------+ -#| Set the value of RELOCADDR to the address where you want your image to -#| load. If you'll be using GRUB to load the images it will have to be >= -#| 0x100000 (1024K). If you are using NetBoot to load the images it can be -#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory -#| top is of course another limit. Make sure there is enough space before the -#| upper memory limits for the image and the memory allocated by it to fit. -#| Make sure the value you choose is aligned to 4 bytes. -#+--------------------------------------------------------------------------+ -set(RTEMS_RELOCADDR 0x00100000) - - diff --git a/cmake/sample_defs/toolchain-i686-rtems6.cmake b/cmake/sample_defs/toolchain-i686-rtems6.cmake new file mode 100644 index 000000000..03aa5c289 --- /dev/null +++ b/cmake/sample_defs/toolchain-i686-rtems6.cmake @@ -0,0 +1,93 @@ +# This example toolchain file describes the cross compiler to use for +# the target architecture indicated in the configuration file. + +# In this sample application, the cross toolchain is configured to +# use a compiler for the RTEMS operating system targeting the "pc686" BSP + +# Note that to use this, the "RTEMS" platform module may need to be added +# to the system-wide CMake installation as a default CMake does not yet +# recognize RTEMS as a system name. An example of this is distributed with +# the pc-rtems PSP. + +# Basic cross system configuration +set(CMAKE_SYSTEM_NAME RTEMS) +set(CMAKE_SYSTEM_PROCESSOR i386) +set(CMAKE_SYSTEM_VERSION 6) + +# The RTEMS BSP that will be used for this build +set(RTEMS_BSP "pc686") + +# these settings are specific to cFE/OSAL and determines which +# abstraction layers are built when using this toolchain +SET(CFE_SYSTEM_PSPNAME pc-rtems) +SET(OSAL_SYSTEM_BSPTYPE pc-rtems) +SET(OSAL_SYSTEM_OSTYPE rtems) + +# This is for version specific RTEMS ifdefs needed by the OSAL and PSP +ADD_DEFINITIONS(-DOS_RTEMS_6) + +# RTEMS_DYNAMIC_LOAD definition: +# - Set to FALSE for platforms that create a RTEMS executable and link it +# to the cFE core. +# - Set to TRUE for platforms that expect the cFE core to to be dynamically +# loaded into an existing runtime image. +# This is tied to the OSAL-BSP and PSP implementation so generally cannot +# be switched on a specific OSAL/PSP platform without modifications. +set(RTEMS_DYNAMIC_LOAD FALSE) + +set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common") +set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS}) +set(RTEMS_BSP_SPECS_FLAGS "") + +# Info regarding the RELOCADDR: +#+--------------------------------------------------------------------------+ +#| Set the value of RELOCADDR to the address where you want your image to +#| load. If you'll be using GRUB to load the images it will have to be >= +#| 0x100000 (1024K). If you are using NetBoot to load the images it can be +#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory +#| top is of course another limit. Make sure there is enough space before the +#| upper memory limits for the image and the memory allocated by it to fit. +#| Make sure the value you choose is aligned to 4 bytes. +#+--------------------------------------------------------------------------+ +set(RTEMS_RELOCADDR 0x00100000) + +# Exception handling is very iffy. These two options disable eh_frame creation. +set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables) + +# Link libraries needed for a RTEMS 5+ executable +# This was handled by the bsp_specs file in 4.11 +set(LINK_LIBRARIES "-lrtemsdefaultconfig -lrtemsbsp -lrtemscpu") + +#+---------------------------------------------------------------------------+ +#| Common RTEMS toolchain statements +#+---------------------------------------------------------------------------+ +# The TOOLS and BSP are allowed to be installed in different locations. +# If the README was followed they will both be installed under $HOME +# By default it is assumed the BSP is installed to the same directory as the tools +SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH + "RTEMS tools install directory") +SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH + "RTEMS BSP install directory") + +# specify the cross compiler - adjust accord to compiler installation +SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin") +set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-") + +SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc") +SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++") +SET(CMAKE_LINKER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ld") +SET(CMAKE_ASM_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}as") +SET(CMAKE_STRIP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}strip") +SET(CMAKE_NM "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}nm") +SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar") +SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump") +SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy") + +# search for programs in the build host directories +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + +# for libraries and headers in the target directories +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +SET(CMAKE_PREFIX_PATH /) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index ba31cc0c8..d332f8ff3 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -3391,7 +3391,7 @@ seconds past the epoch time. The drawback to allowing rollovers is that this adds an interesting dilemma to comparing two absolute times. Going back to our analog wall -clock analogy, let us assume we wish to compute determine whether 9:00 +clock analogy, let us assume we wish to determine whether 9:00 is before or after 2:00. Since the clock is allowed to roll over, which is first? As shown below, 9:00 is either 5 hours before 2:00 or it is 7 hours later. diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index f697cef69..a11ce3c8a 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -26,7 +26,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 110 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ +#define CFE_BUILD_NUMBER 127 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */ #define CFE_BUILD_BASELINE "v7.0.0-rc4" /**< @brief Development: Reference git tag for build number */ /* See \ref cfsversions for definitions */ diff --git a/modules/time/fsw/src/cfe_time_api.c b/modules/time/fsw/src/cfe_time_api.c index 3c3ffbf02..2f935da67 100644 --- a/modules/time/fsw/src/cfe_time_api.c +++ b/modules/time/fsw/src/cfe_time_api.c @@ -619,9 +619,13 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) /* ** Convert the cFE time (offset from epoch) into calendar time... */ - NumberOfMinutes = (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE; - NumberOfSeconds = (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND; + NumberOfMicros = CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS; + NumberOfMinutes = (NumberOfMicros / 60000000) + (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE; + NumberOfMicros = NumberOfMicros % 60000000; + + NumberOfSeconds = (NumberOfMicros / 1000000) + (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND; + NumberOfMicros = NumberOfMicros % 1000000; /* ** Adding the epoch "seconds" after computing the minutes avoids ** overflow problems when the input time value (seconds) is @@ -698,7 +702,7 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint) /* ** After computing microseconds, convert to 5 digits from 6 digits... */ - NumberOfMicros = CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) / 10; + NumberOfMicros = NumberOfMicros / 10; /* ** Build formatted output string (yyyy-ddd-hh:mm:ss.xxxxx)... diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 1dca60f98..726873983 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -300,13 +300,12 @@ void Test_Init(void) UtAssert_INT32_EQ(CFE_TIME_TaskInit(), ExpRtn); - /* Test response to failure of the fake tone signal commands + /* Test response to failure of the 1Hz signal commands * subscription */ UT_InitData(); ExpRtn = 0; -#if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) #if (CFE_PLATFORM_TIME_CFG_CLIENT == true) SubErrCnt++; UT_SetDeferredRetcode(UT_KEY(CFE_SB_Subscribe), SubErrCnt, -SubErrCnt); @@ -320,9 +319,6 @@ void Test_Init(void) #endif UtAssert_INT32_EQ(CFE_TIME_TaskInit(), ExpRtn); -#else - UtAssert_NA("*Not tested* Fake tone signal commands subscription failure"); -#endif /* Test response to failure of the time at tone signal commands * subscription @@ -837,7 +833,7 @@ void Test_Print(void) UtPrintf("Begin Test Print"); if (CFE_MISSION_TIME_EPOCH_YEAR != 1980 || CFE_MISSION_TIME_EPOCH_DAY != 1 || CFE_MISSION_TIME_EPOCH_HOUR != 0 || - CFE_MISSION_TIME_EPOCH_MINUTE != 0 || CFE_MISSION_TIME_EPOCH_SECOND != 0) + CFE_MISSION_TIME_EPOCH_MINUTE != 0 || CFE_MISSION_TIME_EPOCH_SECOND != 0 || CFE_MISSION_TIME_EPOCH_MICROS != 0) { UtPrintf("Custom epoch time requires manual inspection for CFE_TIME_Print"); usingDefaultEpoch = false; @@ -1210,11 +1206,11 @@ void Test_External(void) * state not set */ UT_InitData(); - CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; - CFE_TIME_Global.ClockSetState = CFE_TIME_SetState_NOT_SET; - CFE_TIME_Global.ExternalCount = 0; - settime.Seconds = 0; - settime.Subseconds = 0; + CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; + CFE_TIME_Global.ReferenceState[0].ClockSetState = CFE_TIME_SetState_NOT_SET; + CFE_TIME_Global.ExternalCount = 0; + settime.Seconds = 0; + settime.Subseconds = 0; CFE_TIME_ExternalTime(settime); UtAssert_UINT32_EQ(CFE_TIME_Global.ExternalCount, 1); @@ -1222,23 +1218,23 @@ void Test_External(void) * state set and time less than the minimum */ UT_InitData(); - CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; - CFE_TIME_Global.ClockSetState = CFE_TIME_SetState_WAS_SET; - settime.Seconds = 0; - settime.Subseconds = 0; - CFE_TIME_Global.InternalCount = 0; - CFE_TIME_Global.AtToneMET.Seconds = 0; - CFE_TIME_Global.AtToneMET.Subseconds = 0; - CFE_TIME_Global.AtToneSTCF.Seconds = 10; - CFE_TIME_Global.AtToneSTCF.Subseconds = 0; - CFE_TIME_Global.AtToneDelay.Seconds = 0; - CFE_TIME_Global.AtToneDelay.Subseconds = 0; - CFE_TIME_Global.AtToneLatch.Seconds = 0; - CFE_TIME_Global.AtToneLatch.Subseconds = 0; - CFE_TIME_Global.MaxDelta.Seconds = 0; - CFE_TIME_Global.MaxDelta.Subseconds = 1; - CFE_TIME_Global.MaxLocalClock.Seconds = 0; - CFE_TIME_Global.MaxLocalClock.Subseconds = 0; + CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; + CFE_TIME_Global.ReferenceState[0].ClockSetState = CFE_TIME_SetState_WAS_SET; + settime.Seconds = 0; + settime.Subseconds = 0; + CFE_TIME_Global.InternalCount = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Seconds = 10; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Subseconds = 0; + CFE_TIME_Global.MaxDelta.Seconds = 0; + CFE_TIME_Global.MaxDelta.Subseconds = 1; + CFE_TIME_Global.MaxLocalClock.Seconds = 0; + CFE_TIME_Global.MaxLocalClock.Subseconds = 0; UT_SetBSP_Time(0, 0); CFE_TIME_ExternalTime(settime); UtAssert_INT32_EQ(CFE_TIME_Global.InternalCount, 1); @@ -1247,46 +1243,46 @@ void Test_External(void) * state set and time greater than the maximum */ UT_InitData(); - CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; - CFE_TIME_Global.ClockSetState = CFE_TIME_SetState_WAS_SET; - settime.Seconds = 20; - settime.Subseconds = 0; - CFE_TIME_Global.InternalCount = 0; - CFE_TIME_Global.AtToneMET.Seconds = 0; - CFE_TIME_Global.AtToneMET.Subseconds = 0; - CFE_TIME_Global.AtToneSTCF.Seconds = 10; - CFE_TIME_Global.AtToneSTCF.Subseconds = 0; - CFE_TIME_Global.AtToneDelay.Seconds = 0; - CFE_TIME_Global.AtToneDelay.Subseconds = 0; - CFE_TIME_Global.AtToneLatch.Seconds = 0; - CFE_TIME_Global.AtToneLatch.Subseconds = 0; - CFE_TIME_Global.MaxDelta.Seconds = 0; - CFE_TIME_Global.MaxDelta.Subseconds = 1; - CFE_TIME_Global.MaxLocalClock.Seconds = 0; - CFE_TIME_Global.MaxLocalClock.Subseconds = 0; + CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; + CFE_TIME_Global.ReferenceState[0].ClockSetState = CFE_TIME_SetState_WAS_SET; + settime.Seconds = 20; + settime.Subseconds = 0; + CFE_TIME_Global.InternalCount = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Seconds = 10; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Subseconds = 0; + CFE_TIME_Global.MaxDelta.Seconds = 0; + CFE_TIME_Global.MaxDelta.Subseconds = 1; + CFE_TIME_Global.MaxLocalClock.Seconds = 0; + CFE_TIME_Global.MaxLocalClock.Subseconds = 0; UT_SetBSP_Time(0, 0); CFE_TIME_ExternalTime(settime); UtAssert_UINT32_EQ(CFE_TIME_Global.InternalCount, 1); /* Test setting time data from Time (external source, state set) */ UT_InitData(); - CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; - CFE_TIME_Global.ClockSetState = CFE_TIME_SetState_WAS_SET; - settime.Seconds = 10; - settime.Subseconds = 0; - CFE_TIME_Global.ExternalCount = 0; - CFE_TIME_Global.AtToneMET.Seconds = 0; - CFE_TIME_Global.AtToneMET.Subseconds = 0; - CFE_TIME_Global.AtToneSTCF.Seconds = 10; - CFE_TIME_Global.AtToneSTCF.Subseconds = 0; - CFE_TIME_Global.AtToneDelay.Seconds = 0; - CFE_TIME_Global.AtToneDelay.Subseconds = 0; - CFE_TIME_Global.AtToneLatch.Seconds = 0; - CFE_TIME_Global.AtToneLatch.Subseconds = 0; - CFE_TIME_Global.MaxDelta.Seconds = 0; - CFE_TIME_Global.MaxDelta.Subseconds = 1; - CFE_TIME_Global.MaxLocalClock.Seconds = 0; - CFE_TIME_Global.MaxLocalClock.Subseconds = 0; + CFE_TIME_Global.ClockSource = CFE_TIME_SourceSelect_EXTERNAL; + CFE_TIME_Global.ReferenceState[0].ClockSetState = CFE_TIME_SetState_WAS_SET; + settime.Seconds = 10; + settime.Subseconds = 0; + CFE_TIME_Global.ExternalCount = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneMET.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Seconds = 10; + CFE_TIME_Global.ReferenceState[0].AtToneSTCF.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneDelay.Subseconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Seconds = 0; + CFE_TIME_Global.ReferenceState[0].AtToneLatch.Subseconds = 0; + CFE_TIME_Global.MaxDelta.Seconds = 0; + CFE_TIME_Global.MaxDelta.Subseconds = 1; + CFE_TIME_Global.MaxLocalClock.Seconds = 0; + CFE_TIME_Global.MaxLocalClock.Subseconds = 0; UT_SetBSP_Time(0, 0); CFE_TIME_ExternalTime(settime); UtAssert_UINT32_EQ(CFE_TIME_Global.ExternalCount, 1);