-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bani100
committed
Dec 11, 2024
1 parent
b25f2c1
commit f12a767
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
* @file a653_i_time.c | ||
* @copyright Airbus Defence and Space | ||
* @author [email protected] | ||
* @date Tue Oct 24 15:53:18 CEST 2023 | ||
* @date Wed 11 Dec 2024 04:07:47 AM EST | ||
* @brief a653 timer handling | ||
* @details | ||
*/ | ||
|
@@ -45,9 +45,11 @@ | |
#include "a653Process.h" | ||
|
||
|
||
void TIMED_WAIT (SYSTEM_TIME_TYPE DELAY_TIME, | ||
void TIMED_WAIT (SYSTEM_TIME_TYPE DELAY_TIME, /* */ | ||
RETURN_CODE_TYPE * RETURN_CODE){ | ||
usleep(40000); | ||
|
||
/* int usleep(useconds_t usec); */ | ||
usleep(DELAY_TIME / 1000); | ||
} | ||
|
||
void PERIODIC_WAIT (RETURN_CODE_TYPE * RETURN_CODE){ | ||
|
@@ -58,10 +60,21 @@ void PERIODIC_WAIT (RETURN_CODE_TYPE * RETURN_CODE){ | |
|
||
void GET_TIME (SYSTEM_TIME_TYPE * SYSTEM_TIME, | ||
RETURN_CODE_TYPE * RETURN_CODE){ | ||
|
||
struct timespec tp; | ||
|
||
if (0 == clock_gettime(CLOCK_REALTIME, &tp)){ | ||
*SYSTEM_TIME = (tp.tv_sec * 10^9) + tp.tv_nsec; | ||
*RETURN_CODE = NO_ERROR; | ||
} else { | ||
*SYSTEM_TIME = 0; | ||
*RETURN_CODE = NOT_AVAILABLE; | ||
} | ||
} | ||
|
||
void REPLENISH (SYSTEM_TIME_TYPE BUDGET_TIME, | ||
RETURN_CODE_TYPE * RETURN_CODE){ | ||
printDebug(1,"not implemented yet!!!\n\n"); | ||
} | ||
|
||
|