
Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Revision 97:717c7908c822, committed 2016-01-25
- Comitter:
- ee12b079
- Date:
- Mon Jan 25 14:20:44 2016 +0000
- Parent:
- 96:4ca92f9775e0
- Child:
- 98:fd99ddc0e0a1
- Commit message:
- worked once by signalling through interrupt;
Changed in this revision
ThreadsAndFunctions.h | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ThreadsAndFunctions.h Mon Jan 25 13:10:43 2016 +0000 +++ b/ThreadsAndFunctions.h Mon Jan 25 14:20:44 2016 +0000 @@ -274,11 +274,11 @@ void SCIENCE_FUN(void const *args){ uint8_t *ptr; - gPC.puts("haha\r\n"); + //gPC.puts("haha\r\n"); ptr = &(payload_data[3]); - gPC.puts("haha2\r\n"); + //gPC.puts("haha2\r\n"); int counter = 0; - gPC.puts("haha3\r\n"); + //gPC.puts("haha3\r\n"); payload_data[2] = 0;//for mode for(int i = 0; i<60 ;i++){ //for mode 0.....callibra for(int j= 0; j<48; j++){ //2 byte values @@ -293,16 +293,16 @@ //srp(payload_data); //gPC.puts("data given to payload"); - gLEDR = 1; - gSCIENCE_THREAD->wait(2000); gSCIENCE_THREAD->terminate(); + //gSCIENCE_THREAD->wait(2000); gSCIENCE_THREAD->terminate(); - /*while(true){ - gSCIENCE_THREAD->wait(osWaitForever); - }*/ //while(true){ -// gSCIENCE_THREAD->signal_wait(SCIENCE_SIGNAL); -// srp(payload_data); +// gSCIENCE_THREAD->wait(osWaitForever); +// gLEDR = !gLEDR; // } + while(true){ + gSCIENCE_THREAD->signal_wait(SCIENCE_SIGNAL); + srp(payload_data); + } }
--- a/main.cpp Mon Jan 25 13:10:43 2016 +0000 +++ b/main.cpp Mon Jan 25 14:20:44 2016 +0000 @@ -21,9 +21,12 @@ #include "Compression.h" #include "ThreadsAndFunctions.h" +InterruptIn inr(PTA13); + +void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);} int main() { - gLEDR = 1; + //gLEDR = 1; // ******************INITIALISATIONS START****************** // COM RX @@ -70,6 +73,10 @@ gPC.puts("competed allocating threads\r\n"); // *******************INITIALISATIONS END******************** + /*starting the thread with signal*/ + inr.rise(&set_sig); + + /*Calculating Stack used*/ int state; @@ -85,7 +92,7 @@ while(true){ - Thread::wait(500); + Thread::wait(osWaitForever); //state = gCOM_MNG_TMTC_THREAD->get_state() + '0'; gLEDG = !gLEDG; //gPC.putc(state);