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: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: ThreadsAndFunctions.h
- Revision:
- 251:c766afa330a3
- Parent:
- 246:565458eefd94
- Child:
- 252:9c631b2f5da8
diff -r d0be0773b951 -r c766afa330a3 ThreadsAndFunctions.h
--- a/ThreadsAndFunctions.h Mon Jul 11 09:48:57 2016 +0000
+++ b/ThreadsAndFunctions.h Mon Jul 11 12:30:41 2016 +0000
@@ -17,11 +17,13 @@
while(true){
gPC.puts("entering sci\r\n");
gSCIENCE_THREAD->signal_wait(SCIENCE_SIGNAL);
+ gMutex.lock();
gPC.puts("sig_set\r\n");
- srp(gPAYLOAD_BUFFER);
+ srp(gPAYLOAD_BUFFER);//skip one apcket when cdms resets
gPC.puts("exit_srp\r\n");
wait(2);/*timeout to be decided*/
gPAY_SPI->bulkRead_start();
+ gMutex.unlock();
}
}
@@ -156,6 +158,9 @@
raw_data_to_tc();
gFLAGS = gFLAGS & (~COM_RX_FLAG);
+ //Mutex
+ gMutex.lock();
+
if( gTOTAL_VALID_TC > 0 ){
/*gPC.printf("valid TC rx: %u\r\n", gTOTAL_VALID_TC);*/
if( gTOTAL_VALID_TC < COM_MAX_TC_LIMIT ){
@@ -312,5 +317,6 @@
gSESSION_TIMEOUT.detach();
gFLAGS = gFLAGS & (~COM_SESSION_FLAG);
}
+ gMutex.unlock();
}
}
\ No newline at end of file
