Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.

The project uses the Freescale K64F Microcontroller and C++ mbed library.

Committer:
noahzwiep
Date:
Tue Dec 13 03:46:34 2016 +0000
Revision:
34:701503855d52
Parent:
33:686a1a0c690f
Child:
35:fa164704f0ca
Added sense module, only thing left is figuring out pins

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noahzwiep 33:686a1a0c690f 1 #include "rtos.h"
noahzwiep 33:686a1a0c690f 2 #include "mbed.h"
noahzwiep 33:686a1a0c690f 3 #include "hardware.h"
noahzwiep 33:686a1a0c690f 4 #include "pulse.h"
noahzwiep 33:686a1a0c690f 5 #include "chamberData.h"
noahzwiep 33:686a1a0c690f 6 #include "pulse.h"
noahzwiep 33:686a1a0c690f 7 #include "VVI.h"
noahzwiep 34:701503855d52 8 #include "sense.h"
noahzwiep 33:686a1a0c690f 9
noahzwiep 33:686a1a0c690f 10
noahzwiep 33:686a1a0c690f 11 DigitalOut green(LED_GREEN);
noahzwiep 33:686a1a0c690f 12
noahzwiep 34:701503855d52 13 pulse* chamberPulse;
noahzwiep 34:701503855d52 14 chamberData* myChamber;
noahzwiep 34:701503855d52 15 sense* mySense;
noahzwiep 33:686a1a0c690f 16
noahzwiep 34:701503855d52 17 void vvi_set_chamber(pulse* c, chamberData* d, sense* e){
noahzwiep 34:701503855d52 18 chamberPulse = c;
noahzwiep 34:701503855d52 19 myChamber = d;
noahzwiep 34:701503855d52 20 mySense = e;
noahzwiep 33:686a1a0c690f 21 }
noahzwiep 33:686a1a0c690f 22
noahzwiep 33:686a1a0c690f 23 void start_VVI(){
noahzwiep 33:686a1a0c690f 24 while(true){
noahzwiep 33:686a1a0c690f 25 green = !green;
noahzwiep 34:701503855d52 26 bool sensed = mySense->returnedSense();
noahzwiep 34:701503855d52 27 if(!sensed){
noahzwiep 34:701503855d52 28 chamberPulse->startPulse();
noahzwiep 34:701503855d52 29 }
noahzwiep 34:701503855d52 30 Thread::wait(myChamber->getRP());
noahzwiep 33:686a1a0c690f 31 }
noahzwiep 33:686a1a0c690f 32 }
noahzwiep 33:686a1a0c690f 33