- Added back calculation from motor positions to Q/E variables into
TAS code. - Fixed communication problems in SerPortServer, mainly with terminator detection. - Added SPS switched motors for TOPSI - Debugged Power-PC histogram memory software for TRICS
This commit is contained in:
@@ -167,13 +167,16 @@
|
||||
if (lwl_hdr.ui4 == LWL_FIFO_EMPTY) {
|
||||
taskDelay (0); /* If FIFO is empty, we can take a breather! */
|
||||
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_HM_NC_C1) {
|
||||
/* Histo data, single channel */
|
||||
VmioBase[VMIO_PORT_A] = 0xff; /* Set timer level (if present) */
|
||||
for (i=0; i<1000; i++) {
|
||||
|
||||
for (i=0; i<1000000; i++) {
|
||||
lwl_data.ui4 = *Lwl_fifo; /* Get the 16 bits of data */
|
||||
if (lwl_data.ui4 != LWL_FIFO_EMPTY) break;
|
||||
taskDelay (0); /* But wait if FIFO is slow! */
|
||||
if (lwl_data.ui4 != LWL_FIFO_EMPTY) {
|
||||
break;
|
||||
}
|
||||
taskDelay (0); /* But wait if FIFO is slow! */
|
||||
}
|
||||
|
||||
if (lwl_data.ui4 == LWL_FIFO_EMPTY) {
|
||||
printf ("Time-out getting histogram data word! Event # = %d\n",
|
||||
N_events);
|
||||
@@ -239,20 +242,24 @@
|
||||
VmioBase[VMIO_PORT_A] = 0x00; /* Reset timer level (if present) */
|
||||
N_events++;
|
||||
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_TSI_HM_NC) {
|
||||
|
||||
process_no_coinc_tsi (lwl_hdr.ui4); /* We have found a "normal"
|
||||
** TSI (Timing-Status-Info) header. Process
|
||||
** it.
|
||||
*/
|
||||
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_TSI_HM_C) {
|
||||
|
||||
process_coinc_tsi (lwl_hdr.ui4); /* We have found a "coincidence"
|
||||
** type TSI header. The packet has 10 bytes
|
||||
** altogether. Process it.
|
||||
*/
|
||||
}else { /* Anything else gets flushed */
|
||||
lwl_Packet_Read (lwl_hdr.ui4, my_buff);
|
||||
|
||||
}
|
||||
|
||||
if (FillTimer_expired) {
|
||||
/* if (FillTimer_expired) { */
|
||||
if (0) {
|
||||
if (Print_hdr) printf ("\nTaking data in Digitised Histogramming Mode\n"
|
||||
" #-Events #-Skip #-TSI Dead-Time Sync-Status\n");
|
||||
Print_hdr = False;
|
||||
@@ -711,7 +718,7 @@
|
||||
*/
|
||||
void SinqHM_filler_daq_psd () {
|
||||
/* =====================
|
||||
** Routine to handle Time-of-flight Mode
|
||||
** Routine to handle PSD-TOF Mode
|
||||
** Note:
|
||||
** Lwl_fifo could, in principle, be accessed via a register for better
|
||||
** efficiency. However, this can cause trouble with the GDB debugger
|
||||
@@ -727,6 +734,7 @@
|
||||
} lwl_hdr, xData, yData;
|
||||
|
||||
int xPos, yPos, iTime, dataPos;
|
||||
signed int sPosx, sPosy;
|
||||
int i, j, is, ts, left, right, middl, not_finished;
|
||||
uint *edge_pntr;
|
||||
char er_eol[] = {ESC, '[', '0', 'J'}; /* Erase to End-of-Line */
|
||||
@@ -793,8 +801,16 @@
|
||||
/*
|
||||
We have a valid PSD packet. Find and check positions.
|
||||
*/
|
||||
xPos = (xData.ui2[1] - psdXOffset)/psdXFactor;
|
||||
yPos = (yData.ui2[1] - psdYOffset)/psdYFactor;
|
||||
xPos = xData.ui2[1];
|
||||
if(xPos >= 32767)
|
||||
xPos -= 65536;
|
||||
|
||||
yPos = yData.ui2[1];
|
||||
if(yPos >= 32767)
|
||||
yPos -= 65536;
|
||||
|
||||
xPos = (xPos + psdXOffset)/psdXFactor;
|
||||
yPos = (yPos + psdYOffset)/psdYFactor;
|
||||
if(xPos < 0 || xPos > psdXSize)
|
||||
{
|
||||
printf("X position out of range: %d, alllowed 0 - %d\n",
|
||||
@@ -896,6 +912,8 @@
|
||||
if ((Tsi_flags & STATUS_FLAGS__SYNC0) != 0) printf (" SYNC0");
|
||||
if ((Tsi_flags & STATUS_FLAGS__UD) != 0) printf (" UD");
|
||||
if ((Tsi_flags & STATUS_FLAGS__GU) != 0) printf (" GU");
|
||||
if(psdXORF) printf(" XORF");
|
||||
if(psdConf) printf(" CONF");
|
||||
|
||||
is = timer_settime (FillTimerId, ~TIMER_ABSTIME, &FillerTime, NULL);
|
||||
if (is != 0) {
|
||||
|
||||
Reference in New Issue
Block a user