Compression code changed and RLY_TMTC pointers managed

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
264:f7d8f9f361e3
Parent:
263:3b872778b8c7
Child:
265:ae588e75cfa4
--- a/COM_MNG_TMTC.h	Thu Jul 14 19:54:27 2016 +0000
+++ b/COM_MNG_TMTC.h	Thu Jul 14 23:05:09 2016 +0000
@@ -365,19 +365,22 @@
             y = FCTN_I2C_WRITE((char*)tc_ptr->TC_string,TC_LONG_SIZE);                         // Check for SHORT and LONG TC and then send
                 
             if(y==1)                                                            
-            {                                                                               
+            {        
+                gPC.printf("BAE write fail\r\n");                                                                       
                 ACK_L234(tm_ptr_short,0x03,GETpacket_seq_count(tc_ptr));
                 return tm_ptr_short;
             }                                  
             else if(y==0)
             {
+                gPC.printf("BAE write succe\r\n");
                 //wait(0.2);
-                uint8_t poll=0;
-                while(poll<60 && BAE_I2C_GPIO==0)
+                int poll=0;
+                while(poll<9000 && BAE_I2C_GPIO==0)
                 {
-                    wait_ms(50);
+                    wait_us(10);
                     poll+=1;
-                }    
+                }
+                //while(BAE_I2C_GPIO==0){}   
                 if(BAE_I2C_GPIO == 1)                                            //name to be changed later
                 {
                     gPC.printf("BAE_I2C_GPIO is high\r\n");
@@ -385,11 +388,13 @@
                     y=FCTN_I2C_READ((char*)tm_pointer->TM_string,TM_LONG_SIZE);            //rify later about the size
                     if(y==0)
                     {
+                        gPC.printf("BAE read success\r\n");
                         tm_pointer->next_TM=NULL;
                         return tm_ptr;
                     }
                     else if(y==1)
                     {
+                        gPC.printf("BAE read fail\r\n");
                         ACK_L234(tm_ptr_short,0x85,GETpacket_seq_count(tc_ptr));                
                         //gPC.printf("\n\rPTE->PDIR = 0x%08X",PTE->PDIR);
                         return tm_ptr_short;
@@ -1074,10 +1079,10 @@
             else if(y==0)
             {
                 //wait(0.2);
-                uint8_t poll=0;
-                while(poll<60 && PL_I2C_Intr==0)
+                int poll=0;
+                while(poll<900 && PL_I2C_Intr==0)
                 {
-                    wait_ms(50);
+                    wait_us(10);
                     poll+=1;
                 }    
                 if(PL_I2C_Intr == 1)                                            //name to be changed later