From 2af14b8082f13cee2165205c470fa4e04fff9be6 Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Thu, 2 Mar 2017 12:27:53 +0100 Subject: [PATCH] Made timing_recovery_cc build --- csdr.c | 11 ++++++----- libcsdr.c | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/csdr.c b/csdr.c index c227819..2cf1fd3 100644 --- a/csdr.c +++ b/csdr.c @@ -2348,6 +2348,7 @@ int main(int argc, char *argv[]) fwrite(output_buffer, sizeof(complexf), the_bufsize, stdout); //fprintf(stderr, "| o"); TRY_YIELD; + } } if(!strcmp(argv[1],"timing_recovery_cc")) // [--add_q] @@ -2373,13 +2374,13 @@ int main(int argc, char *argv[]) { FEOF_CHECK; timing_recovery((complexf*)input_buffer, (complexf*)output_buffer, the_bufsize, &state); - //fprintf(stderr, "os %d\n",state->output_size); - fwrite(output_buffer, sizeof(complexf), state->output_size, stdout); + //fprintf(stderr, "os %d\n",state.output_size); + fwrite(output_buffer, sizeof(complexf), state.output_size, stdout); fflush(stdout); TRY_YIELD; - memmove((complexf*)input_buffer,((complexf*)input_buffer)+state->input_processed,(the_bufsize-state->input_processed)*sizeof(complexf)); //memmove lets the source and destination overlap - fread(((complexf*)input_buffer)+(the_bufsize-state->input_processed), sizeof(complexf), state->input_processed, stdin); - //fprintf(stderr,"iskip=%d state->output_size=%d start=%x target=%x skipcount=%x \n",state->input_processed,state->output_size,input_buffer, ((complexf*)input_buffer)+(BIG_BUFSIZE-state->input_processed),(BIG_BUFSIZE-state->input_processed)); + memmove((complexf*)input_buffer,((complexf*)input_buffer)+state.input_processed,(the_bufsize-state.input_processed)*sizeof(complexf)); //memmove lets the source and destination overlap + fread(((complexf*)input_buffer)+(the_bufsize-state.input_processed), sizeof(complexf), state.input_processed, stdin); + //fprintf(stderr,"iskip=%d state.output_size=%d start=%x target=%x skipcount=%x \n",state.input_processed,state.output_size,input_buffer, ((complexf*)input_buffer)+(BIG_BUFSIZE-state.input_processed),(BIG_BUFSIZE-state.input_processed)); } } diff --git a/libcsdr.c b/libcsdr.c index e7cc163..c3c9583 100644 --- a/libcsdr.c +++ b/libcsdr.c @@ -1707,7 +1707,7 @@ int timing_recovery(complexf* input, complexf* output, int input_size, timing_re current_bitstart_index += num_samples_halfbit * 2 + num_samples_halfbit * (-error/2); } state->input_processed = current_bitstart_index; - state->output_i = si; + state->output_size = si; } }