CDMS code for testing sbc
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
main.cpp@67:4819b5f28285, 2016-01-17 (annotated)
- Committer:
- sukhdeep
- Date:
- Sun Jan 17 12:51:08 2016 +0000
- Revision:
- 67:4819b5f28285
- Parent:
- 52:0bd68655c651
- Child:
- 68:56849cc619ca
cdms new functions not intigrated version1.1;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shreeshas95 | 7:fcd26c28411d | 1 | // TESTING PUSH PULL IN MAIN CPP |
shreeshas95 | 7: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" |
shreeshas95 | 1:a0055b3280c8 | 12 | #include "SDCread.h" |
shreeshas95 | 1:a0055b3280c8 | 13 | #include "adf.h" |
shreeshas95 | 1:a0055b3280c8 | 14 | #include "SDC_init.h" |
shreeshas95 | 0:f016e9e8d48b | 15 | #include "COM_RCV_TC.h" |
shreeshas95 | 0:f016e9e8d48b | 16 | #include "COM_MNG_TMTC.h" |
shreeshas95 | 4:104dd82c99b8 | 17 | #include "COM_POWER_ON_TX.h" |
shreeshas95 | 4:104dd82c99b8 | 18 | #include "COM_POWER_OFF_TX.h" |
sukhdeep | 67:4819b5f28285 | 19 | #include "compression_l.h" |
shreeshas95 | 0:f016e9e8d48b | 20 | #include "ThreadsAndFunctions.h" |
shreeshas95 | 0:f016e9e8d48b | 21 | |
sukhdeep | 67:4819b5f28285 | 22 | |
shreeshas95 | 0:f016e9e8d48b | 23 | int main() |
shreeshas95 | 0:f016e9e8d48b | 24 | { |
shreeshas95 | 0:f016e9e8d48b | 25 | // ******************INITIALISATIONS START****************** |
shreeshas95 | 0:f016e9e8d48b | 26 | // COM RX |
shreeshas95 | 0:f016e9e8d48b | 27 | RX1M.baud(1200); |
shreeshas95 | 0:f016e9e8d48b | 28 | gRX_HEAD_DATA_NODE = new COM_RX_DATA_NODE; |
shreeshas95 | 0:f016e9e8d48b | 29 | gRX_HEAD_DATA_NODE->next_node = NULL; |
shreeshas95 | 0:f016e9e8d48b | 30 | gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE; |
shreeshas95 | 2:2caf2a9a13aa | 31 | gRX_COUNT = 0; |
shreeshas95 | 2:2caf2a9a13aa | 32 | // gRX_CURRENT_PTR = gRX_CURRENT_DATA_NODE->values; |
shreeshas95 | 0:f016e9e8d48b | 33 | RX1M.attach(&rx_read, Serial::RxIrq); |
shreeshas95 | 0:f016e9e8d48b | 34 | |
shreeshas95 | 0:f016e9e8d48b | 35 | // DEBUG |
shreeshas95 | 4:104dd82c99b8 | 36 | // gPC.puts("welcome to mng_tm_tc\r\n"); |
aniruddhv | 52:0bd68655c651 | 37 | gPC.baud(1200); |
shreeshas95 | 0:f016e9e8d48b | 38 | |
shreeshas95 | 0:f016e9e8d48b | 39 | // COMMON SPI |
shreeshas95 | 0:f016e9e8d48b | 40 | spi.format(8,0); |
shreeshas95 | 0:f016e9e8d48b | 41 | spi.frequency(1000000); |
shreeshas95 | 0:f016e9e8d48b | 42 | |
shreeshas95 | 0:f016e9e8d48b | 43 | // SD CARD |
shreeshas95 | 2:2caf2a9a13aa | 44 | gCS_SDC = 1; |
shreeshas95 | 2:2caf2a9a13aa | 45 | gCS_RTC = 1; |
shreeshas95 | 0:f016e9e8d48b | 46 | // initialise_card(); |
shreeshas95 | 0:f016e9e8d48b | 47 | // int result= initialise_card(); |
shreeshas95 | 0:f016e9e8d48b | 48 | // disk_initialize(); |
shreeshas95 | 0:f016e9e8d48b | 49 | |
shreeshas95 | 0:f016e9e8d48b | 50 | // COM_TX |
shreeshas95 | 0:f016e9e8d48b | 51 | // *********************THE TEST |
shreeshas95 | 0:f016e9e8d48b | 52 | // cs_adf=1; |
shreeshas95 | 0:f016e9e8d48b | 53 | // *********************THE TEST |
shreeshas95 | 0:f016e9e8d48b | 54 | |
shreeshas95 | 0:f016e9e8d48b | 55 | // COM_MNG_TMTC THREAD |
shreeshas95 | 0:f016e9e8d48b | 56 | gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN); |
sukhdeep | 67:4819b5f28285 | 57 | gSCIENCE_THREAD = new Thread(SCIENCE_FUN); |
shreeshas95 | 0:f016e9e8d48b | 58 | gCOM_MNG_TMTC_THREAD->set_priority(osPriorityAboveNormal); |
shreeshas95 | 0:f016e9e8d48b | 59 | // *******************INITIALISATIONS END******************** |
shreeshas95 | 0:f016e9e8d48b | 60 | |
shreeshas95 | 0:f016e9e8d48b | 61 | int theAcount = 0; |
shreeshas95 | 0:f016e9e8d48b | 62 | while(true){ |
shreeshas95 | 6:79d422d1ed42 | 63 | Thread::wait(osWaitForever); |
shreeshas95 | 0:f016e9e8d48b | 64 | } |
shreeshas95 | 0:f016e9e8d48b | 65 | } |