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:
36:b6431cd8ecd6
Added sense module, only thing left is figuring out pins

Who changed what in which revision?

UserRevisionLine numberNew contents of line
FiveDollar 0:b2b3955cd77b 1 #pragma once
FiveDollar 0:b2b3955cd77b 2 #include "mbed.h"
FiveDollar 0:b2b3955cd77b 3 #include "chamberData.h"
FiveDollar 0:b2b3955cd77b 4 #include "genData.h"
FiveDollar 0:b2b3955cd77b 5 #include "pulse.h"
FiveDollar 0:b2b3955cd77b 6 #include "hardware.h"
FiveDollar 0:b2b3955cd77b 7 #include "interface.h"
FiveDollar 9:b48423a135d8 8 #include "voor.h"
FiveDollar 9:b48423a135d8 9 #include "sense.h"
trane3 19:d58e1e1a9a24 10 #include "motion.h"
noahzwiep 33:686a1a0c690f 11 #include "VVI.h"
trane3 1:9f1091a53ff5 12
FiveDollar 0:b2b3955cd77b 13 int main(){
FiveDollar 0:b2b3955cd77b 14 hardware* io = new hardware();
FiveDollar 9:b48423a135d8 15 genData* generalData = new genData();
FiveDollar 27:f8deff828a00 16 chamberData* atrium = new chamberData('a');
FiveDollar 27:f8deff828a00 17 chamberData* ventricle = new chamberData('v');
FiveDollar 0:b2b3955cd77b 18 pulse* ventPulse = new pulse(ventricle,io);
trane3 10:35b259e70c9a 19 pulse* atrPulse = new pulse(atrium,io);
noahzwiep 34:701503855d52 20 sense* isSense = new sense(generalData);
trane3 19:d58e1e1a9a24 21
noahzwiep 33:686a1a0c690f 22 // Thread motionThread(osPriorityNormal);
noahzwiep 33:686a1a0c690f 23 // initialize_motion ();
noahzwiep 33:686a1a0c690f 24 // motion_set_chamber(0, ventricle);
noahzwiep 33:686a1a0c690f 25 // motionThread.start(motion_thread);
noahzwiep 33:686a1a0c690f 26
noahzwiep 33:686a1a0c690f 27 Thread vviThread(osPriorityNormal);
noahzwiep 34:701503855d52 28 vvi_set_chamber(atrPulse,atrium,isSense);
noahzwiep 33:686a1a0c690f 29 vviThread.start(start_VVI);
trane3 19:d58e1e1a9a24 30
trane3 31:5e55042e025a 31 // Thread egramThread(osPriorityNormal);
trane3 31:5e55042e025a 32 // egramThread.start(storeData);
FiveDollar 29:c0d63940b0c7 33
noahzwiep 25:d816de7067da 34 interface a(io->getSerial() , ventPulse , generalData, atrium , ventricle,io);
trane3 19:d58e1e1a9a24 35
noahzwiep 32:69cd1390bc21 36 a.readValues();
trane3 10:35b259e70c9a 37
trane3 10:35b259e70c9a 38
FiveDollar 0:b2b3955cd77b 39 delete ventricle; //code never reaches here, since we're stuck in the while loops of the pacing, user interface, etc.
FiveDollar 0:b2b3955cd77b 40 delete atrium;
FiveDollar 0:b2b3955cd77b 41 delete ventPulse;
noahzwiep 34:701503855d52 42 delete atrPulse;
noahzwiep 34:701503855d52 43 delete isSense;
FiveDollar 0:b2b3955cd77b 44 delete io;
FiveDollar 0:b2b3955cd77b 45
FiveDollar 0:b2b3955cd77b 46 return 0;
FiveDollar 9:b48423a135d8 47 }