Skip to content
Snippets Groups Projects
Commit 952833a6 authored by Rolf Bork's avatar Rolf Bork
Browse files

controllerCymac cleanup. Switched to use controllerko.h like other

kernel object code.
parent a95b3ba2
No related branches found
No related tags found
No related merge requests found
...@@ -28,48 +28,8 @@ ...@@ -28,48 +28,8 @@
///< GNU General Public License for more details. ///< GNU General Public License for more details.
#include <linux/version.h> #include "controllerko.h"
#include <linux/init.h>
#undef printf
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/kthread.h>
#include <asm/delay.h>
#include <asm/cacheflush.h>
#include <linux/slab.h>
/// Can't use printf in kernel module so redefine to use Linux printk function
#define printf printk
#include <drv/cdsHardware.h>
#include "inlineMath.h"
#include <asm/processor.h>
#include <asm/cacheflush.h>
// Code can be run without shutting down CPU by changing this compile flag
#ifndef NO_CPU_SHUTDOWN
extern long ligo_get_gps_driver_offset(void);
#endif
#include "fm10Gen.h" // CDS filter module defs and C code
#include "feComms.h" // Lvea control RFM network defs.
#include "daqmap.h" // DAQ network layout
#include "cds_types.h"
#include "controller.h"
#ifndef NO_DAQ
#include "drv/fb.h"
#include "drv/daqLib.c" // DAQ/GDS connection software
#endif
#include "drv/map.h" // PCI hardware defs
#include "drv/epicsXfer.c" // User defined EPICS to/from FE data transfer function
#include "timing.c" // timing module / IRIG-B functions
#include "drv/inputFilterModule.h"
#include "drv/inputFilterModule1.h"
#ifdef DOLPHIN_TEST #ifdef DOLPHIN_TEST
#include "dolphin.c" #include "dolphin.c"
...@@ -80,7 +40,6 @@ extern long ligo_get_gps_driver_offset(void); ...@@ -80,7 +40,6 @@ extern long ligo_get_gps_driver_offset(void);
TIMING_SIGNAL *pcieTimer; TIMING_SIGNAL *pcieTimer;
#endif #endif
duotone_diag_t dt_diag; duotone_diag_t dt_diag;
// Contec 64 input bits plus 64 output bits (Standard for aLIGO) // Contec 64 input bits plus 64 output bits (Standard for aLIGO)
...@@ -98,13 +57,8 @@ unsigned int CDIO1616InputInput[MAX_DIO_MODULES]; // Binary input bits ...@@ -98,13 +57,8 @@ unsigned int CDIO1616InputInput[MAX_DIO_MODULES]; // Binary input bits
unsigned int CDIO1616Input[MAX_DIO_MODULES]; // Current value of the BO bits unsigned int CDIO1616Input[MAX_DIO_MODULES]; // Current value of the BO bits
/// Contec1616 values to be written to the output register /// Contec1616 values to be written to the output register
unsigned int CDIO1616Output[MAX_DIO_MODULES]; // Binary output bits unsigned int CDIO1616Output[MAX_DIO_MODULES]; // Binary output bits
/// Holds ID number of Contec1616 DIO card(s) used for timing control.
int tdsControl[3]; // Up to 3 timing control modules allowed in case I/O chassis are daisy chained
/// Total number of timing control modules found on bus
int tdsCount = 0;
int adcCycleNum = 0;
int adcCycleNum = 0;
int ioClockDac = DAC_PRELOAD_CNT; int ioClockDac = DAC_PRELOAD_CNT;
int ioMemCntr = 0; int ioMemCntr = 0;
int ioMemCntrDac = DAC_PRELOAD_CNT; int ioMemCntrDac = DAC_PRELOAD_CNT;
...@@ -121,6 +75,7 @@ int dacWatchDog = 0; ...@@ -121,6 +75,7 @@ int dacWatchDog = 0;
int getGpsTime(unsigned int *tsyncSec, unsigned int *tsyncUsec); int getGpsTime(unsigned int *tsyncSec, unsigned int *tsyncUsec);
// Include C code modules // Include C code modules
#include "moduleLoadIop.c" #include "moduleLoadIop.c"
#include "map.c" #include "map.c"
...@@ -166,7 +121,6 @@ void *fe_start(void *arg) ...@@ -166,7 +121,6 @@ void *fe_start(void *arg)
int onePpsTimeTest[10]; /// @param onePpsTimeTest[] One PPS diagnostic check int onePpsTimeTest[10]; /// @param onePpsTimeTest[] One PPS diagnostic check
#endif #endif
int dcuId; /// @param dcuId DAQ ID number for this process int dcuId; /// @param dcuId DAQ ID number for this process
static int missedCycle = 0; /// @param missedCycle Incremented error counter when too many values in ADC FIFO
int diagWord = 0; /// @param diagWord Code diagnostic bit pattern returned to EPICS int diagWord = 0; /// @param diagWord Code diagnostic bit pattern returned to EPICS
int system = 0; int system = 0;
int syncSource = SYNC_SRC_TIMER; /// @param syncSource Code startup synchronization source int syncSource = SYNC_SRC_TIMER; /// @param syncSource Code startup synchronization source
...@@ -183,8 +137,6 @@ void *fe_start(void *arg) ...@@ -183,8 +137,6 @@ void *fe_start(void *arg)
unsigned int usec = 0; unsigned int usec = 0;
unsigned long cpc; unsigned long cpc;
float duotoneTimeDac;
float duotoneTime;
/// **********************************************************************************************\n /// **********************************************************************************************\n
...@@ -319,28 +271,10 @@ adcInfo_t *padcinfo = (adcInfo_t *)&adcinfo; ...@@ -319,28 +271,10 @@ adcInfo_t *padcinfo = (adcInfo_t *)&adcinfo;
iopDacEnable = feCode(cycleNum,dWord,dacOut,dspPtr[0],&dspCoeff[0], (struct CDS_EPICS *)pLocalEpics,1); iopDacEnable = feCode(cycleNum,dWord,dacOut,dspPtr[0],&dspCoeff[0], (struct CDS_EPICS *)pLocalEpics,1);
// Initialize timing info variables // Initialize timing info variables
timeinfo.cpuTimeEverMax = 0; initializeTimingDiags(&timeinfo);
timeinfo.cpuTimeEverMaxWhen = 0;
timeinfo.startGpsTime = 0;
timeinfo.usrHoldTime = 0;
timeinfo.timeHold = 0;
timeinfo.timeHoldHold = 0;
timeinfo.timeHoldWhen = 0;
timeinfo.timeHoldWhenHold = 0;
timeinfo.usrTime = 0;
timeinfo.cycleTime = 0;
missedCycle = 0;
// Initialize duotone measurement signals // Initialize duotone measurement signals
for(ii=0;ii<IOP_IO_RATE;ii++) { initializeDuotoneDiags(&dt_diag);
dt_diag.adc[ii] = 0;
dt_diag.dac[ii] = 0;
}
dt_diag.totalAdc = 0.0;
dt_diag.totalDac = 0.0;
dt_diag.meanAdc = 0.0;
dt_diag.meanDac = 0.0;
dt_diag.dacDuoEnable = 0.0;
/// \> Initialize the ADC modules ************************************* /// \> Initialize the ADC modules *************************************
pLocalEpics->epicsOutput.fe_status = INIT_ADC_MODS; pLocalEpics->epicsOutput.fe_status = INIT_ADC_MODS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment