Simple version of COM_MNG_TMTC_CODE for IITMSAT.
Dependencies: mbed-rtos mbed FreescaleIAP SimpleDMA
Diff: COM_MNG_TMTC.h
- Revision:
- 14:08c2c887ea09
- Parent:
- 12:ffdb29353058
- Child:
- 15:1c1ca992b43b
diff -r 615e842073dd -r 08c2c887ea09 COM_MNG_TMTC.h --- a/COM_MNG_TMTC.h Thu Dec 31 11:52:47 2015 +0000 +++ b/COM_MNG_TMTC.h Thu Dec 31 12:04:21 2015 +0000 @@ -46,15 +46,15 @@ } #define detect_ack(tm_ptr, temp_ack, tc_psc) {\ - int length = TM_SHORT_SIZE;\ - if( GETshort_or_long_tm(tm_ptr->fields) == SHORT_TM_CODE ){\ - length = TM_SHORT_SIZE;\ - }\ - else{\ - length = TM_LONG_SIZE;\ - }\ - uint16_t crc = crc16_gen(tm_ptr->TM_string, length-2);\ if( tm_ptr != NULL ){\ + int length = TM_SHORT_SIZE;\ + if( GETshort_or_long_tm(tm_ptr->fields) == SHORT_TM_CODE ){\ + length = TM_SHORT_SIZE;\ + }\ + else{\ + length = TM_LONG_SIZE;\ + }\ + uint16_t crc = crc16_gen(tm_ptr->TM_string, length-2);\ if( (((crc & 0xFF00) >> 8) == tm_ptr->TM_string[length-2]) && ( (crc & 0x00FF) == tm_ptr->TM_string[length-1] ) ){\ uint8_t temp8;\ temp8 = tm_ptr->TM_string[TM_ACK_CODE_INDEX];\