GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> THS / dev > ths / rhel5-64
#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>
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:
unsigned int THS_cpuInit | ( | ) |
Inits the TimeHackService module.
Referenced by THS_init().
void THS_cpuIsr | ( | unsigned int | absTimeSec, | |
int | realPps, | |||
unsigned int | snapshot | |||
) |
interrupt routine for CPU specfic time hack
absTimeSec | absolute time at PPS | |
realPps | 1=indicates snapshot is real, 0=indicates snapshot is estimated | |
snapshot | snapshot clk value at PPS |
unsigned int THS_cpuSetWarning | ( | unsigned int | expectedClkHz, | |
unsigned int | expectedDeltaClkHz | |||
) |
Set range for cpu clock warning messages.
expectedClkHz | - expected clock in Hz, <=0 uses default, (16.6MHz on mv2304, 8.3MHz on Rad750) | |
expectedDeltaClkHz | - expected delta clk in Hz, <0 uses default of 2% of clock |
unsigned int THS_cpuWait | ( | ) |
Start the TimeHackService module.
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)
Referenced by THS_wait().
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.
snapshot | snapshow value from Rad750 HW |