work around card initialization problem on RTEMS
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-highland/hiddg85xApp/drvHIDDG85x.c new-highland/hiddg85xApp/drvHIDDG85x.c
--- old-highland/hiddg85xApp/drvHIDDG85x.c 2022-09-28 11:13:30.486310309 +0200
+++ new-highland/hiddg85xApp/drvHIDDG85x.c 2022-09-28 11:13:30.486310309 +0200
@@ -191,7 +191,7 @@
* unused registers all the rest are write only. Only the status
* register will be modified by the hardware.
*/
-typedef struct
+typedef volatile struct
{ /* hex offset -- description */
volatile epicsUInt16 vxi_mfr; /* 00 vxi manufacturer id */
volatile epicsUInt16 vxitype; /* 02 module type */
@@ -501,19 +501,19 @@
{
hiddg85x_regs *pregs = hiddg85x.pregs + card;
hiddg85x_info *pinfo = hiddg85x.pinfo + card;
- epicsUInt16 cok;
+ epicsUInt8 cok;
#if 0
int i;
#endif
- if ( devReadProbe(1, pregs, &cok) ) {
+ if ( devReadProbe(1, &pregs->vxi_mfr, &cok) ) {
return error("no card found at address %p\n", pregs);
}
pinfo->pregs = pregs;
debug(1, "found card at address %p\n", pregs);
/* check that this is really the right type of card */
- if (pregs->vxi_mfr != VXI_MFR || pregs->vxitype != VXITYPE) {
+ if (pregs->vxi_mfr != VXI_MFR || (pregs->vxitype != VXITYPE && pregs->vxitype != VXITYPE)) {
return error("card MFR 0x%x of wrong type 0x%x at address %p\n",
pregs->vxi_mfr, pregs->vxitype, pregs);
return -1;
patch 94655e52756a370b6f302b2d10cdd4250d0f2e7e
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date: Fri Nov 13 14:20:36 CET 2015
* work around card initialization problem on RTEMS
On RTEMS highland V850 cards are not recognized due to a wrong result when
reading the VXITYPE register, for the first time, while reading it a second
time gives a correct result. It is entirely unclear why this is so.
Anyway, reading twice is what we do now, until the problem is properly
understood and fixed