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@33:686a1a0c690f, 2016-12-12 (annotated)
- Committer:
- noahzwiep
- Date:
- Mon Dec 12 03:31:55 2016 +0000
- Revision:
- 33:686a1a0c690f
- Parent:
- 32:69cd1390bc21
- Child:
- 34:701503855d52
Using proper pulse functions and pins
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); |
trane3 | 19:d58e1e1a9a24 | 20 | |
noahzwiep | 33:686a1a0c690f | 21 | // Thread motionThread(osPriorityNormal); |
noahzwiep | 33:686a1a0c690f | 22 | // initialize_motion (); |
noahzwiep | 33:686a1a0c690f | 23 | // motion_set_chamber(0, ventricle); |
noahzwiep | 33:686a1a0c690f | 24 | // motionThread.start(motion_thread); |
noahzwiep | 33:686a1a0c690f | 25 | |
noahzwiep | 33:686a1a0c690f | 26 | Thread vviThread(osPriorityNormal); |
noahzwiep | 33:686a1a0c690f | 27 | vvi_set_chamber(atrPulse); |
noahzwiep | 33:686a1a0c690f | 28 | vviThread.start(start_VVI); |
trane3 | 19:d58e1e1a9a24 | 29 | |
trane3 | 31:5e55042e025a | 30 | // Thread egramThread(osPriorityNormal); |
trane3 | 31:5e55042e025a | 31 | // egramThread.start(storeData); |
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; |
FiveDollar | 0:b2b3955cd77b | 41 | delete io; |
FiveDollar | 0:b2b3955cd77b | 42 | |
FiveDollar | 0:b2b3955cd77b | 43 | return 0; |
FiveDollar | 9:b48423a135d8 | 44 | } |