summaryrefslogtreecommitdiffstats
path: root/servers/fpga_server_lin/src/fpga_conn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/fpga_server_lin/src/fpga_conn.cpp')
-rw-r--r--servers/fpga_server_lin/src/fpga_conn.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/servers/fpga_server_lin/src/fpga_conn.cpp b/servers/fpga_server_lin/src/fpga_conn.cpp
index e17f134..0e1aa17 100644
--- a/servers/fpga_server_lin/src/fpga_conn.cpp
+++ b/servers/fpga_server_lin/src/fpga_conn.cpp
@@ -111,6 +111,13 @@ void FPGASocket::connectionClosedHandler() {
printf("[DEBUG] Connection from %s closed\n\r", m_remoteHost.ascii()); fflush(stdout);
}
+ if (m_interfaceType == "gpmc") {
+ // Reset user device
+ write_gpmc(0x0c, read_gpmc(0x0c) | 0x03);
+ usleep(100);
+ write_gpmc(0x0c, read_gpmc(0x0c) & ~0x03);
+ }
+
if (m_criticalSection > 0) {
throw exit_exception(-1);
}
@@ -254,6 +261,11 @@ int FPGASocket::setupGPMC() {
}
printf("[DEBUG] Detected a compatible uLab hardware debug interface (model number 0x%02x, firmware version 0x%02x)\n", model, version);
+ // Reset user device
+ write_gpmc(0x0c, read_gpmc(0x0c) | 0x03);
+ usleep(100);
+ write_gpmc(0x0c, read_gpmc(0x0c) & ~0x03);
+
// Clear out DSP and LCD RAM
unsigned char dsp_ram_bits = read_gpmc(0x0b);
unsigned int dsp_ram_offset = (1 << dsp_ram_bits);