for frequency correction testing

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Files at this revision

API Documentation at this revision

Comitter:
chaithanyarss
Date:
Wed Jul 27 12:14:58 2016 +0000
Parent:
280:5e2f8e06f01f
Child:
282:74a04dec4b95
Commit message:
some extra changes;

Changed in this revision

CDMS_HK.h Show annotated file Show diff for this revision Revisions of this file
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
FMS_all.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/CDMS_HK.h	Wed Jul 27 11:42:46 2016 +0000
+++ b/CDMS_HK.h	Wed Jul 27 12:14:58 2016 +0000
@@ -197,7 +197,7 @@
     beacon_array[8] = RTC_FAULTCOUNT >> 8;
     beacon_array[9] = RTC_FAULTCOUNT;
     beacon_array[10] = (((SD_STATUS == DEVICE_DISABLED || SD_STATUS == DEVICE_OC_FAULT)?1:0)<<7)|(RTC_STATUS <<6)|(COM_RX_STATUS<<3)|(V_C_PGOOD<<2)|(COMRX_OC_FAULT<<1)|(COMTX_OC_FAULT);
-    beacon_array[11] = (EPS_V_C_EN_STATUS <<7)|(COM_TX_CNTRL);
+    beacon_array[11] = (COM_RX_CNTRL <<7)|(COM_TX_CNTRL);
     beacon_array[12] = CDMS_HK_MAIN_COUNTER >>8;
     beacon_array[13] = CDMS_HK_MAIN_COUNTER;
     beacon_array[14] = PL_MAIN_COUNTER >>8;
@@ -349,7 +349,7 @@
     //PL_EPS_LATCH_SW_OC_FAULT // to be verified
     GPIO_STATUS=(PL_EPS_LATCH_SW_OC_FAULT)?(GPIO_STATUS)||((uint16_t)(0x1<<4)):(GPIO_STATUS)&(~((uint16_t)(0x1<<4)));
     //EPS_V_C_EN_STATUS
-    GPIO_STATUS=(EPS_V_C_EN_STATUS)?(GPIO_STATUS)||((uint16_t)(0x1<<3)):(GPIO_STATUS)&(~((uint16_t)(0x1<<3)));
+    GPIO_STATUS=(COM_RX_CNTRL)?(GPIO_STATUS)||((uint16_t)(0x1<<3)):(GPIO_STATUS)&(~((uint16_t)(0x1<<3)));
     //EPS_V_D_EN_STATUS
     GPIO_STATUS=(COM_TX_CNTRL)?(GPIO_STATUS)||((uint16_t)(0x1<<2)):(GPIO_STATUS)&(~((uint16_t)(0x1<<2)));
     
