GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > THS / V1-4-1
Constituent: thstest     Tag: rad750
#include "PBS/PBS.h"
#include "PBS/WCT.h"
#include "PBS/TASK.h"
#include "PBS/TMR.h"
#include "PBS/PTS.h"
#include "LCBD/LCBD.h"
#include "MSG/MSG_pubdefs.h"
#include "THS/THS_msgs.h"
#include "THS_prvdefs.h"
Include dependency graph for THS_cpu.c:
Functions | |
unsigned int | THS_cpuInit () |
Inits the TimeHackService module. | |
unsigned int | THS_cpuWait () |
Start the TimeHackService module. | |
unsigned int | THS_getLastPpsClock () |
Get the CPU clk value at last PPS. | |
void | THS_setLastPpsClock (unsigned int snapshot) |
Set the CPU clk value at last PPS. | |
void | THS_cpuIsr (unsigned int absTimeSec, int realPps, unsigned int snapshot) |
interrupt routine for CPU specfic time hack | |
unsigned int | THS_cpuSetWarning (unsigned int expectedClkHz, unsigned int expectedDeltaClkHz) |
Set range for cpu clock warning messages. |
This module handles calculation of absolute time using the "time hack". The absolute (or true) time is provided once a second through a combination of a 1PPS (1 pulse per sec) hardware pulse and a time tone message ("at the tone the time will be") that preceeds it. The time provided in the time tone message from the scapecraft is in microSec since 1/1/2001.
This file has routines for adjusting the time on the CPU clock by using the WCT_set/get routines, therefore one can only get the current time thru WCT_get(). THese are based on a sub-multiple of the CPU's 33 MHz PCI clock.
The determination of the absolute time from event and LCB times is handled in other time hack files.
This module only truely works on the Rad750 which has the PPS input thru the PID registers. The mv2304 version starts up a task to simulate the PPS but it should therefore show no drift (since its locked with the clock)
Inputs:
Output:
|
Inits the TimeHackService module.
|
|
interrupt routine for CPU specfic time hack
CAUTION: THis routine adjusts the WUT timer module and it is very easy to kill the OS when modifying calls to WUT. |
|
Set range for cpu clock warning messages.
|
|
Start the TimeHackService module.
THe module is called within THS.c. The sequence is: THS_cpuInit(); start up bunch of things including Sw to call THS_timeTone() every second as result of message from spacecraft Hw to cause PPS interrupt every second THS_cpuWait() (this routine waits till received first THS_cpuTimeTone() followed by PPS interrupt) |
|
Get the CPU clk value at last PPS.
|
|
Set the CPU clk value at last PPS.
|