diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-13 16:04:14 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-01-13 16:04:14 -0600 |
commit | 2dc576d25f02d1f65df639b0a858a03df437cfca (patch) | |
tree | 3d8ab3b41eee3097eb8d4256dda223d49fbd815c /servers/fpga_server_lin | |
parent | ed6e66626b4eba21c106537f9d53951d782a2924 (diff) | |
download | ulab-2dc576d25f02d1f65df639b0a858a03df437cfca.tar.gz ulab-2dc576d25f02d1f65df639b0a858a03df437cfca.zip |
Hard reset user device on connection and disconnection of FPGA viewer
Diffstat (limited to 'servers/fpga_server_lin')
-rw-r--r-- | servers/fpga_server_lin/src/fpga_conn.cpp | 12 |
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); |