Compression code changed and RLY_TMTC pointers managed

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Tue Jul 12 17:30:04 2016 +0000
Parent:
257:7d404e9dc9e2
Child:
260:65e1ace927fd
Commit message:
adding chaitanya's changes

Changed in this revision

COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
DefinitionsAndGlobals.h Show annotated file Show diff for this revision Revisions of this file
Flash.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/COM_MNG_TMTC.h	Tue Jul 12 17:07:17 2016 +0000
+++ b/COM_MNG_TMTC.h	Tue Jul 12 17:30:04 2016 +0000
@@ -461,13 +461,13 @@
                             mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]);
                             //32 bits at a time           
 
-                            if(mid<0 || mid>4)                                  //allowable MID values?
+                            if(mid<0 || mid>16)                                  //allowable MID values?
                             {
                                 ACK_L234(tm_pointer,0x02,GETpacket_seq_count(tc_ptr));
                                 return tm_ptr;
                             }                                                        
                             
-                            FCTN_CDMS_WR_S_FLASH(mid,(uint32_t)(tc_ptr->TC_string[5]<<24)+(uint32_t)(tc_ptr->TC_string[6]<<16)+(uint32_t)(tc_ptr->TC_string[7]<<8)+(uint32_t)(tc_ptr->TC_string[8]));                          
+                            FCTN_CDMS_WR_FLASH(mid,(uint32_t)(tc_ptr->TC_string[5]<<24)+(uint32_t)(tc_ptr->TC_string[6]<<16)+(uint32_t)(tc_ptr->TC_string[7]<<8)+(uint32_t)(tc_ptr->TC_string[8]));                          
 
                             ACK_L234(tm_pointer,0xA0,GETpacket_seq_count(tc_ptr));                     //ackCode = ? for success
 
@@ -486,7 +486,7 @@
                             }    
 
                             //Send TM for success after writing onto flash
-                            FCTN_CDMS_WR_L_FLASH(mid);
+                            //FCTN_CDMS_WR_L_FLASH(mid);
 
                             return tm_ptr;
                         }                                                    
@@ -497,7 +497,7 @@
                             return tm_ptr;
                         }
                     } 
