To fix the hang problem
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: CDMS_HK.h
- Revision:
- 290:3159ff1081a2
- Parent:
- 289:9bd62b69874c
- Child:
- 291:912da006918b
- Child:
- 292:61aa2169ea1c
--- a/CDMS_HK.h Sat Aug 06 06:34:38 2016 +0000 +++ b/CDMS_HK.h Sun Aug 07 10:36:59 2016 +0000 @@ -135,7 +135,7 @@ if(sd_stat) { gPC.puts("sd write failure"); - break; + // break; } gPC.printf("Completed CDMS HK\t"); @@ -172,7 +172,7 @@ if(sd_stat) { gPC.puts("sd write failure"); - break; + //break; } } @@ -197,7 +197,7 @@ beacon_array[7] = SD_FAULTCOUNT; 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[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)|(COM_TX_OC_FAULT); 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; @@ -335,7 +335,7 @@ //COMRX_OC_FAULT //$ GPIO_STATUS=(COMRX_OC_FAULT)?(GPIO_STATUS)||((uint16_t)(0x1<<11)):(GPIO_STATUS)&(~((uint16_t)(0x1<<11))); // COMTX_OC_FAULT //$ - GPIO_STATUS=(COMTX_OC_FAULT)?(GPIO_STATUS)||((uint16_t)(0x1<<10)):(GPIO_STATUS)&(~((uint16_t)(0x1<<10))); + GPIO_STATUS=(COM_TX_OC_FAULT)?(GPIO_STATUS)||((uint16_t)(0x1<<10)):(GPIO_STATUS)&(~((uint16_t)(0x1<<10))); //BAE_OC_FAULT //$ GPIO_STATUS=(BAE_OC_FAULT)?(GPIO_STATUS)||((uint16_t)(0x1<<9)):(GPIO_STATUS)&(~((uint16_t)(0x1<<9))); //PL_GPIO_1_STATUS //$ @@ -361,7 +361,7 @@ if(COMRX_OC_FAULT==0 && RSSI_volatge > 0.4) { COMRX_STATUS = COMRX_ALIVE; } else { - RESET_COMRX(); + //RESET_COMRX(); COMRX_RESET_COUNTER++; if(COMRX_OC_FAULT==0 && RSSI_volatge > 0.4) COMRX_STATUS = COMRX_ALIVE; @@ -381,7 +381,7 @@ response = spi.write(0x00); CDMS_RTC_BL = (response & 0x10) >>4; if(response & 0x04 == 0x04) { - RESET_RTC(); + //RESET_RTC(); RTC_STATUS = 0x01; RTC_FAULTCOUNT++; } @@ -498,7 +498,7 @@ void COLLECT_CDMS_RAM() { - CDMS_RAM[0] = ((PL_INIT_STATUS<<7)&0x80)|((PL_MAIN_STATUS<<6)&0x40)|((PL_LOW_POWER<<5)&0x20)|((PL_STATE<<3)&0x18)|(PL_STATUS&0x07); + CDMS_RAM[0] = ((PL_INIT_STATUS<<7)&0x80)|((PL_MAIN_status<<6)&0x40)|((PL_LOW_POWER<<5)&0x20)|((PL_STATE<<3)&0x18)|(PL_STATUS&0x07); CDMS_RAM[1] = ((PL_RCV_SC_DATA_STATUS<<7)&0x80)|((COM_SESSION<<6)&0x40)|((COM_RX<<5)&0x20)|((RF_SW_STATUS<<4)&0x10)|((COM_TX<<3)&0x08)|((COM_TX_STATUS<<2)&0x04)|((COM_MNG_TMTC<<1)&0x02)|(EN_CDMS_HK&0x01); CDMS_RAM[2] = ((EN_PL<<7)&0x80)|((EN_RCV_SC<<6)&0x40)|((CDMS_INIT_STATUS<<5)&0x20)|((CDMS_HK_MAIN_STATUS<<4)&0x10)|((CDMS_HK_STATUS<<2)&0x0C)|((COM_RX_STATUS<<1)&0x02)|(CDMS_RTC_BL&0x01); CDMS_RAM[3] = CDMS_I2C_ERR_SPEED_COUNTER >> 8;