-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fix #429, add OS_time_t access functions #723
Fix #429, add OS_time_t access functions #723
Conversation
This initial change can be reviewed and merged at any time; does not depend on any other change an does not break anything, but we need to get these access functions in place first in order to fix CFE/PSP code. |
Do not access members of OS_time_t directly, instead use conversion/accessor inline functions to get the desired value. Update the "stat" structure output by OS_stat to use the OS_time_t struct instead of int32, and update the OS_stat implemention to transfer the full resolution if it supports it (POSIX.1-2008 or newer).
9bd1055
to
ccbaca0
Compare
Amended to also include a conversion from "subseconds" (2^-32) back to
This can replace |
Did you add unit tests and stubs for all the new APIs? |
There are no stubs because these are all |
Add test cases to coverage test to validate all basic OS_time_t access operations and conversions.
CCB 2021-01-06 APPROVED |
Two comments regarding recent review:
|
Add OS_TimeAssembleFromMilliseconds and OS_TimeAssembleFromMicroseconds for a complete set of conversion routines in both directions.
Update - commit f09c57e adds two more conversions to create an |
@jphickey please check conflicts |
Nevermind, I think I got it. See b30e58d and CI run at https://github.com/nasa/cFS/pull/174/checks?sha=1a5438081bd92d28fa59b5d3042ea24629d38763 |
Fix nasa#723, CFE_EVS_Register const correct and report truncation
Describe the contribution
Initially the first commit just adds access functions to convert/extract different units from an
OS_time_t
value - so that other code in CFE/PSP/Apps can be updated to use the access functions and thereby not break when the internal time definition changes. There will then be a second commit that updates the actual time format.It also uses OS_time_t in the "stat" structure used by the file module rather than having this be a
int32
.Minor detail - also updates the pointer argument to
OS_SetLocalTime()
to beconst
Fixes #429
Testing performed
Build and sanity check CFE
Expected behavior changes
Initially just a set of new access functions - no impact to behavior
Eventually will change the internal format of
OS_time_t
which will break any code that is not using the access functions.Prototype change of
OS_SetLocalTime()
should be backward compatible.System(s) tested on
Ubuntu 20.04
RTEMS 4.11.3
Additional context
Initial commit which just adds the access functions and updates OSAL can be merged at any time, it does not have any dependencies and does not break anything.
Second commit will depend on nasa/cFE#1051 and nasa/PSP#227 (may be a separate PR depending on how review/merge cycles go)
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.