-                }  */                                                                 
+                }                                                                
                 case 0x80:
                 {
                     gPC.printf("service:FUNCTION MANAGEMENT SERVICE\r\n"); 
--- a/DefinitionsAndGlobals.h	Tue Jul 12 17:07:17 2016 +0000
+++ b/DefinitionsAndGlobals.h	Tue Jul 12 17:30:04 2016 +0000
@@ -264,7 +264,7 @@
 DigitalIn COMRX_OC_FAULT (PIN68);
 DigitalIn COMTX_OC_FAULT (PIN69);
 DigitalIn BAE_OC_FAULT (PIN92);
-Digitalout PL_GPIO_1_STATUS (PIN71);
+DigitalOut PL_GPIO_1_STATUS (PIN71);
 DigitalOut PL_GPIO_2_STATUS (PIN81);
 DigitalOut PL_GPIO_3_STATUS (PIN80);
 DigitalIn PL_BEE_SW_OC_FAULT (PIN91);
@@ -279,7 +279,7 @@
 DigitalOut TRXY_EN (PIN84);
 DigitalOut TRZ_EN (PIN88);
 DigitalOut V_A_EN (PIN99);
-DigitalOut Sys_pwr_rst (PIN96);
+DigitalOut sys_pwr_rst (PIN96);
 
 DigitalOut PYLD_DFF (PIN73);
 DigitalOut PYLD_DFF_CLK (PIN65);
--- a/Flash.h	Tue Jul 12 17:07:17 2016 +0000
+++ b/Flash.h	Tue Jul 12 17:30:04 2016 +0000
@@ -1,5 +1,6 @@
 #include "FreescaleIAP.h"
 
+void FCTN_CDMS_WR_FLASH(uint16_t , uint32_t);
 int strt_add = flash_size() - (2*SECTOR_SIZE);
 uint32_t flasharray[32];    //256+(3*1024)
 uint32_t INITIAL_FLASH[32];
@@ -25,23 +26,23 @@
             {   
                 read[j] = nativeflash[j];
             }
-            EPS_V_A_EN_STATUS = read[0] >> 31;
-            BAE_SW_STATUS   = (read[0] << 1) >> 30; 
-            CDMS_SD_SW_STATUS = (read[0] << 3) >> 30;
-            PL_BEE_SW_STATUS = (read[0] << 5) >> 30;
-            PL_EPS_LATCH_SW_EN = (read[0] << 7) >> 31;
-            RTC_INIT_STATUS = (read[0] << 8) >> 30;
-            CDMS_RTC_DISABLE = (read[0] << 10) >> 31;
-            CDMS_RESET_COUNTER = read[0];
-            TIME_LATEST_CDSMS_RESET = read[1];
-            COM_TC_BYTES_LIMIT = read[2] >> 16;
-            COM_RX_CURRENT_MAX = (read[2] << 16) >> 24;
-            COM_RX_DISABLE_TIMEOUT = read[2];
-            COM_PA_TMP_HIGH = read[3] >> 24;
-            COM_PA_RECOVERY_TIMEOUT = (read[3] << 8) >> 24;
-            COM_SESSION_TIMEOUT = (read[3] << 16) << 24;
-            COM_RSSI_MIN = read[3];
-            SD_LIB_BLK_CURRENT = read[4] >> 16;
+            EPS_V_A_EN_STATUS = read[0];
+            BAE_SW_STATUS   = read[1]; 
+            CDMS_SD_SW_STATUS = read[2];
+            PL_BEE_SW_STATUS = read[3];
+            PL_EPS_LATCH_SW_EN = read[4];
+            RTC_INIT_STATUS = read[5];
+            CDMS_RTC_DISABLE = read[6];
+            CDMS_RESET_COUNTER = read[7];
+            TIME_LATEST_CDSMS_RESET = read[8];
+            COM_TC_BYTES_LIMIT = read[9];
+            COM_RX_CURRENT_MAX = read[10];
+            COM_RX_DISABLE_TIMEOUT = read[11];
+            COM_PA_TMP_HIGH = read[12];
+            COM_PA_RECOVERY_TIMEOUT = read[13];
+            COM_SESSION_TIMEOUT = read[14];
+            COM_RSSI_MIN = read[15];
+            SD_LIB_BLK_CURRENT = read[16];
         }
     
 }
@@ -60,24 +61,3 @@
 /*End*/
 
 /*===================================================MMS Functions=================================================*/
-
-void WRITE_TO_FLASH(uint8_t *);
-
-void WRITE_TO_FLASH(uint8_t *flash)
-{
-    uint32_t FLASH[5];
-    FLASH[0] = ((uint32_t)flash[0] << 24) | ((uint32_t)flash[1] << 16) | ((uint32_t)flash[2] << 8) | ((uint32_t)flash[3]); 
-    FLASH[1] = ((uint32_t)flash[4] << 24) | ((uint32_t)flash[5] << 16) | ((uint32_t)flash[6] << 8) | ((uint32_t)flash[7]);
-    FLASH[2] = ((uint32_t)flash[8] << 24) | ((uint32_t)flash[9] << 16) | ((uint32_t)flash[10] << 8) | ((uint32_t)flash[11]);
-    FLASH[3] = ((uint32_t)flash[12] << 24) | ((uint32_t)flash[13] << 16) | ((uint32_t)flash[14] << 8) | ((uint32_t)flash[15]);
-    FLASH[4] = ((uint32_t)flash[16] << 24) | ((uint32_t)flash[17] << 16) | ((uint32_t)flash[18] << 8) | ((uint32_t)flash[19]);
-    erase_sector(strt_add);
-    program_flash(strt_add, (char*)FLASH,160);
-}
-
-void FCTN_CDMS_WR_S_FLASH(uint16_t , uint32_t);
-
-void FCTN_CDMS_WR_S_FLASH(uint16_t mid, uint32_t datavalue)
-{
-    
-}
\ No newline at end of file
--- a/main.cpp	Tue Jul 12 17:07:17 2016 +0000
+++ b/main.cpp	Tue Jul 12 17:30:04 2016 +0000
@@ -25,7 +25,7 @@
 #include "OBSRS.h"
 #include "adf.h"
 #include "COM_RCV_TC.h"
-//#include "Flash.h"
+#include "Flash.h"
 #include "CDMS_PL.h"
 #include "FMS_all.h"
 #include "COM_MNG_TMTC.h"