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: DC_DC/DC_DC.cpp
- Revision:
- 10:db13782f05d9
- Parent:
- 6:6a04210a3f4f
- Child:
- 12:e0adb697fcdb
diff -r ada056631cac -r db13782f05d9 DC_DC/DC_DC.cpp
--- a/DC_DC/DC_DC.cpp Thu Oct 16 15:13:49 2014 +0000
+++ b/DC_DC/DC_DC.cpp Sun Oct 19 22:46:46 2014 +0000
@@ -1,11 +1,12 @@
#include "mbed.h"
#include "DC_DC.h"
-DigitalOut dc_pin(p20);
FanPump *fanPump;
CANBuffer *tx_DC_Buffer;
bool status;
+DigitalOut dc_pin(p20);
+
DC::DC(FanPump *fp, CANBuffer *can){
status = false;
dc_pin = !status;
@@ -26,18 +27,17 @@
dc_pin = !status;
}
-void update(const void *arg){
+void update_dcdc(const void *arg){
char data[4] = {0};
while(1){
data[0] = status;
CANMessage txMessage(TX_DC_DC_ID, data, 4);
- CANMessage msg(1);
- tx_DC_Buffer->txWrite(msg);
+ tx_DC_Buffer->txWrite(txMessage);
Thread::wait(100); //10 Hz update
}
}
void DC::start_update(){
- Thread update_thread(update);
+ Thread update_thread(update_dcdc);
}
\ No newline at end of file
