Skip to content

Instantly share code, notes, and snippets.

@xiaoqiangwang
Created October 26, 2016 14:46
Show Gist options
  • Save xiaoqiangwang/e86f977204ccf3e61fc766847c7b840d to your computer and use it in GitHub Desktop.
Save xiaoqiangwang/e86f977204ccf3e61fc766847c7b840d to your computer and use it in GitHub Desktop.
Skip to content
All gists
GitHub
0
@xiaoqiangwang xiaoqiangwang/devDxp diff Secret
Created 13 seconds ago
Code
Revisions 2
devDxp diff
--- G/DRV/dxp/dxpApp/src/devDxp.h 2010/10/21 08:22:19 1.1
+++ G/DRV/dxp/dxpApp/src/devDxp.h 2013/11/06 13:28:41 1.2
@@ -48,11 +48,11 @@ typedef enum {
/* This structure must match the order of the SCA fields in the record */
typedef struct {
- long lo;
- long lo_rbv;
- long hi;
- long hi_rbv;
- long counts;
+ epicsInt32 lo;
+ epicsInt32 lo_rbv;
+ epicsInt32 hi;
+ epicsInt32 hi_rbv;
+ epicsInt32 counts;
} DXP_SCA;
typedef struct devDxpDset {
--- G/DRV/dxp/dxpApp/src/drvDxp.c 2010/10/21 08:22:19 1.1
+++ G/DRV/dxp/dxpApp/src/drvDxp.c 2013/11/06 13:28:41 1.2
@@ -601,6 +601,7 @@ static asynStatus int32ArrayRead(void *d
int signal;
dxpChannel_t *dxpChan;
int i;
+ unsigned long *raw_data;
pasynManager->getAddr(pasynUser, &signal);
dxpChan = findChannel(pPvt, pasynUser, signal);
@@ -612,7 +613,12 @@ static asynStatus int32ArrayRead(void *d
if (dxpChan->erased) {
memset(data, 0, pPvt->nchans*sizeof(int));
} else {
- xiaGetRunData(dxpChan->detChan, "mca", data);
+ raw_data = (unsigned long *)malloc(pPvt->nchans * sizeof(unsigned long));
+ xiaGetRunData(dxpChan->detChan, "mca", raw_data);
+ for (i=0; i<pPvt->nchans; i++) {
+ data[i] = raw_data[i];
+ }
+ free(raw_data);
}
*nactual = pPvt->nchans;
/* Compute counts in preset count window */
@xiaoqiangwang
Attach files by dragging & dropping or
.
Styling with Markdown is supported
Contact GitHub API Training Shop Blog About
© 2016 GitHub, Inc. Terms Privacy Security Status Help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment