summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineering.com>2019-04-28 22:40:28 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2019-04-28 22:40:28 -0500
commitfebfc4d4a05bd4ed06510a8fb8d62c8fc65b6f1e (patch)
tree39e74f348ba0b0a40580f7dc93399242a757d0d4
parenteb6afe10e66825d9275a9b752b40e95cbf6ec830 (diff)
downloadulab-febfc4d4a05bd4ed06510a8fb8d62c8fc65b6f1e.tar.gz
ulab-febfc4d4a05bd4ed06510a8fb8d62c8fc65b6f1e.zip
Add options to set up control FPGA on startup and reset user FPGA on connect
-rw-r--r--servers/fpga_server_lin/src/fpga_conn.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/servers/fpga_server_lin/src/fpga_conn.cpp b/servers/fpga_server_lin/src/fpga_conn.cpp
index 6ab85a2..f83d384 100644
--- a/servers/fpga_server_lin/src/fpga_conn.cpp
+++ b/servers/fpga_server_lin/src/fpga_conn.cpp
@@ -175,6 +175,13 @@ void FPGASocket::finishKerberosHandshake() {
return;
}
+ // If enabled, reset user FPGA to known good state
+ m_config->setGroup("Programming");
+ TQString resetScript = m_config->readEntry("userresetscript");
+ if (resetScript != "") {
+ system(resetScript.ascii());
+ }
+
TQDataStream ds(this);
ds.setPrintableData(true);
ds << TQString("OK");
@@ -474,6 +481,14 @@ FPGAServer::FPGAServer(TQObject* parent, int port, KSimpleConfig* config) :
exit(1);
}
+ // If enabled, setup control FPGA
+ m_config->setGroup("Programming");
+ TQString setupControlFPGAScript = m_config->readEntry("controlstartupscript");
+ if (setupControlFPGAScript != "") {
+ printf("[INFO] Setting up control FPGA\n\r"); fflush(stdout);
+ system(setupControlFPGAScript.ascii());
+ }
+
printf("[INFO] Server started on port %d\n\r", port); fflush(stdout);
}