@@ -396,10 +396,10 @@
 {
     if(SD_STATUS != DEVICE_DISABLED) {
         if(SD_STATUS == DEVICE_OC_FAULT)
-            SD_SW_EN_DS = 0; //powering on SD
+            SD_SW_EN_DS = 1; //powering on SD
 
         if(SD_OC_FAULT == 0) {
-            SD_SW_EN_DS = 1; //switching off SD card
+            SD_SW_EN_DS = 0; //switching off SD card
 
             SD_FAULTCOUNT++;
             SD_STATUS = (SD_FAULTCOUNT == 3) ? DEVICE_DISABLED :DEVICE_OC_FAULT;
@@ -414,10 +414,10 @@
 {
     if(BAE_STATUS != DEVICE_DISABLED) {
         if(BAE_STATUS == DEVICE_OC_FAULT)
-            BAE_SW_EN_DS = 0; //Power ON BAE
+            BAE_SW_EN_DS = 1; //Power ON BAE
 
         if(BAE_OC_FAULT == 0) { // If OC Fault
-            BAE_SW_EN_DS = 1; //Switch OFF BAE
+            BAE_SW_EN_DS = 0; //Switch OFF BAE
             BAE_FAULTCOUNT++;
             BAE_STATUS = (BAE_FAULTCOUNT == 3)?DEVICE_DISABLED:DEVICE_OC_FAULT;
         } else {
--- a/COM_MNG_TMTC.h	Wed Jul 27 11:42:46 2016 +0000
+++ b/COM_MNG_TMTC.h	Wed Jul 27 12:14:58 2016 +0000
@@ -881,7 +881,13 @@
                         {                         
                             //gPC.printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function
                             
-                            STANDBY_PRCS();
+                            if(tc_ptr->TC_string[4] == 0x00 || tc_ptr->TC_string[4] == 0x01)
+                            EN_PL = tc_ptr->TC_string[4];
+                            else if(tc_ptr->TC_string[5] == 0x00 || tc_ptr->TC_string[5] == 0x01)
+                            EN_CDMS_HK = tc_ptr->TC_string[5];
+                            else if(tc_ptr->TC_string[6] == 0x00 || tc_ptr->TC_string[6] == 0x01)
+                            EN_RCV_SC = tc_ptr->TC_string[6];
+                            
                             Base_tm *tm_ptr_short = new Short_tm;
                             ACK_L234(tm_ptr_short,0xA0,GETpacket_seq_count(tc_ptr));
                             return tm_ptr_short;                                                    
--- a/DefinitionsAndGlobals.h	Wed Jul 27 11:42:46 2016 +0000
+++ b/DefinitionsAndGlobals.h	Wed Jul 27 12:14:58 2016 +0000
@@ -286,16 +286,16 @@
 DigitalOut PL_GPIO_3_STATUS (PIN80);// PYLD EPS CNTRL 3 / PYLD_EPS_CNTRL_3
 DigitalIn PL_BEE_SW_OC_FAULT (PIN91);
 DigitalIn PL_EPS_LATCH_SW_OC_FAULT (PIN5);
-DigitalOut EPS_V_C_EN_STATUS (PIN72,1);//COMM RX PWR CNTRL
-DigitalOut EPS_V_D_EN_STATUS (PIN56,1);//3V6_EN
+//DigitalOut EPS_V_C_EN_STATUS (PIN72,1);//COMM RX PWR CNTRL
+//DigitalOut EPS_V_D_EN_STATUS (PIN56,1);//3V6_EN
 
 
 DigitalIn SD_OC_FAULT (PIN90);
 DigitalOut SD_SW_EN_DS (PIN97,1);//SD CARD SW EN/DIS or SD_CARD_SW_EN_DIS
 DigitalOut BAE_SW_EN_DS (PIN47,1);//BAE_SW_EN_DIS
-DigitalOut TRXY_EN (PIN84);//TRXY EN
-DigitalOut TRZ_EN (PIN88);//TRZ EN
-DigitalOut V_A_EN (PIN99);//TRZ FLT (no INTR capability)
+//DigitalOut TRXY_EN (PIN84);//TRXY EN
+//DigitalOut TRZ_EN (PIN88);//TRZ EN
+DigitalOut V_A_EN (PIN99,1);//TRZ FLT (no INTR capability)
 DigitalOut sys_pwr_rst (PIN96);//PTD3
 
 DigitalOut PYLD_DFF (PIN73);//PYLD_SW_PWR_EN_DIS
--- a/FMS_all.h	Wed Jul 27 11:42:46 2016 +0000
+++ b/FMS_all.h	Wed Jul 27 12:14:58 2016 +0000
@@ -79,7 +79,7 @@
 
 void CDMS_SD_SW_ON()
 {
-    SD_SW_EN_DS = 0;
+    SD_SW_EN_DS = 1;
     SD_STATUS = DEVICE_POWERED;
     CDMS_SD_SW_STATUS = DEVICE_POWERED;
     FCTN_CDMS_WR_FLASH(2,DEVICE_POWERED);
@@ -88,7 +88,7 @@
 
 void CDMS_SD_SW_OFF()
 {
-    SD_SW_EN_DS = 1;
+    SD_SW_EN_DS = 0;
     SD_STATUS = DEVICE_DISABLED;
     CDMS_SD_SW_STATUS = DEVICE_DISABLED;
     FCTN_CDMS_WR_FLASH(2,DEVICE_DISABLED);
@@ -120,7 +120,7 @@
 
 void SW_ON_BAE()
 {
-    BAE_SW_EN_DS = 0;
+    BAE_SW_EN_DS = 1;
     BAE_STATUS = DEVICE_POWERED;
     BAE_SW_STATUS = DEVICE_POWERED;
     FCTN_CDMS_WR_FLASH(1,DEVICE_POWERED);
@@ -129,7 +129,7 @@
 
 void SW_OFF_BAE()
 {
-    BAE_SW_EN_DS = 1;
+    BAE_SW_EN_DS = 0;
     BAE_STATUS = DEVICE_DISABLED;
     BAE_SW_STATUS = DEVICE_DISABLED;
     FCTN_CDMS_WR_FLASH(1,DEVICE_DISABLED);
@@ -206,39 +206,39 @@
 
 void RST_SD()
 {
-    SD_SW_EN_DS = 1;
+    SD_SW_EN_DS = 0;
     wait_ms(10);
-    SD_SW_EN_DS = 0;
+    SD_SW_EN_DS = 1;
     gPC.printf("rst sd\n");
 }
 
 void SW_RST_BAE()
 {
-    BAE_SW_EN_DS = 1;
+    BAE_SW_EN_DS = 0;
     wait_ms(10);
-    BAE_SW_EN_DS = 0;
+    BAE_SW_EN_DS = 1;
     gPC.printf("rst bae\n");
 }
 
 void SW_RST_PL_BEE()
 {
-    PYLD_DFF = 1;
+    PYLD_DFF = 0;
     wait_ms(10);
-    PYLD_DFF = 0;
+    PYLD_DFF = 1;
 }
 
 void RST_BAE()
 {
-    RESET_TO_BAE = 1;
+    RESET_TO_BAE = 0;
     wait_ms(10);
-    RESET_TO_BAE = 0;
+    RESET_TO_BAE = 1;
 }
 
 void RST_PL_BEE()
 {
-    RESET_TO_PYLD = 1;
+    RESET_TO_PYLD = 0;
     wait_ms(10);
-    RESET_TO_PYLD = 0;
+    RESET_TO_PYLD = 1;
 }
 
 void CDMS_INTERNAL_RESET()
--- a/main.cpp	Wed Jul 27 11:42:46 2016 +0000
+++ b/main.cpp	Wed Jul 27 12:14:58 2016 +0000
@@ -21,11 +21,11 @@
 #include "cdms_sd.h"
 #include "common_functions.h"
 #include "RESET_functions.h"
+#include "CDMS_PL.h"
 #include "CDMS_HK.h"
 #include "adf.h"
 #include "COM_RCV_TC.h"
 #include "Flash.h"
-#include "CDMS_PL.h"
 #include "FMS_all.h"
 #include "Compression.h"
 #include "COM_MNG_TMTC.h"