Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 83 → Rev 93

/pts/PtsModule_CVI.c
49,7 → 49,14
return 0;
}
 
int Pts_Mread(uint32_t addr, uint32_t *data ){
VME_MRRST();
VME_MR(VME_A32, VME_D32,ptaddr+addr, data);
VME_MREXEC(data);
return 0;
}
 
 
int Pts_erase( int verbose ) {
uint32_t dum;
215,26 → 222,6
}
 
 
 
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
char saddr[255];
if (InitCVIRTE (hInstance, 0, 0) == 0)
return -1; /* out of memory */
if ((p1 = LoadPanel (0, "PtsModule_CVI.uir", P1)) < 0)
return -1;
DisplayPanel (p1);
GetCtrlVal(p1,P1_VERBOSE,&verbose);
GetCtrlVal(p1,P1_ADDRESS,saddr);
ptaddr = strtoul (saddr,NULL,0);
RunUserInterface ();
DiscardPanel (p1);
VME_STOP();
return 0;
}
 
int CVICALLBACK Reset (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
428,6 → 415,10
{
int value=0;
case EVENT_COMMIT:
if(VME_CONNECTED() <0 ) {
MessagePopup ("Warning", "Connect VME!!");
return 0;
}
GetCtrlVal(p1,P1_LED,&value);
Pts_write( 0 , value+1 );
447,6 → 438,10
char buf[400];
unsigned int data, addr;
char sdata[255], saddr[255], rw[255];
if(VME_CONNECTED() <0 ) {
MessagePopup ("Warning", "Connect VME!!");
return 0;
}
GetNumTextBoxLines(panel, P1_COMMANDS,&n);
for (i=0;i<n;i++){
GetTextBoxLine(panel, P1_COMMANDS, i, buf);
460,7 → 455,7
SetCtrlVal (p1, P1_RESPONSE, str);
}
} else {
Pts_read( addr , &data );
Pts_Mread( addr , &data );
if( verbose ) {
sprintf(str, "VME Read addr 0x%0x+0x%0x response 0x%0x\n", ptaddr, addr, data);
SetCtrlVal (p1, P1_RESPONSE, str);
499,3 → 494,23
}
return 0;
}
 
 
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
char saddr[255];
if (InitCVIRTE (hInstance, 0, 0) == 0)
return -1; /* out of memory */
if ((p1 = LoadPanel (0, "PtsModule_CVI.uir", P1)) < 0)
return -1;
DisplayPanel (p1);
GetCtrlVal(p1,P1_VERBOSE,&verbose);
GetCtrlVal(p1,P1_ADDRESS,saddr);
ptaddr = strtoul (saddr,NULL,0);
RunUserInterface ();
DiscardPanel (p1);
VME_STOP();
return 0;
}