CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
262:752c8689944a
Parent:
261:1e54415b34d3
Child:
264:f7d8f9f361e3
--- a/DefinitionsAndGlobals.h	Thu Jul 14 13:07:30 2016 +0000
+++ b/DefinitionsAndGlobals.h	Thu Jul 14 17:57:05 2016 +0000
@@ -38,10 +38,9 @@
 
 // TC LIST
     #define TCL_STATE_INCOMPLETE 0x00
-    #define TCL_STATE_ABORTED 0x03
-    #define TCL_STATE_EXECUTING 0x04   
-    #define TCL_STATE_COMPLETED 0x05
-    #define TCL_STATE_EXCEEDED_LIMIT 0x06
+    #define TCL_STATE_ABORTED 0x01
+    #define TCL_STATE_EXECUTING 0x02   
+    #define TCL_STATE_COMPLETED 0x03
 
 // LIST OF FLAGS
     #define UART_INT_FLAG 0x0001
@@ -52,6 +51,7 @@
     #define COM_SESSION_VALIDITY 0x0020
     #define ALL_CRC_PASS_FLAG 0x0040
     #define COM_PA_HOT_FLAG 0x0080
+    #define COM_PA_OC_FLAG 0x8000
     #define COM_TX_FLAG 0x0100
     #define COM_SESSION_TIMEOUT_FLAG 0x0200
     #define COM_AUTO_POWER_OFF_BAE_FLAG 0x0400
@@ -69,10 +69,11 @@
     #define COM_MNG_TMTC_SIGNAL_UART_INT 0x01
     #define COM_MNG_TMTC_SIGNAL_ADF_NSD 0x02
     #define COM_MNG_TMTC_SIGNAL_ADF_SD 0x03
+    #define cdms_reset_timeout 345600000
     
 // COM_MNG_TMTC
     #define COM_PA_COOLING_TIME_LIMIT 20
-    #define COM_MAX_TC_LIMIT 200
+    #define COM_MAX_TC_LIMIT 256
     #define TM_ACK_CODE_INDEX 2
     #define CRC_FAIL_NACK_CODE 0x01
     
@@ -83,6 +84,7 @@
     // max value of telecommands in a tcl
     #define TCL_OVERFLOW_CONSTANT 256
     #define TM_OVERFLOW_CONSTANT 256
+    #define BYTE_OVERFLOW_CONSTANT 35000
 
     // starting value of packet sequence count at each pass 
     #define PSC_START_VALUE 1
@@ -142,8 +144,8 @@
     #define BAE_RESET_PID 0x33
 
 //RF RELAY
-    #define RF_RELAY_CNTRL_TX PTA7
-    #define RF_RELAY_CNTRL_BCN PTA12 
+    #define RF_RELAY_CNTRL_TX PTB7
+    #define RF_RELAY_CNTRL_BCN PTB12 
     
 //CDMS HK
 #define HK_SIGNAL 0x05
@@ -173,6 +175,7 @@
 COM_RX_DATA_NODE *gRX_CURRENT_DATA_NODE = NULL;
 // uint8_t *gRX_CURRENT_PTR = NULL;
 uint32_t gRX_COUNT = 0;
+uint16_t gTOTAL_RAW_BYTES = 0;
 uint16_t gTOTAL_INCORRECT_SIZE_TC = 0x00;
 uint16_t gTOTAL_CRC_FAIL_TC = 0x00;
 uint16_t gTOTAL_REPEATED_TC = 0x00;
@@ -194,6 +197,7 @@
 //COM_RX
 DigitalOut COM_RX_CNTRL(PIN72);
 DigitalOut COM_TX_CNTRL(PIN56);
+DigitalIn COM_TX_OC_FAULT(PIN69);
 
 // TC LIST
 Base_tc* gHEAD_NODE_TCL = NULL;
@@ -205,10 +209,10 @@
 Thread* gCOM_MNG_TMTC_THREAD = NULL;
 Timeout gRX_TIMEOUT;
 Timeout gSESSION_TIMEOUT;
+Timeout gCOM_RX_DISABLE;
 
 // COM_MNG_TMTC
-
-
+RtosTimer *sys_reset_cdms_timer;
 
 // PA cooling timeout
 Timeout gCOM_PA_COOLING_TIMEOUT;