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: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: runTime/runTime.cpp
- Revision:
- 33:6bc82b6b62e5
- Parent:
- 31:7eaa5e881b56
- Child:
- 36:0afc0fc8f86b
diff -r e70407021ad2 -r 6bc82b6b62e5 runTime/runTime.cpp --- a/runTime/runTime.cpp Sun Nov 16 02:43:58 2014 +0000 +++ b/runTime/runTime.cpp Tue Jan 06 20:45:26 2015 +0000 @@ -2,9 +2,8 @@ const float INTERNAL_OVER_TEMP_THRES = 60; // Overtemp at 60C -void runTime::thread_gather_10Hz(void const* args) { +void runTime::thread_gather(void const* args) { while(1) { - wdt.kick(); // GLV battery coulomb counter data.glvCurrent = glvBat.current(); @@ -39,20 +38,12 @@ if (data.internalTemp > INTERNAL_OVER_TEMP_THRES) data.internalOverTemp = true; else data.internalOverTemp = false; - // Xbees -/* data.xbee1MessagesIn = xbee1.messagesProcessedIn(); - data.xbee2MessagesIn = xbee2.messagesProcessedIn(); - data.xbee1MessagesOut = xbee1.messagesProcessedOut(); - data.xbee2MessagesOut = xbee2.messagesProcessedOut(); -*/ + // Error frame data.errorFrame = data.canFault<<0 | data.watchdogReset<<1 | data.internalOverTemp<<2 | (data.IMDlatchError!=0)<<3 | (data.AMSlatchError!=0)<<4 | data.imdError<<5 | data.dcdcError<<6 | data.glvOverCurrent<<7; - Thread::wait(100); + Thread::wait(GATHER_LOOP*1000); } } -void runTime::thread_gather_100Hz(void const* args) { - while(1) { - glvBat.sample(); // Integrate next sample in GLV Battery coulomb counter - dcdc.sample(); // Handle dc-dc filter and errors - Thread::wait(10); - } +void runTime::thread_sample(void const* args) { + glvBat.sample(); // Integrate next sample in GLV Battery coulomb counter + dcdc.sample(); // Handle dc-dc filter and errors } \ No newline at end of file