diff --git a/BF_companion b/BF_companion index 5db1a46..d146586 100755 Binary files a/BF_companion and b/BF_companion differ diff --git a/build/main.o b/build/main.o index 28dc9cd..1e384a7 100644 Binary files a/build/main.o and b/build/main.o differ diff --git a/main.c b/main.c index 51d58a6..108189f 100644 --- a/main.c +++ b/main.c @@ -819,29 +819,31 @@ int main(int argc, char** argv) { printf("Streams start err: %d \n", streams_start_Err); - if (main_state.run_mode == RUN_MODE_FINITE){ - main_state.run_I = 0; - char tmp_data_filename[] = " "; - struct timespec ts; - while(main_state.run_I < main_state.runs_N){ - max_total_words = 10000000; - time(&seconds); - timespec_get(&ts, TIME_UTC); + if (state.run_mode == RUN_MODE_FINITE){ + state.run_I = 0; + char tmp_data_filename[] = " "; + struct timespec ts; + uint32_t max_total_words = 0; + uint32_t *inp_buff = malloc(1024*100*1024*2*4); + while(state.run_I < state.runs_N){ + max_total_words = 10000000; + timespec_get(&ts, TIME_UTC); // sprintf(&tmp_data_filename, "tmp/received_data_%ld.%ld.csv", ts.tv_sec, ts.tv_nsec); // sprintf(&logfilename, "tmp/received_data_%ld.%ld.csv", ts.tv_sec, ts.tv_nsec); //sprintf(&logfilename, "data/received_data_%ld.csv", seconds); - snprintf(tmp_data_filename, sizeof(tmp_data_filename), "tmp/received_data_%ld.%ld.csv", ts.tv_sec, ts.tv_nsec); - printf("%ld/%ld dumping to file: %s\n", main_state.run_I - main_state.runs_N, argv_runs, tmp_data_filename); - receive_to_file(hnd, tmp_data_filename, inp_buff, max_total_words, main_state.run_length); + snprintf(tmp_data_filename, sizeof(tmp_data_filename), "tmp/received_data_%ld.%ld.csv", ts.tv_sec, ts.tv_nsec); + printf("%u/%u dumping to file: %s\n", (unsigned)state.run_I, (unsigned)state.runs_N, tmp_data_filename); + receive_to_file(hnd, tmp_data_filename, inp_buff, max_total_words, state.run_length); - main_state.run_I++; - } - X502_Close(hnd); - // освобождаем описатель - X502_Free(hnd); - return 0; - } - } + state.run_I++; + } + free(inp_buff); + X502_Close(hnd); + // освобождаем описатель + X502_Free(hnd); + return 0; + } + }