CDMS code for testing sbc
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
main.cpp@33:8f5a4ce4ba4a, 2016-01-06 (annotated)
- Committer:
- ee12b079
- Date:
- Wed Jan 06 14:52:12 2016 +0000
- Revision:
- 33:8f5a4ce4ba4a
- Parent:
- 7:fcd26c28411d
- Child:
- 48:18919bb88fa1
Integrated basic adf code, send_tm.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ee12b079 | 33:8f5a4ce4ba4a | 1 | //6th Jan |
ee12b079 | 33:8f5a4ce4ba4a | 2 | //Tested adf.h, snd_tm.h for 1 segment data for power_on_tm with FMS TC, received same data at GS as transmitted though transmitted data might be incorrect. |
ee12b079 | 33:8f5a4ce4ba4a | 3 | |
shreeshas95 | 7:fcd26c28411d | 4 | // TESTING PUSH PULL IN MAIN CPP |
shreeshas95 | 7:fcd26c28411d | 5 | |
shreeshas95 | 0:f016e9e8d48b | 6 | #include "mbed.h" |
shreeshas95 | 0:f016e9e8d48b | 7 | #include "rtos.h" |
shreeshas95 | 1:a0055b3280c8 | 8 | #include "mbed_debug.h" |
shreeshas95 | 0:f016e9e8d48b | 9 | |
shreeshas95 | 0:f016e9e8d48b | 10 | #include "Structures.h" |
shreeshas95 | 0:f016e9e8d48b | 11 | #include "DefinitionsAndGlobals.h" |
shreeshas95 | 0:f016e9e8d48b | 12 | #include "crc.h" |
shreeshas95 | 1:a0055b3280c8 | 13 | #include "COM_SND_TM_functions.h" |
shreeshas95 | 1:a0055b3280c8 | 14 | #include "COM_SND_TM.h" |
shreeshas95 | 1:a0055b3280c8 | 15 | #include "SDCread.h" |
shreeshas95 | 1:a0055b3280c8 | 16 | #include "adf.h" |
shreeshas95 | 1:a0055b3280c8 | 17 | #include "Compression.h" |
shreeshas95 | 1:a0055b3280c8 | 18 | #include "SDC_init.h" |
shreeshas95 | 0:f016e9e8d48b | 19 | #include "COM_RCV_TC.h" |
shreeshas95 | 0:f016e9e8d48b | 20 | #include "COM_MNG_TMTC.h" |
shreeshas95 | 4:104dd82c99b8 | 21 | #include "COM_POWER_ON_TX.h" |
shreeshas95 | 4:104dd82c99b8 | 22 | #include "COM_POWER_OFF_TX.h" |
shreeshas95 | 0:f016e9e8d48b | 23 | #include "ThreadsAndFunctions.h" |
shreeshas95 | 0:f016e9e8d48b | 24 | |
shreeshas95 | 0:f016e9e8d48b | 25 | int main() |
shreeshas95 | 0:f016e9e8d48b | 26 | { |
shreeshas95 | 0:f016e9e8d48b | 27 | // ******************INITIALISATIONS START****************** |
shreeshas95 | 0:f016e9e8d48b | 28 | // COM RX |
shreeshas95 | 0:f016e9e8d48b | 29 | RX1M.baud(1200); |
shreeshas95 | 0:f016e9e8d48b | 30 | gRX_HEAD_DATA_NODE = new COM_RX_DATA_NODE; |
shreeshas95 | 0:f016e9e8d48b | 31 | gRX_HEAD_DATA_NODE->next_node = NULL; |
shreeshas95 | 0:f016e9e8d48b | 32 | gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE; |
shreeshas95 | 2:2caf2a9a13aa | 33 | gRX_COUNT = 0; |
shreeshas95 | 2:2caf2a9a13aa | 34 | // gRX_CURRENT_PTR = gRX_CURRENT_DATA_NODE->values; |
shreeshas95 | 0:f016e9e8d48b | 35 | RX1M.attach(&rx_read, Serial::RxIrq); |
shreeshas95 | 0:f016e9e8d48b | 36 | |
shreeshas95 | 0:f016e9e8d48b | 37 | // DEBUG |
shreeshas95 | 4:104dd82c99b8 | 38 | // gPC.puts("welcome to mng_tm_tc\r\n"); |
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 |
shreeshas95 | 2:2caf2a9a13aa | 45 | gCS_SDC = 1; |
shreeshas95 | 2:2caf2a9a13aa | 46 | gCS_RTC = 1; |
shreeshas95 | 0:f016e9e8d48b | 47 | // initialise_card(); |
shreeshas95 | 0:f016e9e8d48b | 48 | // int result= initialise_card(); |
shreeshas95 | 0:f016e9e8d48b | 49 | // disk_initialize(); |
shreeshas95 | 0:f016e9e8d48b | 50 | |
shreeshas95 | 0:f016e9e8d48b | 51 | // COM_TX |
shreeshas95 | 0:f016e9e8d48b | 52 | // *********************THE TEST |
shreeshas95 | 0:f016e9e8d48b | 53 | // cs_adf=1; |
shreeshas95 | 0:f016e9e8d48b | 54 | // *********************THE TEST |
shreeshas95 | 0:f016e9e8d48b | 55 | |
shreeshas95 | 0:f016e9e8d48b | 56 | // COM_MNG_TMTC THREAD |
shreeshas95 | 0:f016e9e8d48b | 57 | gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_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 | } |