
Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Revision 185:3b3cd96a7811, committed 2016-06-17
- Comitter:
- ee12b079
- Date:
- Fri Jun 17 11:36:22 2016 +0000
- Parent:
- 184:d75cea6f5d49
- Child:
- 186:eb19a02f83d6
- Child:
- 189:1140091f5cec
- Commit message:
- PL_I2C worked in main() by bae way
Changed in this revision
DefinitionsAndGlobals.h | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/DefinitionsAndGlobals.h Sat Jun 11 10:05:52 2016 +0000 +++ b/DefinitionsAndGlobals.h Fri Jun 17 11:36:22 2016 +0000 @@ -12,7 +12,7 @@ // COMMON SPI #define SPI_MOSI PTE1 - #define SPI_MISO PTE2 + #define SPI_MISO PTE3 #define SPI_CLK PTE2 #define SPI_CS_ADF PTA15 #define SPI_CS_SDC PIN20 @@ -29,7 +29,7 @@ //I2C - Payload to CDMS (need to change while using CDMS hardware); I2C master(PIN32,PIN31); DigitalIn PYLD_I2C_Int(PTC13); -DigitalOut PYLD_I2C_GPIO(PTE3); +DigitalOut PYLD_I2C_GPIO(PTC1); //I2C - CDMS to BAE DigitalIn BAE_I2C_GPIO(PIN39);
--- a/main.cpp Sat Jun 11 10:05:52 2016 +0000 +++ b/main.cpp Fri Jun 17 11:36:22 2016 +0000 @@ -33,12 +33,41 @@ #include "Compression.h" #include "ThreadsAndFunctions.h" +#define PL_TC(tm_ptr){\ + Base_tc *beacon_tc = new Short_tc;\ + beacon_tc->next_TC = NULL;\ + PUTshort_or_long(beacon_tc,SHORT_TC_CODE);\ + PUTcrc_pass(beacon_tc,0x1);\ + PUTexec_status(beacon_tc,0);\ + beacon_tc->TC_string[0] = 0x01;\ + beacon_tc->TC_string[1] = 0xE0;\ + beacon_tc->TC_string[2] = 0x81;\ + beacon_tc->TC_string[3] = 0xD0;\ + beacon_tc->TC_string[4] = 0x00;\ + beacon_tc->TC_string[5] = 0;\ + beacon_tc->TC_string[6] = 0;\ + beacon_tc->TC_string[7] = 0;\ + beacon_tc->TC_string[8] = 0;\ + uint16_t crc16 = crc16_gen(beacon_tc->TC_string, 9);\ + beacon_tc->TC_string[9] = (crc16 & 0xFF00)>>8;\ + beacon_tc->TC_string[10] = (crc16 & 0x00FF);\ + tm_ptr = FCTN_CDMS_RLY_TMTC(beacon_tc);\ +} + //void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);} int main() { + CDMS_I2C_GPIO = 0; + PYLD_I2C_GPIO = 0; - CDMS_I2C_GPIO = 0; + gPC.printf("PL_TC sending\r\n"); + + Base_tm *tm_ptr = new Short_tm; + PL_TC(tm_ptr); + + gPC.printf("PL_TC sent"); + //gLEDR = 1; // ******************INITIALISATIONS START****************** @@ -72,6 +101,8 @@ gPC.puts("welcome to mng_tmtc\r\n"); #endif + + // COM_MNG_TMTC THREAD gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN); gCOM_MNG_TMTC_THREAD->set_priority(osPriorityHigh);