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.
main.cpp@36:b6431cd8ecd6, 2016-12-18 (annotated)
- Committer:
- noahzwiep
- Date:
- Sun Dec 18 02:29:59 2016 +0000
- Revision:
- 36:b6431cd8ecd6
- Parent:
- 34:701503855d52
All ogre.
Who changed what in which revision?
User | Revision | Line number | New 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 | |
noahzwiep | 33:686a1a0c690f | 23 | Thread vviThread(osPriorityNormal); |
noahzwiep | 34:701503855d52 | 24 | vvi_set_chamber(atrPulse,atrium,isSense); |
noahzwiep | 33:686a1a0c690f | 25 | vviThread.start(start_VVI); |
trane3 | 19:d58e1e1a9a24 | 26 | |
noahzwiep | 36:b6431cd8ecd6 | 27 | Thread motionThread(osPriorityBelowNormal); |
noahzwiep | 36:b6431cd8ecd6 | 28 | initialize_motion (); |
noahzwiep | 36:b6431cd8ecd6 | 29 | motion_set_chamber(0, ventricle); |
noahzwiep | 36:b6431cd8ecd6 | 30 | motionThread.start(motion_thread); |
noahzwiep | 36:b6431cd8ecd6 | 31 | |
FiveDollar | 29:c0d63940b0c7 | 32 | |
noahzwiep | 25:d816de7067da | 33 | interface a(io->getSerial() , ventPulse , generalData, atrium , ventricle,io); |
trane3 | 19:d58e1e1a9a24 | 34 | |
noahzwiep | 32:69cd1390bc21 | 35 | a.readValues(); |
trane3 | 10:35b259e70c9a | 36 | |
trane3 | 10:35b259e70c9a | 37 | |
FiveDollar | 0:b2b3955cd77b | 38 | delete ventricle; //code never reaches here, since we're stuck in the while loops of the pacing, user interface, etc. |
FiveDollar | 0:b2b3955cd77b | 39 | delete atrium; |
FiveDollar | 0:b2b3955cd77b | 40 | delete ventPulse; |
noahzwiep | 34:701503855d52 | 41 | delete atrPulse; |
noahzwiep | 34:701503855d52 | 42 | delete isSense; |
FiveDollar | 0:b2b3955cd77b | 43 | delete io; |
FiveDollar | 0:b2b3955cd77b | 44 | |
FiveDollar | 0:b2b3955cd77b | 45 | return 0; |
FiveDollar | 9:b48423a135d8 | 46 | } |