adf.h updated snd tm needs to be changed

Dependencies:   mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Files at this revision

API Documentation at this revision

Comitter:
krishanprajapat
Date:
Thu Dec 31 08:58:17 2015 +0000
Parent:
7:79ef05a77cc4
Commit message:
adf.h modified snd_tm needs to be changed 31 dec

Changed in this revision

adf.h Show annotated file Show diff for this revision Revisions of this file
diff -r 79ef05a77cc4 -r 3bf584e8ae60 adf.h
--- a/adf.h	Thu Dec 31 08:50:47 2015 +0000
+++ b/adf.h	Thu Dec 31 08:58:17 2015 +0000
@@ -6,6 +6,7 @@
 bool loop_on;
 bool ADF_off;
 bool buffer_state;
+bool finish_write_data;
 uint8_t signal = 0x00;
 unsigned char bbram_buffer[66]={0x19,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0xF4,0xC2,0x10,0xC0,0x00,0x30,0x31,0x07,0x00,0x01,0x00,0x7F,0x00,0x0B,0x37,0x00,0x00,0x40,0x0C,0x00,0x05,0x00,0x00,0x18,0x12,0x34,0x56,0x10,0x10,0xC4,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00};
 
@@ -414,7 +415,7 @@
     SPI_mutex.unlock();\
     buffer_state = !buffer_state;\
     if(last_buffer){\
-        ADF_off = true;\
+        finish_write_data = true;\
         gPC.puts("adf_off\r\n");\
     }\
 }
@@ -523,6 +524,7 @@
 //}
 
 void configure_adf(){
+    finish_write_data = false;
     buffer_state = true;
     last_buffer = false;
     loop_on = true;
@@ -547,15 +549,21 @@
     while(loop_on){
         gCOM_MNG_TMTC_THREAD->signal_wait(COM_MNG_TMTC_SIGNAL_ADF_NSD);
 //        if( ADF_non_responsive_flag == false ){
-            if(ADF_off){
-                SPI_mutex.lock();
-                ticker.detach();
-    //            wait_ms(35); 
-                gCS_ADF=0;
-                spi.write(0xB1);
-                gCS_ADF=1;
-                SPI_mutex.unlock();
-                loop_on = false;
+            if(finish_write_data){
+                if(ADF_off){
+                    SPI_mutex.lock();
+                    ticker.detach();
+        //            wait_ms(35); 
+                    gCS_ADF=0;
+                    spi.write(0xB1);
+                    gCS_ADF=1;
+                    SPI_mutex.unlock();
+                    loop_on = false;
+                    gPC.puts("Transmission done\r\n");
+                }
+                else{
+                    ADF_off = true;
+                }
             }else{   
                 write_data;
                 snd_tm.transmit_data(buffer_112,&last_buffer);