Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_CODE_FM_28JAN2017 by
Diff: main.cpp
- Revision:
- 238:4abbc6a3a641
- Parent:
- 232:b1458c1e9199
- Child:
- 239:a3a012a0fecc
--- a/main.cpp Thu Jul 07 16:45:05 2016 +0000
+++ b/main.cpp Thu Jul 07 17:13:00 2016 +0000
@@ -85,28 +85,20 @@
transmit_adf;\
gPC.puts("exit_adf\r\n");\
}
-//void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);}
+
int main()
{
CDMS_I2C_GPIO = 0;
PL_I2C_GPIO = 0;
- //gLEDR = 1;
-
- // ******************INITIALISATIONS START******************
- // COM RX
-
RX1M.baud(1200);
gRX_HEAD_DATA_NODE = new COM_RX_DATA_NODE;
gRX_HEAD_DATA_NODE->next_node = NULL;
gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE;
gRX_COUNT = 0;
-// gRX_CURRENT_PTR = gRX_CURRENT_DATA_NODE->values;
RX1M.attach(&rx_read, Serial::RxIrq);
- // DEBUG
- //gPC.puts("welcome to mng_tm_tc\r\n");
gPC.baud(115200);//changed for bypassing COM
// COMMON SPI
@@ -129,26 +121,34 @@
gPC.puts("welcome to mng_tmtc\r\n");
#endif
-
+ #if DEBUG
+ gPC.puts("allocating threads\r\n");
+ #endif
// COM_MNG_TMTC THREAD
gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN);
gCOM_MNG_TMTC_THREAD->set_priority(osPriorityHigh);
- #if DEBUG
- gPC.puts("allocating threads\r\n");
- #endif
+
+ gHK_THREAD = new Thread(FCTN_CDMS_HK_MAIN);
+ gHK_THREAD->set_priority(osPriorityAboveNormal);
+
gSCIENCE_THREAD = new Thread(SCIENCE_FUN);
- // gPC.puts("step one complete\r\n");
gSCIENCE_THREAD->set_priority(osPriorityAboveNormal);
+
#if DEBUG
gPC.puts("competed allocating threads\r\n");
#endif
+
master.frequency(400000);
- PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL);
+
+ HK_counter = new RtosTimer(hk_isr, osTimerPeriodic,(void * )NULL);
+ HK_counter->start(10000);
+
+ //PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL);
//PL_wo_dma->start(6000);//
- gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);
+ //gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);
@@ -161,34 +161,8 @@
}
gPC.printf("PL_TC sent");*/
- // *******************INITIALISATIONS END********************
-
- FCTN_CDMS_HK_MAIN((void *)NULL);
- //RtosTimer gCDMS_HK_TIMER(FCTN_CDMS_HK_MAIN, osTimerPeriodic);
- //gCDMS_HK_TIMER.start(5000);
-
- /*starting the thread with signal*/
- //set_sig();
- //payload_isr_fun();
-
- /*Calculating Stack used*/
-
- int state;
- /*while (true) {
- Thread::wait(500);
- state = gSCIENCE_THREAD->get_state();
- //gPC.printf("Thread state %d\r\n", state);
- if(state == Thread::Inactive)
- {delete gSCIENCE_THREAD;
- break;}
- }*/
-
-
-
while(true){
Thread::wait(osWaitForever);
- //state = gCOM_MNG_TMTC_THREAD->get_state() + '0';
gLEDG = !gLEDG;
- //gPC.putc(state);
}
}
\ No newline at end of file
