cdms_i2c_hardware_test

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of standaloneworkingi2c_cdms by Team Fox

Committer:
ee12b079
Date:
Sun Jan 24 13:30:11 2016 +0000
Revision:
91:611c066467a1
Parent:
90:4d76de54a699
Child:
92:42d6747900cb
Compression.h tested, works when flash.h is commented due to ram-size.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shreeshas95 8:fcd26c28411d 1 // TESTING PUSH PULL IN MAIN CPP
shreeshas95 8:fcd26c28411d 2
shreeshas95 0:f016e9e8d48b 3 #include "mbed.h"
shreeshas95 0:f016e9e8d48b 4 #include "rtos.h"
shreeshas95 1:a0055b3280c8 5 #include "mbed_debug.h"
shreeshas95 0:f016e9e8d48b 6
shreeshas95 0:f016e9e8d48b 7 #include "Structures.h"
shreeshas95 0:f016e9e8d48b 8 #include "DefinitionsAndGlobals.h"
shreeshas95 0:f016e9e8d48b 9 #include "crc.h"
shreeshas95 1:a0055b3280c8 10 #include "COM_SND_TM_functions.h"
shreeshas95 1:a0055b3280c8 11 #include "COM_SND_TM.h"
ee12b079 81:b0f7a241ddf3 12 //#include "SDCread.h"
ee12b079 83:a26f5f22631d 13 #include "cdms_sd.h"
ee12b079 83:a26f5f22631d 14 #include "OBSRS.h"
shreeshas95 1:a0055b3280c8 15 #include "adf.h"
ee12b079 81:b0f7a241ddf3 16 //#include "SDC_init.h"
shreeshas95 0:f016e9e8d48b 17 #include "COM_RCV_TC.h"
shreeshas95 0:f016e9e8d48b 18 #include "COM_MNG_TMTC.h"
shreeshas95 4:104dd82c99b8 19 #include "COM_POWER_ON_TX.h"
shreeshas95 4:104dd82c99b8 20 #include "COM_POWER_OFF_TX.h"
ee12b079 90:4d76de54a699 21 #include "Compression.h"
shreeshas95 0:f016e9e8d48b 22 #include "ThreadsAndFunctions.h"
shreeshas95 0:f016e9e8d48b 23
shreeshas95 0:f016e9e8d48b 24 int main()
shreeshas95 0:f016e9e8d48b 25 {
shreeshas95 0:f016e9e8d48b 26 // ******************INITIALISATIONS START******************
shreeshas95 0:f016e9e8d48b 27 // COM RX
shreeshas95 0:f016e9e8d48b 28 RX1M.baud(1200);
shreeshas95 0:f016e9e8d48b 29 gRX_HEAD_DATA_NODE = new COM_RX_DATA_NODE;
shreeshas95 0:f016e9e8d48b 30 gRX_HEAD_DATA_NODE->next_node = NULL;
shreeshas95 0:f016e9e8d48b 31 gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE;
shreeshas95 2:2caf2a9a13aa 32 gRX_COUNT = 0;
shreeshas95 2:2caf2a9a13aa 33 // gRX_CURRENT_PTR = gRX_CURRENT_DATA_NODE->values;
shreeshas95 0:f016e9e8d48b 34 RX1M.attach(&rx_read, Serial::RxIrq);
shreeshas95 0:f016e9e8d48b 35
shreeshas95 0:f016e9e8d48b 36 // DEBUG
ee12b079 85:b9beee1a7a3e 37 //gPC.puts("welcome to mng_tm_tc\r\n");
aniruddhv 52:0bd68655c651 38 gPC.baud(1200);
shreeshas95 0:f016e9e8d48b 39
shreeshas95 0:f016e9e8d48b 40 // COMMON SPI
shreeshas95 0:f016e9e8d48b 41 spi.format(8,0);
shreeshas95 0:f016e9e8d48b 42 spi.frequency(1000000);
shreeshas95 0:f016e9e8d48b 43
shreeshas95 0:f016e9e8d48b 44 // SD CARD
ee12b079 83:a26f5f22631d 45 cs_sd = 1;
shreeshas95 2:2caf2a9a13aa 46 gCS_RTC = 1;
ee12b079 87:df55a5f68331 47 gCS_ADF = 1;
ee12b079 90:4d76de54a699 48
ee12b079 90:4d76de54a699 49 FCTN_CDMS_INIT_RTC();/* rtc initialization*/
ee12b079 90:4d76de54a699 50 FCTN_CDMS_SD_INIT();/* sd card initialization*/
ee12b079 90:4d76de54a699 51
shreeshas95 0:f016e9e8d48b 52 // initialise_card();
shreeshas95 0:f016e9e8d48b 53 // int result= initialise_card();
shreeshas95 0:f016e9e8d48b 54 // disk_initialize();
shreeshas95 0:f016e9e8d48b 55
shreeshas95 0:f016e9e8d48b 56 // COM_TX
shreeshas95 0:f016e9e8d48b 57 // *********************THE TEST
shreeshas95 0:f016e9e8d48b 58 // cs_adf=1;
shreeshas95 0:f016e9e8d48b 59 // *********************THE TEST
shreeshas95 0:f016e9e8d48b 60
shreeshas95 0:f016e9e8d48b 61 // COM_MNG_TMTC THREAD
shreeshas95 0:f016e9e8d48b 62 gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN);
shreeshas95 0:f016e9e8d48b 63 gCOM_MNG_TMTC_THREAD->set_priority(osPriorityAboveNormal);
ee12b079 91:611c066467a1 64 gPC.puts("allocating threads\r\n");
ee12b079 90:4d76de54a699 65 gSCIENCE_THREAD = new Thread(SCIENCE_FUN);
ee12b079 91:611c066467a1 66 // gPC.puts("step one complete\r\n");
ee12b079 91:611c066467a1 67 gSCIENCE_THREAD->set_priority(osPriorityAboveNormal);
ee12b079 91:611c066467a1 68 gPC.puts("competed allocating threads\r\n");
shreeshas95 0:f016e9e8d48b 69 // *******************INITIALISATIONS END********************
shreeshas95 0:f016e9e8d48b 70
ee12b079 91:611c066467a1 71 /*Calculating Stack used*/
ee12b079 91:611c066467a1 72
shreeshas95 0:f016e9e8d48b 73 int theAcount = 0;
shreeshas95 0:f016e9e8d48b 74 while(true){
shreeshas95 6:79d422d1ed42 75 Thread::wait(osWaitForever);
shreeshas95 0:f016e9e8d48b 76 }
shreeshas95 0:f016e9e8d48b 77 }