
Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Revision 109:78f2912e3473, committed 2016-01-26
- Comitter:
- ee12b079
- Date:
- Tue Jan 26 14:15:04 2016 +0000
- Parent:
- 101:bece931236a2
- Child:
- 110:e5091ab345de
- Commit message:
- DMA working..to be tested thoruohgly;
Changed in this revision
--- a/Compression.h Tue Jan 26 13:15:01 2016 +0000 +++ b/Compression.h Tue Jan 26 14:15:04 2016 +0000 @@ -280,7 +280,9 @@ if(id == 1){ //below thereshold space = adjust(1,0,pointer,8); space = adjust(4,3,pointer,space); + #if USE_SD FSC_science = FCTN_SD_MNGR(3); + #endif //gPC.printf("SID = 3, FSC = %02X\r\n", FSC_science); frames[id][1] = (FSC_science>>24)&0xff; frames[id][2] = (FSC_science>>16)&0xff; @@ -315,10 +317,12 @@ convolution(frames[id]); interleave(TM_convoluted_data,TM_interleave_data); interleave(TM_convoluted_data+ 135,TM_interleave_data + 144); + #if USE_SD if(id == 1) SD_WRITE(TM_interleave_data,FSC_science,3); else if (id == 2) SD_WRITE(TM_interleave_data,FSC_science,2); + #endif FSC_science++; //remove this after testing position_tm_frame[id] = position_tm_starting[id]; frames[id][6-id] = (length-1) - j; // first head pointer. @@ -573,7 +577,9 @@ pointer = frames[id]; space = adjust(1,0,pointer,8); space = adjust(4,1,pointer,space); + #if USE_SD FSC_science = FCTN_SD_MNGR(1); + #endif //gPC.printf("SID = 1, FSC = %02X\r\n", FSC_science); frames[id][1] = (FSC_science>>16)&0xff; frames[id][2] = (FSC_science>>8)&0xff; @@ -588,7 +594,9 @@ convolution(frames[id]); interleave(TM_convoluted_data,TM_interleave_data); interleave(TM_convoluted_data+ 135,TM_interleave_data + 144); + #if USE_SD SD_WRITE(TM_interleave_data,FSC_science,1); + #endif position_tm_frame[id] = position_tm_starting[id]; frames[id][4] = (length-1) - j; }
--- a/DefinitionsAndGlobals.h Tue Jan 26 13:15:01 2016 +0000 +++ b/DefinitionsAndGlobals.h Tue Jan 26 14:15:04 2016 +0000 @@ -2,6 +2,10 @@ #define bypass_adf 0 +// DEBUG + #define DEBUG 1 + #define USE_SD 0 + // COM_RX #define RX_TIMEOUT_LIMIT 0.5 //#define COM_RX_UART_TX PTE20 // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_TX USBTX @@ -14,7 +18,7 @@ #define SPI_MOSI PTE1 #define SPI_MISO PTE3 #define SPI_CLK PTE2 - #define SPI_CS_ADF PTA15 + #define SPI_CS_ADF D8 #define SPI_CS_SDC PTE22 #define SPI_CS_RTC PTE29 @@ -23,7 +27,7 @@ #define COM_TX_TICKER_LIMIT 32 // ADF INTERRUPUT - #define ADF_IRQ PTA14 + #define ADF_IRQ D9 // TC LIST #define TCL_STATE_INCOMPLETE 0x00 @@ -108,10 +112,10 @@ // PAYLOAD or SCIENCE #define PAYLOAD_BUFFER_LENGTH 6723 - #define PAY_SPI_MOSI D11 - #define PAY_SPI_MISO D12 - #define PAY_SPI_CLK D13 - #define PAY_SPI_CS D10 + #define PAY_SPI_MOSI PTA16 + #define PAY_SPI_MISO PTA17 + #define PAY_SPI_CLK PTA15 + #define PAY_SPI_CS PTA14 // ****************GLOBAL VARIABLES******************
--- a/main.cpp Tue Jan 26 13:15:01 2016 +0000 +++ b/main.cpp Tue Jan 26 14:15:04 2016 +0000 @@ -2,8 +2,6 @@ #include "mbed.h" -#define DEBUG 1 - #include "SimpleDMA.h" #include "dmaSPIslave.h" #include "rtos.h" @@ -24,7 +22,6 @@ #include "Compression.h" #include "ThreadsAndFunctions.h" -void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);} int main() { #if DEBUG @@ -56,7 +53,9 @@ gCS_ADF = 1; //FCTN_CDMS_INIT_RTC();/* rtc initialization*/ + #if USE_SD FCTN_CDMS_SD_INIT();/* sd card initialization*/ + #endif // initialise_card(); // int result= initialise_card(); @@ -81,10 +80,6 @@ #endif // *******************INITIALISATIONS END******************** - /*starting the thread with signal*/ - set_sig(); - - /*Calculating Stack used*/ int state;