From fed186a49fc8f27a8a31fd40f8c8b26d32a4b932 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 15 Mar 2020 14:47:25 +0100 Subject: Add end-to-end simulation --- controller/fw/tools/freq_meas_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'controller/fw/tools/freq_meas_test.c') 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; } -- cgit