summaryrefslogtreecommitdiff
path: root/controller/fw/tools/freq_meas_test.c
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-15 14:47:25 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-15 14:47:25 +0100
commitfed186a49fc8f27a8a31fd40f8c8b26d32a4b932 (patch)
tree5d4c2b8004031c5d13148296a760c896b18ebf83 /controller/fw/tools/freq_meas_test.c
parent0e8a0d6f78b027d251737adc37f3d56acf251e94 (diff)
downloadmaster-thesis-fed186a49fc8f27a8a31fd40f8c8b26d32a4b932.tar.gz
master-thesis-fed186a49fc8f27a8a31fd40f8c8b26d32a4b932.tar.bz2
master-thesis-fed186a49fc8f27a8a31fd40f8c8b26d32a4b932.zip
Add end-to-end simulation
Diffstat (limited to 'controller/fw/tools/freq_meas_test.c')
-rw-r--r--controller/fw/tools/freq_meas_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/controller/fw/tools/freq_meas_test.c b/controller/fw/tools/freq_meas_test.c
index e80290e..e2900ad 100644
--- a/controller/fw/tools/freq_meas_test.c
+++ b/controller/fw/tools/freq_meas_test.c
@@ -49,9 +49,9 @@ int main(int argc, char **argv) {
}
fprintf(stderr, "Reading %zd samples test data...", st.st_size/sizeof(float));
- size_t nread = 0;
+ ssize_t nread = 0;
while (nread < st.st_size) {
- ssize_t rc = read(fd, buf, st.st_size - nread);
+ ssize_t rc = read(fd, buf + nread, st.st_size - nread);
if (rc == -EINTR || rc == -EAGAIN)
continue;
@@ -100,5 +100,7 @@ int main(int argc, char **argv) {
printf("%09zd %12f\n", i, res);
}
+ free(buf);
+ free(sim_adc_buf);
return 0;
}