Pacemaker code Implementation for SFWRENG 3K04
Dependencies: mbed Queue mbed-rtos FXOS8700Q
Fork of Pacemaker by
SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.
The project uses the Freescale K64F Microcontroller and C++ mbed library.
Diff: VVI.cpp
- Revision:
- 34:701503855d52
- Parent:
- 33:686a1a0c690f
- Child:
- 35:fa164704f0ca
diff -r 686a1a0c690f -r 701503855d52 VVI.cpp --- a/VVI.cpp Mon Dec 12 03:31:55 2016 +0000 +++ b/VVI.cpp Tue Dec 13 03:46:34 2016 +0000 @@ -5,21 +5,29 @@ #include "chamberData.h" #include "pulse.h" #include "VVI.h" +#include "sense.h" DigitalOut green(LED_GREEN); -pulse* myChamber; +pulse* chamberPulse; +chamberData* myChamber; +sense* mySense; -void vvi_set_chamber(pulse* c){ - myChamber = c; +void vvi_set_chamber(pulse* c, chamberData* d, sense* e){ + chamberPulse = c; + myChamber = d; + mySense = e; } void start_VVI(){ while(true){ green = !green; - myChamber->startPulse(); - Thread::wait(200); + bool sensed = mySense->returnedSense(); + if(!sensed){ + chamberPulse->startPulse(); + } + Thread::wait(myChamber->getRP()); } }