publishing to check changes in cdms code
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE_samp_23SEP_DMA_flag by
Diff: OBSRS.h
- Revision:
- 201:3410fc4d80f0
- Parent:
- 200:05ff11766d9a
- Child:
- 202:8700a3e6324c
diff -r 05ff11766d9a -r 3410fc4d80f0 OBSRS.h --- a/OBSRS.h Thu Jun 30 21:40:37 2016 +0000 +++ b/OBSRS.h Fri Jul 01 07:55:06 2016 +0000 @@ -175,7 +175,7 @@ buffer_112[counter_buffer_112] = SCH40[counter_SCH40++];\ if (counter_SCH40 == 5)\ { \ - /*gPC.printf("Asch40 sent\r\n");*/\ + gPC.printf("Asch40 sent\r\n");\ counter_SCH40 = 0;\ enable_SCH = false;\ enable_DS = true;\ @@ -186,7 +186,7 @@ buffer_112[counter_buffer_112] = interleave_data[half_buffer][counter_interleavedata++];\ if (counter_interleavedata == 144)\ { \ - /*gPC.printf("Ads sent %d\r\n",half_buffer);*/\ + gPC.printf("Ads sent %d\r\n",half_buffer);\ enable_DS = false;\ enable_FCCH = true;\ counter_interleavedata = 0;\ @@ -197,7 +197,7 @@ buffer_112[counter_buffer_112] = FCCH80[counter_FCCH80++];\ if (counter_FCCH80 == 10)\ {\ - /*gPC.printf("Afcch80 sent\r\n");*/\ + gPC.printf("Afcch80 sent\r\n");\ enable_FCCH = false;\ counter_FCCH80 = 0;\ enable_SCH = true;\ @@ -215,11 +215,11 @@ T_frames_sent = T_frames_sent +2;\ if(repeat_last_2T_frames){\ enable_SCH = true;\ - /*gPC.printf("repeated last 2 tframes\r\n");*/\ + gPC.printf("repeated last 2 tframes\r\n");\ /*cout<<"T_frames_sent = "<<T_frames_sent<<ENDL;*/\ }\ else{\ - /*cout<<"Ackandcallsign sent"<<" ";*/\ + gPC.printf("Ackandcallsign sent");\ /*cout<<"T_frames_sent = "<<T_frames_sent<<ENDL;*/\ T_frame_Ack_andcallsign_sent = T_frame_Ack_andcallsign_sent + 2;\ if(T_frame_Ack_andcallsign_sent == T_frame_in_Ackandcallsign ){\ @@ -238,11 +238,11 @@ if(segments_sent + 1>= max_segments){\ adf_limit = true;\ segments_sent = 0;\ - /*cout<<"adf limit reached"<<ENDL;*/\ + gPC.printf("adf limit reached");\ }\ else{\ enable_new_segment = true;\ - /*cout<<"new segment"<<ENDL;*/\ + gPC.printf("new segment");\ }\ }\ else{\ @@ -254,7 +254,7 @@ else if(send_EoS_and_stop){\ buffer_112[counter_buffer_112] = EoS[counter_EoS++];\ if(counter_EoS == 120){\ - /*gPC.printf("A eos sent\r\n");*/\ + gPC.printf("A eos sent\r\n");\ /*cout<<"EoS sent"<<ENDL;*/\ counter_EoS = 0;\ enable_ackandcallsign = false;\ @@ -267,7 +267,7 @@ buffer_112[counter_buffer_112] = EoS[counter_EoS++];\ if(counter_EoS == 120){\ counter_EoS = 0;\ - /*cout<<"EoS sent"<<ENDL;*/\ + gPC.printf("EoS sent");\ restart_adf();\ enable_new_segment = true;\ /*cout<<"new session"<<ENDL;*/\ @@ -515,7 +515,7 @@ } else if(enable_ackandcallsign){ if(create_Ack_andcallsign){ -/* gPC.printf("cr ack\r\n");*/ + gPC.printf("cr ack\r\n"); enable_SCH = true; if( (GETexec_status(current_obsrs_tc) == TC_STATE_EXECUTION_FAILED) && (GETabort_on_nack(current_obsrs_tc) == 1) ){ @@ -555,10 +555,11 @@ } } -/* gPC.printf("ex cr ack\r\n");*/ + gPC.printf("ex cr ack\r\n"); } send_Ack_andcallsign; - if(last_buffer){ + if(last_buffer){ + gPC.printf("last buffer"); // delete ack_head; // while(ack_and_callsign != NULL){ // Base_tm *temp = ack_and_callsign->next_TM; @@ -568,6 +569,7 @@ } else if(last_buffer){ + gPC.printf("last buffer2"); // delete ack_head; // while(ack_and_callsign != NULL){ // Base_tm *temp = ack_and_callsign->next_TM; @@ -577,6 +579,7 @@ } else if(enable_EoS){ // send_EoS(); + gPC.printf("eos2"); buffer_112[counter_buffer_112] = EoS[counter_EoS++]; if(counter_EoS == 120){ // cout<<"segments_sent = "<<segments_sent<<ENDL; @@ -603,7 +606,7 @@ // wait_ms(8); //ack_code = SD_READ(buffer_512, FSC + block_counter,SID); /* gPC.printf("read block %d \n\r",read_success);*/ - ack_code = 0xA0; + ack_code = 0x02; } else{ ack_code = SD_READ(buffer_512, list_of_FSC[block_counter],SID); @@ -614,7 +617,7 @@ } enable_read_block = false; if(ack_code == 0xA0){ - /*gPC.puts("read one block successfully")*/; + gPC.puts("read one block successfully"); enable_T_frame = true; enable_SCH = true; } @@ -637,7 +640,8 @@ stop = true; } } - if((PA_HOT || (!valid_SID)|| (gFLAGS & COM_SESSION_TIMEOUT_FLAG) ||(read_success != 0))&&(!enable_ackandcallsign)){ + if((PA_HOT || (!valid_SID)|| (gFLAGS & COM_SESSION_TIMEOUT_FLAG) ||(ack_code != 0xA0))&&(!enable_ackandcallsign)&&(!last_buffer)){ + gPC.printf("last condition"); uint8_t temp2 = TC_STATE_EXECUTION_FAILED; PUTexec_status(current_obsrs_tc, temp2); enable_ackandcallsign = true;