publishing to check changes in cdms code
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE_samp_23SEP_DMA_flag by
Diff: CDMS_PL.h
- Revision:
- 298:5d3958886809
- Parent:
- 295:699801854b71
- Child:
- 306:7c3872365d58
diff -r 7cc868888d56 -r 5d3958886809 CDMS_PL.h --- a/CDMS_PL.h Mon Sep 05 06:25:57 2016 +0000 +++ b/CDMS_PL.h Mon Sep 05 07:38:12 2016 +0000 @@ -199,6 +199,7 @@ gPC.printf("\n\rACK_CODE = 0x%02X",temp); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_SUCCESS_I2C; + PL_STATUS = 0x04; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= EXECUTED; } @@ -208,6 +209,7 @@ //gPC.printf("\n\rACK_CODE = 0x%02X",temp); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_ERR_I2C; + PL_STATUS = 0x05; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= RETRY; } @@ -217,6 +219,7 @@ gPC.printf("\n\rShort_TM CRC failed"); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_ERR_I2C; + PL_STATUS = 0x05; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= RETRY; } @@ -241,6 +244,7 @@ gPC.printf("\n\rACK_CODE = 0x%02X",temp); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_SUCCESS_I2C; + PL_STATUS = 0x04; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= EXECUTED; } @@ -249,6 +253,7 @@ gPC.printf("\n\rACK_CODE failure (0x%02X)",temp); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_ERR_I2C; + PL_STATUS = 0x05; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= RETRY; } @@ -257,7 +262,8 @@ { gPC.printf("\n\rLong_TM CRC failed"); pl_main_flag = pl_main_flag & (~PL_DISABLED); - pl_main_flag |= PL_ERR_I2C; + pl_main_flag |= PL_ERR_I2C; + PL_STATUS = 0x05; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= RETRY; } @@ -303,8 +309,10 @@ return; uint8_t temp[3]; pl_main_flag|=PL_MAIN_STATUS; //Setting PL_MAIN_STATUS + PL_MAIN_status = 1; PL_MAIN_COUNTER++; pl_main_flag&=~(PL_LOW_POWER); //Clearing PL_LOW_POWER + PL_LOW_power = 0; temp[0] = (pl_main_flag&STATE_SCIENCE)>>2; temp[1] = (pl_main_flag&PL_DISABLED)>>4; temp[2] = (PL_PREV_STATE & STATE_SCIENCE)>>2; @@ -315,7 +323,9 @@ gPC.printf("\n\rDevice Disabled or OC Fault"); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_DISABLED; //setting PL_STATUS as PL_DISABLED + PL_STATUS = 0x07; pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing pl_main status + PL_MAIN_status = 0; print_exit(temp); return; } @@ -355,6 +365,7 @@ { pl_main_flag = pl_main_flag & (~STATE_SCIENCE); pl_main_flag |= STATE_HIBERNATE; + PL_STATE = 0x02; } else { @@ -386,27 +397,32 @@ { pl_main_flag = pl_main_flag & (~STATE_SCIENCE); pl_main_flag |= STATE_OFF; + PL_STATE = 0x00; } if((pl_block[pl_next_index-1] & 0x0000000C)==4) { pl_main_flag = pl_main_flag & (~STATE_SCIENCE); pl_main_flag |= STATE_STANDBY; + PL_STATE = 0x01; } if((pl_block[pl_next_index-1] & 0x0000000C)==8) { pl_main_flag = pl_main_flag & (~STATE_SCIENCE); pl_main_flag |= STATE_HIBERNATE; + PL_STATE = 0x02; } if((pl_block[pl_next_index-1] & 0x0000000C)==12) { pl_main_flag = pl_main_flag & (~STATE_SCIENCE); pl_main_flag |= STATE_SCIENCE; + PL_STATE = 0x03; } } else if((pl_block[pl_next_index-1] & UNEXECUTED)==1) { gPC.printf("\n\rElapsed block is executed"); pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing pl_main status + PL_MAIN_status = 0; print_exit(temp); return; } @@ -414,6 +430,7 @@ { gPC.printf("\n\rEmpty Schedule Block"); pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing pl_main status + PL_MAIN_status = 0; print_exit(temp); return; } @@ -432,10 +449,12 @@ PL_STATUS=0; } pl_main_flag = pl_main_flag & (~PL_DISABLED); - pl_main_flag |= PL_OFF; + pl_main_flag |= PL_OFF; + PL_STATUS = 0x00; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= EXECUTED; pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; @@ -456,8 +475,10 @@ { pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_STANDBY; + PL_STATUS = 0x01; } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; @@ -480,12 +501,14 @@ if((pl_main_flag & PL_DISABLED)==PL_SUCCESS_I2C) { pl_main_flag = pl_main_flag & (~PL_DISABLED); - pl_main_flag |= PL_HIBERNATE; + pl_main_flag |= PL_HIBERNATE; + PL_STATUS = 0x02; } } else { pl_main_flag |= PL_LOW_POWER; + PL_LOW_power = 1; if(PL_STATUS==0) { gPC.printf("\n\rPowering on PL_BEE"); @@ -499,14 +522,17 @@ { pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_STANDBY; + PL_STATUS = 0x01; } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; //////DELETE THE TM AND TC LATER } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; @@ -531,8 +557,10 @@ { pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_SCIENCE; + PL_STATUS = 0x03; } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; @@ -541,6 +569,7 @@ { gPC.printf("\n\rPower level = 2,3 or NA"); pl_main_flag |= PL_LOW_POWER; + PL_LOW_power = 1; if(POWER_LEVEL==2 || POWER_LEVEL==3 || POWER_LEVEL==0) { if(PL_STATUS==0) @@ -556,11 +585,13 @@ { pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_HIBERNATE; + PL_STATUS = 0x02; } } else { pl_main_flag |= PL_LOW_POWER; + PL_LOW_power = 1; if(PL_STATUS==0) { gPC.printf("\n\rPowering on PL_BEE"); @@ -574,14 +605,17 @@ { pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_STANDBY; + PL_STATUS = 0x01; } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; //////DELETE THE TM AND TC LATER } pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return; @@ -593,9 +627,11 @@ gPC.printf("\n\rInvalid PL_STATE in block at index = %d",pl_next_index-1); pl_main_flag = pl_main_flag & (~PL_DISABLED); pl_main_flag |= PL_INVALID_STATE; + PL_STATUS = 0x06; pl_block[pl_next_index-1] &= (~UNEXECUTED); //changing exec_status pl_block[pl_next_index-1] |= EXECUTED; pl_main_flag = pl_main_flag & (~PL_MAIN_STATUS); //Clearing PL_MAIN_STATUS + PL_MAIN_status = 0; print_processed_block(pl_next_index-1); print_exit(temp); return;