Skip to content
Snippets Groups Projects
Commit 4ea30b2d authored by Alexander Ivanov's avatar Alexander Ivanov
Browse files

Rearranged the timing of uint32 data calculation

git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@3397 6dcd42c9-f523-4c6d-aada-af552506706e
parent ba6a0afe
No related branches found
No related tags found
No related merge requests found
......@@ -509,17 +509,16 @@ static double dHistory[DCU_MAX_CHANNELS][MAX_HISTRY];
if (dataInfo.tp[ii].dataType == DAQ_DATATYPE_16BIT_INT) {
// Write short data; (XOR 1) here provides sample swapping
((short *)(pWriteBuffer + localTable[ii].offset))[(daqSlot/localTable[ii].decFactor)^1] = (short)dWord;
} else if (dataInfo.tp[ii].dataType == DAQ_DATATYPE_32BIT_INT) {
// 32 bit integer type
((unsigned int *)(pWriteBuffer + localTable[ii].offset))[daqSlot/localTable[ii].decFactor] = (unsigned int)dWord;
} else {
// Write a 32-bit float (downcast from the double passed)
((float *)(pWriteBuffer + localTable[ii].offset))[daqSlot/localTable[ii].decFactor] = (float)dWord;
}
} else if (dataInfo.tp[ii].dataType == DAQ_DATATYPE_32BIT_INT) {
// This the case when we have written a value for the uint32 type
// on the initial cycle, now we need to AND the value into the buffer
((unsigned int *)(pWriteBuffer + localTable[ii].offset))[daqSlot/localTable[ii].decFactor] &= (unsigned int)dWord;
}
if (dataInfo.tp[ii].dataType == DAQ_DATATYPE_32BIT_INT) {
if ((daqSlot % localTable[ii].decFactor) == 1)
((unsigned int *)(pWriteBuffer + localTable[ii].offset))[daqSlot/localTable[ii].decFactor] = (unsigned int)dWord;
else
((unsigned int *)(pWriteBuffer + localTable[ii].offset))[daqSlot/localTable[ii].decFactor] &= (unsigned int)dWord;
}
} /* end swing buffer write loop */
......
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