diff options
Diffstat (limited to 'controller/fw/tools')
-rw-r--r-- | controller/fw/tools/dsss_demod_test.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/controller/fw/tools/dsss_demod_test.c b/controller/fw/tools/dsss_demod_test.c index 4370f80..d76a8bd 100644 --- a/controller/fw/tools/dsss_demod_test.c +++ b/controller/fw/tools/dsss_demod_test.c @@ -12,6 +12,16 @@ #include "dsss_demod.h" +void handle_dsss_received(uint8_t data[TRANSMISSION_SYMBOLS]) { + printf("data sequence received: [ "); + for (size_t i=0; i<TRANSMISSION_SYMBOLS; i++) { + printf("%+3d", ((data[i]&1) ? 1 : -1) * (data[i]>>1)); + if (i+1 < TRANSMISSION_SYMBOLS) + printf(", "); + } + printf(" ]\n"); +} + void print_usage() { fprintf(stderr, "Usage: dsss_demod_test [test_data.bin] [optional recording channel number]\n"); } @@ -87,7 +97,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Starting simulation.\n"); struct dsss_demod_state demod; - memset(&demod, 0, sizeof(demod)); + dsss_demod_init(&demod); for (size_t i=0; i<n_samples; i++) { //fprintf(stderr, "Iteration %zd/%zd\n", i, n_samples); dsss_demod_step(&demod, buf_f[i], i, record_channel); |