deleted unused funcs and commented outdated code

This commit is contained in:
2025-11-13 18:20:19 +03:00
parent 04015fb4cb
commit fc3fdb92ee
2 changed files with 3 additions and 473 deletions

Binary file not shown.

476
main.c
View File

@ -124,6 +124,9 @@ typedef struct FFT_res_typedef{
int curr_I; //current index of value and corresponding frequency int curr_I; //current index of value and corresponding frequency
} ; } ;
const int FFT_length = 1000; const int FFT_length = 1000;
// количество используемых логических каналов // // количество используемых логических каналов //
@ -631,214 +634,6 @@ uint32_t BF_exec_cmd_with_arr(t_x502_hnd hnd, uint16_t cmd_code, uint32_t cmd_pa
return BF_cmd_receive_code; return BF_cmd_receive_code;
} }
long int X502_Raw_User_Data_Parser(uint32_t *inp_buff, uint32_t inp_values_N,
double *adc_data, uint32_t *adc_chans_N, uint32_t *adc_readouts_N,
struct LFSM_typedef ** LFSM_data, struct LFSM_typedef ** LFSM_data_done,
struct FFT_res_typedef ** FFT_data, struct FFT_res_typedef ** FFT_data_done){
long int return_res = 0;
//printf("inp_values_N: %d, adc_chans_N: %d, adc_readouts_N: %d, user_data_chans_N: %d, user_data_readouts_N: %d\n", inp_values_N, adc_chans_N, adc_readouts_N, user_data_chans_N, user_data_readouts_N);
/*
for (int I = 0; I < adc_readouts_N; ++I){
adc_data[I] = 0.0;
}
for (int I = 0; I < user_data_readouts_N; ++I){
user_data[I] = 0.0;
}
*/
/*
(*(*(*(*(*(*(*(*FFT_data))))))))-> values_N = 0;
(*FFT_data)-> ID = 0;
(*FFT_data)-> description = 0;
(*FFT_data)-> curr_I = 0; //current index of value and corresponding frequency
for (int I = 0; I < adc_readouts_N; ++I){
(*FFT_data)->vals_Re [I] = 0;
(*FFT_data)-> vals_Im [I] = 0;
(*FFT_data)-> vals_F [I] = 0;
}
*/
struct BF_msg_parsed_typedef BF_msg;
for (uint32_t inp_buff_I = 0; inp_buff_I < inp_values_N; ++inp_buff_I){
BF_msg.raw_data = inp_buff[inp_buff_I];
BF_msg.raw_header = (uint8_t) (BF_msg.raw_data >> 24);
BF_msg.flags = 0;
BF_msg.type = 0;
BF_msg.chan = 0;
//BF_msg.raw_data = 0;
BF_msg.raw_value = BF_msg.raw_data & 0xFFFFFF;
BF_msg.value_int = 0;
BF_msg.value = 0;
if (BF_msg.raw_header & 0b10000000){ // ADC data
BF_msg.type = ADC_data;
BF_msg.chan = BF_msg.raw_header & 0b00001111;
BF_msg.flags = (BF_msg.raw_header >> 4);
BF_msg.value_int = BF_msg.raw_value & 0x7FFFFF;
if (BF_msg.raw_value & 0x800000){ // if first bit is nonzero -- it is negative value
BF_msg.value_int *= -1;
}
BF_msg.value = 0.0;// TODO conversion from int to double with respect to ADC channel voltage range
}else if (BF_msg.raw_header & 0b01000000){ //user data (FFT,)
if (BF_msg.raw_header & 0x0F == FFT_val_re){
BF_msg.type = FFT_val_re;
}else if (BF_msg.raw_header & 0x0F == FFT_val_im){
BF_msg.type = FFT_val_im;
}else if (BF_msg.raw_header & 0x0F == FFT_val_f){
BF_msg.type = FFT_val_f;
}else{
BF_msg.type = USR_data;
}
BF_msg.chan = 0;
//BF_msg.chan == BF_msg.raw_header & 0b00111111;
BF_msg.value_int = BF_msg.raw_value & 0x7FFFFF;
if (BF_msg.raw_value & 0x800000){ // if first bit is nonzero -- it is negative value
BF_msg.value_int *= -1;
}
if (! (((*FFT_data)-> rcv_state) & (0b1 << 7 ))){
if (BF_msg.type == FFT_val_re){
(*FFT_data)->rcv_state |= 0b1 << 0;
(*FFT_data)-> vals_Re[(*FFT_data)->curr_I] = BF_msg.value_int;
}else if (BF_msg.type == FFT_val_im){
(*FFT_data)->rcv_state |= 0b1 << 1;
(*FFT_data)-> vals_Im[(*FFT_data)->curr_I] = BF_msg.value_int;
}else if (BF_msg.type == FFT_val_f){
(*FFT_data)->rcv_state |= 0b1 << 2;
(*FFT_data)-> vals_F[(*FFT_data)->curr_I] = BF_msg.value_int;
}
if ((*FFT_data)-> rcv_state == 0b111){
(*FFT_data)-> rcv_state = 0;
++(*FFT_data)->curr_I;
if ((*FFT_data)->curr_I >= (*FFT_data)->max_N){
(*FFT_data)-> rcv_state |= 0b1 << 7;
printf("received more FFT values than allowed. <========================== ERROR\n");
}
}
}
}else if (BF_msg.raw_header & 0b01100000){ //user data LFSM)
if (BF_msg.raw_header & 0x0F == LFSM_val_ON){
BF_msg.type = LFSM_val_ON;
}else if (BF_msg.raw_header & 0x0F == LFSM_val_OFF){
BF_msg.type = LFSM_val_OFF;
}else if (BF_msg.raw_header & 0x0F == LFSM_val_X){
BF_msg.type = LFSM_val_X;
}else{
BF_msg.type = USR_data;
}
BF_msg.chan = 0;
//BF_msg.chan == BF_msg.raw_header & 0b00111111;
BF_msg.value_int = BF_msg.raw_value & 0x7FFFFF;
if (BF_msg.raw_value & 0x800000){ // if first bit is nonzero -- it is negative value
BF_msg.value_int *= -1;
}
if (! (((*LFSM_data) -> rcv_state) & (0b1 << 7 ))){
if (BF_msg.type == LFSM_val_ON){
(*LFSM_data) ->rcv_state |= 0b1 << 0;
(*LFSM_data) -> Y_on[(*LFSM_data) ->curr_I] = BF_msg.value_int;
}else if (BF_msg.type == LFSM_val_OFF){
(*LFSM_data) ->rcv_state |= 0b1 << 1;
(*LFSM_data) -> Y_off[(*LFSM_data) ->curr_I] = BF_msg.value_int;
}else if (BF_msg.type == LFSM_val_X){
(*LFSM_data) ->rcv_state |= 0b1 << 2;
(*LFSM_data) -> X[(*LFSM_data) ->curr_I] = BF_msg.value_int;
}
if ((*LFSM_data) -> rcv_state == 0b011){
(*LFSM_data) -> rcv_state = 0;
++(*LFSM_data) ->curr_I;
if ((*LFSM_data) ->curr_I >= (*LFSM_data) ->max_N){
(*LFSM_data) -> rcv_state |= 0b1 << 7;
printf("received more LFSM values than allowed. <========================== ERROR\n");
}
}
}
}else if (BF_msg.raw_header & 0b01100000 == 0b01100000){ //user message
BF_msg.type = USR_msg;
BF_msg.chan = BF_msg.raw_header & 0b00011111;
BF_msg.value_int = BF_msg.raw_value & 0x7FFFFF;
if (BF_msg.raw_value & 0x800000){ // if first bit is nonzero -- it is negative value
BF_msg.value_int *= -1;
}
printf("Received USR msg: 0x%06H \n", BF_msg.raw_value);
//}else if (raw_header & 0b01100000 == 0b01100000){ //
}else if (BF_msg.raw_header & 0b01101010 == 0b01101010){ //new Frequency Sweep Started. So save old (*FFT_data)to FFT_data_done and start working with new FFT_data
//FFT
printf("Received: new LFSM started. msg payload: 0x%06H \n", BF_msg.raw_value);
(*FFT_data)-> rcv_state = 0xFF; // data filled
int FFT_last_ID = (*FFT_data)-> ID;
int FFT_points_max_N = (*FFT_data)-> max_N;
struct FFT_res_typedef ** FFT_tmp = *FFT_data_done;
*FFT_data_done = *FFT_data;
*FFT_data = *FFT_tmp;
//(*FFT_data)-> values_N = 0;
(*FFT_data)-> rcv_state = 0;
(*FFT_data)-> ID = FFT_last_ID + 1;
(*FFT_data)-> max_N = FFT_points_max_N;
(*FFT_data)-> description = 0;
(*FFT_data)-> curr_I = 0; //current index of value and corresponding frequency
for (int I = 0; I < (*FFT_data)-> max_N; ++I){
(*FFT_data)->vals_Re [I] = 0;
(*FFT_data)-> vals_Im [I] = 0;
(*FFT_data)-> vals_F [I] = 0;
}
free(FFT_tmp);
free(FFT_last_ID);
free(FFT_points_max_N);
//LFSM
(*LFSM_data) -> rcv_state = 0xFF; // data filled
int LFSM_last_ID = (*LFSM_data) -> ID;
int LFSM_points_max_N = (*LFSM_data) -> max_N;
struct LFSM_typedef ** LFSM_tmp = *LFSM_data_done;
*LFSM_data_done = *LFSM_data;
*LFSM_data = *LFSM_tmp;
//(*LFSM_data) -> values_N = 0;
(*LFSM_data) -> rcv_state = 0;
(*LFSM_data) -> ID = LFSM_last_ID + 1;
(*LFSM_data) -> max_N = LFSM_points_max_N;
(*LFSM_data) -> description = 0;
(*LFSM_data) -> curr_I = 0; //current index of value and corresponding frequency
for (int I = 0; I < (*LFSM_data) -> max_N; ++I){
(*LFSM_data) -> X [I] = 0;
(*LFSM_data) -> Y_on [I] = 0;
(*LFSM_data) -> Y_off [I] = 0;
}
free(LFSM_tmp);
free(LFSM_last_ID);
free(LFSM_points_max_N);
}else{
BF_msg.type = unknown;
BF_msg.chan = 0;
BF_msg.value_int = BF_msg.raw_value & 0x7FFFFF;
if (BF_msg.raw_value & 0x800000){ // if first bit is nonzero -- it is negative value
BF_msg.value_int *= -1;
}
}
}
}
uint32_t X502_FlushRcv_buff(t_x502_hnd hnd){ uint32_t X502_FlushRcv_buff(t_x502_hnd hnd){
uint32_t ready; uint32_t ready;
@ -879,78 +674,6 @@ void receive_to_file(t_x502_hnd hnd, char* logfilename, uint32_t* inp_buff, uint
fclose(logfile_ptr); fclose(logfile_ptr);
} }
void receive_data(t_x502_hnd hnd, char* logfilename, uint32_t* inp_buff, int data_receive_trys_counter, uint32_t max_total_words, uint8_t mode){
//int data_receive_trys_counter = 100;
//uint32_t max_total_words = 10000;
uint32_t ready_cnt_Err = 0;
uint32_t recv_Err_code = 0;
int ready_cnt = 0;
int ready_cnt_copy = 0;
int values_in_line = 0;
FILE *logfile_ptr;
logfile_ptr = fopen(logfilename, "a");
//while((--data_receive_trys_counter)&& (max_total_words)){
//ready_cnt_Err = X502_GetRecvReadyCount(hnd, &ready_cnt);
recv_Err_code = X502_Recv(hnd, inp_buff, max_total_words, data_receive_trys_counter);
//printf("\n\nget counters of calls of SPORT_RX, SPORT_TX, HDMA_RX, HDMA_TX\n");
//BF_exec_cmd_with_arr(hnd, 0x8005U, 100, NULL, 0, 1);
//printf("\n\request TX_buff_I_shadow value (last size of TX_buff transferred to pc )\n");
//BF_exec_cmd_simple(hnd, 0x8009, 10, 1);
if (mode == DUMP_TO_FILE){
if (ready_cnt){
printf("Ready count: %d, Err: %d \n", ready_cnt, ready_cnt_Err);
for (int i = 0; i < ready_cnt; ++i){
//printf("\nabort value: %d\n", abort_crtl_C);
if (abort_crtl_C){
break;
}
--max_total_words;
if (max_total_words == 0){
break;
}
char bin_str_val[9] = {0,};
uin32_t_to_bin(inp_buff[i], bin_str_val);
printf(" 0x%08X,", inp_buff[i]);
fprintf(logfile_ptr, "0x%08X \n", inp_buff[i]);
//printf(" 0b%s,", bin_str_val);
++values_in_line;
if (values_in_line == 10){
printf("\n");
values_in_line = 0;
}
}
/*
uint32_t process_data_Err = 0;
uint32_t adc_data_size = ready_cnt;
X502_Raw_User_Data_Parser(inp_buff, inp_values_N,
adc_data, adc_chans_N, adc_readouts_N,
&LFSM_res_tmp, &LFSM_res,
&FFT_res_tmp, &FFT_res);
//process_data_Err = X502_ProcessData(hnd, inp_buff, ready_cnt, X502_PROC_FLAGS_VOLT, adc_data, &adc_data_size, NULL, NULL);
uint64_t data_sum = 0;
for (int i = 0; i < ready_cnt; ++i){
data_sum += inp_buff[i];
if (i % 1000 == 1){
//printf(" %e\n", adc_data[i]);
}
}
*/
}
}else if (mode == FLUSH){
;
}
//printf("try: %04d, words ready: %06d, receive_error_code: %05d, data_sum: %d \n", data_receive_trys_counter, ready_cnt, recv_Err_code, data_sum);
//}
fclose(logfile_ptr);
}
@ -1023,24 +746,6 @@ int main(int argc, char** argv) {
/*
X502_Raw_User_Data_Parser(inp_buff, inp_values_N,
adc_data, adc_chans_N, adc_readouts_N,
&LFSM_res_tmp, &LFSM_res,
&FFT_res_tmp, &FFT_res);
*/
//*/
/*
X502_Raw_User_Data_Parser(inp_buff, inp_values_N,
adc_data, adc_chans_N, adc_readouts_N,
user_data, user_data_chans_N, user_data_readouts_N);
*/
////******* Получение списка устройств и выбор, с каким будем работать *****************// ////******* Получение списка устройств и выбор, с каким будем работать *****************//
hnd = f_dev_select_open(argc, argv); hnd = f_dev_select_open(argc, argv);
@ -1107,38 +812,8 @@ int main(int argc, char** argv) {
uint32_t BF_cmd_receive_code = 0; uint32_t BF_cmd_receive_code = 0;
/*//working executing remote cmd
uint16_t cmd_code = 3;
uint32_t par = 87;
const uint32_t snd_data[] = {1,1,2,2,3,4,5,56,67,23,1};
uint32_t snd_size = 11;
uint32_t rcv_data[13] = {0,};
uint32_t rcv_size = 13;
uint32_t tout = 1;
uint32_t recvd_size = 0;
*/
printf("\n\n\n"); printf("\n\n\n");
//setup ADC:
//t_x502_hnd hnd, uint16_t cmd_code, uint32_t cmd_arg, uint8_t verbosity_lvl
//BF_exec_cmd_simple(hnd, L502_BF_CMD_CODE_GET_PARAM, 87, 2);
//BF_exec_cmd_simple(hnd, L502_BF_CMD_CODE_GET_PARAM, 87, 1);
//BF_exec_cmd_simple(hnd, L502_BF_CMD_CODE_GET_PARAM, 87, 0);
//BF_exec_cmd_simple(hnd, L502_BF_USR_CMD_CODE_ECHO, 87, 1);
//BF_exec_cmd_simple(hnd, L502_BF_USR_CMD_CODE_DATA_ECHO, 87, 1);
//BF_exec_cmd_with_arr(t_x502_hnd hnd, uint16_t cmd_code, uint32_t cmd_par, uint32_t* snd_data, uint32_t snd_data_size, uint8_t verbosity_lvl);
//uint32_t tx_data[] = {0,1,2,3,4,53,4,2,2,1,0};
//uint32_t tx_data_size = 11;
//BF_exec_cmd_with_arr(hnd, L502_BF_USR_CMD_CODE_DATA_ECHO, 328, tx_data, tx_data_size, 2);
//BF_exec_cmd_with_arr(hnd, L502_BF_USR_CMD_CODE_DATA_ECHO, 328, tx_data, tx_data_size, 1);
//setup ADC: //setup ADC:
uint32_t tx_data[] = {0,1,2,3,4,53,4,2,2,1,0}; uint32_t tx_data[] = {0,1,2,3,4,53,4,2,2,1,0};
@ -1147,20 +822,8 @@ int main(int argc, char** argv) {
tx_data[0] = 2000000; //valid values: 2000000, 1500000 Hz tx_data[0] = 2000000; //valid values: 2000000, 1500000 Hz
//printf("\n"); //printf("\n");
//BF_exec_cmd_with_arr(hnd, L502_BF_CMD_CODE_SET_PARAM, L502_BF_PARAM_REF_FREQ_SRC, tx_data, tx_data_size, 2);
//printf("run tests\n");
//BF_exec_cmd_simple(hnd, 0x8010, 17, 1); //test SPORT0
//BF_exec_cmd_simple(hnd, 0x8003U, 0, 1);
//printf("setup ADC\n");
//BF_exec_cmd_with_arr(hnd, 0x8003U, 0, NULL, 0, 1); //setup ADC. Values in array are configuring functions return codes
//some delay to allow ADC to acquire some data
//printf("L502_REGS_IOHARD_OUTSWAP_BFCTL reg:");
//BF_exec_cmd_simple(hnd, 0x8006, L502_REGS_IOHARD_OUTSWAP_BFCTL, 1); //reaf fpga reg
uint32_t streams_enable_Err = 0; uint32_t streams_enable_Err = 0;
streams_enable_Err = X502_StreamsEnable(hnd, X502_STREAM_ADC | X502_STREAM_DIN ); streams_enable_Err = X502_StreamsEnable(hnd, X502_STREAM_ADC | X502_STREAM_DIN );
@ -1253,13 +916,6 @@ int main(int argc, char** argv) {
receive_to_file(hnd, logfilename, inp_buff, max_total_words); receive_to_file(hnd, logfilename, inp_buff, max_total_words);
//receive_data(hnd, logfilename, inp_buff, data_receive_trys_counter, max_total_words, DUMP_TO_FILE);
/*
data_receive_trys_counter = 100;
max_total_words = 10000;
receive_data(hnd, logfilename, inp_buff, data_receive_trys_counter, max_total_words, DUMP_TO_FILE);
*/
printf("\n\nget counters of calls of SPORT_RX, SPORT_TX, HDMA_RX, HDMA_TX\n"); printf("\n\nget counters of calls of SPORT_RX, SPORT_TX, HDMA_RX, HDMA_TX\n");
BF_exec_cmd_with_arr(hnd, 0x8005U, 100, NULL, 0, 1); BF_exec_cmd_with_arr(hnd, 0x8005U, 100, NULL, 0, 1);
@ -1281,9 +937,6 @@ int main(int argc, char** argv) {
// printf("\nStart SEMITRANSPARENT mode\n");
// BF_exec_cmd_simple(hnd, 0x800B, 2, 1); //start SEMITRANSPARENT
insert_marker_to_file(logfilename, "start AVG"); insert_marker_to_file(logfilename, "start AVG");
printf("\nStart AVG mode\n"); printf("\nStart AVG mode\n");
BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging
@ -1296,12 +949,6 @@ int main(int argc, char** argv) {
X502_StreamsStart(hnd); X502_StreamsStart(hnd);
//BF_exec_cmd_simple(hnd, 0x8008, 2, 1); //start averaging
//BF_exec_cmd_simple(hnd, 0x8007, 2, 1); //start transparent
// printf("waiting a bit...\n");
// for(uint32_t wait_i = 1e4; wait_i; --wait_i){printf("");}
// for(uint32_t wait_i = 1e6; wait_i; --wait_i){;} // for(uint32_t wait_i = 1e6; wait_i; --wait_i){;}
printf("\nFlushed from receiving buff: %d\n", X502_FlushRcv_buff(hnd)); printf("\nFlushed from receiving buff: %d\n", X502_FlushRcv_buff(hnd));
@ -1326,8 +973,6 @@ int main(int argc, char** argv) {
clock_gettime(CLOCK_MONOTONIC, &time_receive_started); clock_gettime(CLOCK_MONOTONIC, &time_receive_started);
receive_to_file(hnd, logfilename, inp_buff, max_total_words); receive_to_file(hnd, logfilename, inp_buff, max_total_words);
// receive_data(hnd, logfilename, inp_buff, data_receive_trys_counter, max_total_words, FLUSH);
//receive_data(hnd, logfilename, inp_buff, data_receive_trys_counter, max_total_words, DUMP_TO_FILE);
clock_gettime(CLOCK_MONOTONIC, &time_receive_ended); clock_gettime(CLOCK_MONOTONIC, &time_receive_ended);
@ -1339,66 +984,6 @@ int main(int argc, char** argv) {
printf("\n Receive time: %g, %g sec/value \n", receive_time, receive_time/max_total_words); printf("\n Receive time: %g, %g sec/value \n", receive_time, receive_time/max_total_words);
// printf("\n dbg value: ");
// BF_exec_cmd_simple(hnd, 0x800A, 10, 1);
/*
insert_marker_to_file(logfilename, "enable FFT");
printf("\nEnabled FFT\n");
BF_exec_cmd_simple(hnd, 0x8011, 2, 1); //enable FFT
max_total_words = 100000;
// printf("\nflush TX buff. \n Number of free TX descriptors before flushing:");
// BF_exec_cmd_simple(hnd, 0x8010, 10, 1);
X502_StreamsStop(hnd);
X502_StreamsStart(hnd);
receive_to_file(hnd, logfilename, inp_buff, max_total_words);
insert_marker_to_file(logfilename, "enable SYNC_DETector");
printf("\nEnabled SYNC_DETector\n");
BF_exec_cmd_simple(hnd, 0x8012, 2, 1); //enable FFT
max_total_words = 100000;
// printf("\nflush TX buff. \n Number of free TX descriptors before flushing:");
// BF_exec_cmd_simple(hnd, 0x8010, 10, 1);
X502_StreamsStop(hnd);
X502_StreamsStart(hnd);
receive_to_file(hnd, logfilename, inp_buff, max_total_words);
*/
@ -1424,67 +1009,12 @@ int main(int argc, char** argv) {
// printf("\n dbg value: "); // printf("\n dbg value: ");
// BF_exec_cmd_simple(hnd, 0x800A, 10, 1); // BF_exec_cmd_simple(hnd, 0x800A, 10, 1);
receive_to_file(hnd, logfilename, inp_buff, max_total_words); receive_to_file(hnd, logfilename, inp_buff, max_total_words);
//receive_data(hnd, logfilename, inp_buff, data_receive_trys_counter, max_total_words, DUMP_TO_FILE);
printf("\n dbg value: "); printf("\n dbg value: ");
BF_exec_cmd_simple(hnd, 0x800A, 10, 1); BF_exec_cmd_simple(hnd, 0x800A, 10, 1);
//*/ //*/
/*
while((--data_receive_trys_counter)&& (max_total_words)){
ready_cnt_Err = X502_GetRecvReadyCount(hnd, &ready_cnt);
recv_Err_code = X502_Recv(hnd, inp_buff, ready_cnt, 10);
printf("\n\nget counters of calls of SPORT_RX, SPORT_TX, HDMA_RX, HDMA_TX\n");
BF_exec_cmd_with_arr(hnd, 0x8005U, 100, NULL, 0, 1);
if (ready_cnt){
printf("Ready count: %d, Err: %d \n", ready_cnt, ready_cnt_Err);
for (int i = 0; i < ready_cnt; ++i){
//printf("\nabort value: %d\n", abort_crtl_C);
if (abort_crtl_C){
break;
}
--max_total_words;
if (max_total_words == 0){
break;
}
char bin_str_val[9] = {0,};
uin32_t_to_bin(inp_buff[i], bin_str_val);
printf(" 0x%08X,", inp_buff[i]);
fprintf(logfile_ptr, "0x%08X \n", inp_buff[i]);
//printf(" 0b%s,", bin_str_val);
++values_in_line;
if (values_in_line == 10){
printf("\n");
values_in_line = 0;
}
}
uint32_t process_data_Err = 0;
uint32_t adc_data_size = ready_cnt;
X502_Raw_User_Data_Parser(inp_buff, inp_values_N,
adc_data, adc_chans_N, adc_readouts_N,
&LFSM_res_tmp, &LFSM_res,
&FFT_res_tmp, &FFT_res);
//process_data_Err = X502_ProcessData(hnd, inp_buff, ready_cnt, X502_PROC_FLAGS_VOLT, adc_data, &adc_data_size, NULL, NULL);
uint64_t data_sum = 0;
for (int i = 0; i < ready_cnt; ++i){
data_sum += inp_buff[i];
if (i % 1000 == 1){
//printf(" %e\n", adc_data[i]);
}
}
}
//printf("try: %04d, words ready: %06d, receive_error_code: %05d, data_sum: %d \n", data_receive_trys_counter, ready_cnt, recv_Err_code, data_sum);
}
*/
//fclose(logfile_ptr);
printf("\n\nreceive done. Exiting...\n\n\n"); printf("\n\nreceive done. Exiting...\n\n\n");