-const char trbnet_version[] = "$Revision: 2.75 $";
+const char trbnet_version[] = "$Revision: 2.76 $";
#include <stdlib.h>
#include <signal.h>
close(memfd);
- if (lockPorts(0) == -1) return -1;
+ if (lockPorts(1) == -1) return -1;
/* Set output enabled if not done yet */
if ((*GPIOB_OE_OFFSET != GPIOB_OE_PINS) ||
}
/* Reset Ports */
- setbitsPC(0x30000);
- clrbitsPC(0x30000);
+ com_reset();
- if (unlockPorts(0) == -1) return -1;
+ if (unlockPorts(1) == -1) return -1;
return 0;
}
int network_reset()
{
+ uint32_t tt;
+ uint32_t dd = 0;
trb_errno = TRB_NONE;
if (lockPorts(1) == -1) return -1;
com_reset();
- usleep(1000);
-
+
/* DEBUG INFO */
if (trb_debug > 0) {
fprintf(stderr, "network_reset started.\n");
write32_to_FPGA(0x10, 0x0000);
usleep(1000);
- write32_to_FPGA(0x10, 0x8000);
- sleep(7);
+
+ write32_to_FPGA(0x10, 0x8000);
+ sleep(8);
+ com_reset();
+
if (unlockPorts(1) == -1) return -1;
return 0;
setbitsPC(0x30000);
clrbitsPC(0x30000);
+ usleep(1000);
+ // Reset FifoToggleBit
+ fifoToggleBit = 0;
+
if (unlockPorts(0) == -1) return -1;
return 0;