GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > THS / V1-5-2
Constituent: thstest     Tag: mv2304
#include "PBS/PBS.h"
#include "PBS/WCT.h"
#include "PBS/TASK.h"
#include "PBS/TMR.h"
#include "PBS/LSU.h"
#include "PBS/MBA.h"
#include "PBS/FPA.h"
#include "PBS/BSWP.ih"
#include "LCBD/LCBD.h"
#include "MSG/MSG_pubdefs.h"
#include "THS/THS_msgs.h"
#include "THS_prvdefs.h"
#include <stdio.h>
Include dependency graph for THS.c:
Functions | |
unsigned int | THS_init (int mask) |
Inits the TimeHackService module. | |
unsigned int | THS_wait () |
Wait for TimeHackService module to be fully operational. | |
unsigned int | THS_timetone (unsigned int absTimeSec, unsigned short saFlags) |
Provide absTime for next entry in table (on next PPS). | |
unsigned int | THS_getLastPpsAbsTimeSec () |
Get the absolute time value at last PPS. | |
void | THS_stats () |
Print some THS statistics. | |
void | THS_setPpsWarnEvery (unsigned int warnPpsEvery) |
Set how often get warning when no PPS. | |
void | THS_setTimetoneWarnEvery (unsigned int warnTimetoneEvery) |
Set how often get warning when no timetone. | |
void | THS_setGemUpdateMsgs (int maxMsgs) |
set size of memory pool for gemUpdate msgs, must be called before THS_init | |
void | THS_setSlaveSend (THS_SendSlaveRtn rtn, void *arg, int lsmID) |
stash away routine (from LCM) to send msg to EPU | |
void | THS_sendSlaveGemSetTableMsg (unsigned int absTime, THS_GemTableFlags flags, unsigned int gemStrobe, LSU_factors Kgem) |
send gmHack from SIU to EPU (this runs on SIU) | |
unsigned int | THS_slaveProcessMsg (int func, void *payload, unsigned int len) |
routine called from ITC dispatch in LSM to process each message it receives (this routine is run on EPU when it receives message) |
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 module only truely works on the Rad750 which has the PPS input thru the PID registers. The mv2304 version can be sort-of simulated by setting up a task to provide PPS (see THS_test.c)
Inputs:
Output:
|
Get the absolute time value at last PPS.
|
|
Inits the TimeHackService module.
|
|
send gmHack from SIU to EPU (this runs on SIU)
|
|
set size of memory pool for gemUpdate msgs, must be called before THS_init
|
|
Set how often get warning when no PPS.
|
|
stash away routine (from LCM) to send msg to EPU
|
|
Set how often get warning when no timetone.
|
|
routine called from ITC dispatch in LSM to process each message it receives (this routine is run on EPU when it receives message)
|
|
Print some THS statistics.
|
|
Provide absTime for next entry in table (on next PPS).
|
|
Wait for TimeHackService module to be fully operational.
The sequence is: THS_init(); 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_wait() (this routine waits till receives two THS_timeTone() followed by PPS interrupt) |