Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: common_functions.h
- Revision:
- 213:867de6d350fa
- Parent:
- 122:b99f8be0a51a
- Child:
- 215:570251b23c7b
diff -r f4acf895b598 -r 867de6d350fa common_functions.h
--- a/common_functions.h Sat Jul 02 15:28:21 2016 +0000
+++ b/common_functions.h Sun Jul 03 09:26:42 2016 +0000
@@ -77,7 +77,7 @@
}\
}\
else{\
- /*PENDING: reset cdms*/\
+ RESET_CDMS;\
break;\
}\
}\
@@ -99,18 +99,24 @@
/*Attach this new node at the end*/\
}\
else{\
- /*PENDING: reset CDMS*/\
+ RESET_CDMS;\
break;\
}\
}\
}
#define put_crc_l1_ack(tm_ptr) {\
- tm_ptr->TM_string[2] = gTOTAL_CRC_FAIL_TC & 0xFF;\
/*TC LIST STATUS*/\
- tm_ptr->TM_string[3] |= (gMASTER_STATE << 5) & 0xE0;\
+ tm_ptr->TM_string[3] |= (gMASTER_STATE << 6) & 0xC0;\
/*PA HOT*/\
if( gFLAGS & COM_PA_HOT_FLAG ){\
+ tm_ptr->TM_string[3] |= (1 << 5);\
+ }\
+ else{\
+ tm_ptr->TM_string[3] &= ~(1 << 5);\
+ }\
+ /*PA OC*/\
+ if( gFLAGS & COM_PA_OC_FLAG ){\
tm_ptr->TM_string[3] |= (1 << 4);\
}\
else{\
@@ -124,16 +130,39 @@
#define fill_l1_ack(tm_ptr) {\
tm_ptr->next_TM = NULL;\
tm_ptr->TM_string[0] = TMID_ACK_L1 << 4;\
- /*PENDING: PA TEMPERATURE*/\
tm_ptr->TM_string[1] = gTOTAL_INCORRECT_SIZE_TC & 0xFF;\
tm_ptr->TM_string[2] = gTOTAL_CRC_FAIL_TC & 0xFF;\
}
+#define P_COM_HK{\
+ uint8_t returnHere;\
+ isPAhot(returnHere);\
+ if (returnHere == 0xFF)\
+ gFLAGS = gFLAGS & ~(COM_PA_HOT_FLAG);\
+ else\
+ gFLAGS = gFLAGS | COM_PA_HOT_FLAG;\
+ if (gFLAGS & COM_PA_OC_FLAG){\
+ COM_TX_CNTRL = 1;\
+ wait_ms(5);\
+ }\
+ isPAoc(returnHere);\
+ if (returnHere == 0xFF)\
+ gFLAGS = gFLAGS & ~(COM_PA_OC_FLAG);\
+ else\
+ gFLAGS = gFLAGS | COM_PA_OC_FLAG;\
+ /*P_CDMS_HANDLE_HW_FAULTS*/\
+}
+
#define isPAhot(returnHere){\
/*PENDING : COMPLETE THIS FUNCTION*/\
returnHere = 0xFF;\
}
+#define isPAoc(returnHere){\
+ /*PENDING : COMPLETE THIS FUNCTION*/\
+ returnHere = 0xFF;\
+}
+
#define get_call_sign(tm_ptr) {\
Base_tm* call_sign_tm = new Short_tm;\
call_sign_tm->next_TM = NULL;\
@@ -156,7 +185,6 @@
/*IF CRC PASS*/\
if( (GETcrc_pass(current_TC) == 1) ){\
if(TC_count > 4){\
- /*PENDING: FILL TC_EXEC_CODE, APPEND CRC TO THE TM*/\
put_crc_l1_ack( l1_ack );\
/*extend the TM linked list*/\
TC_count = 0;\
@@ -189,7 +217,7 @@
++overflowCountL1;\
}\
else{\
- /*PENDING: RESET CDMS*/\
+ RESET_CDMS;\
break;\
}\
}\
