Pacemaker code Implementation for SFWRENG 3K04
Dependencies: FXOS8700Q Queue mbed-rtos mbed
Fork of Pacemaker by
main.cpp@19:d58e1e1a9a24, 2016-11-24 (annotated)
- Committer:
- trane3
- Date:
- Thu Nov 24 01:10:08 2016 +0000
- Revision:
- 19:d58e1e1a9a24
- Parent:
- 11:35b259e70c9a
- Child:
- 25:d816de7067da
added motion class, and accelerometer capabilites for rate modulation (eric); modified user interface by seperating each 'page' into seperate modules (eric)
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" |
trane3 | 2:9f1091a53ff5 | 11 | |
FiveDollar | 0:b2b3955cd77b | 12 | int main(){ |
FiveDollar | 0:b2b3955cd77b | 13 | hardware* io = new hardware(); |
FiveDollar | 9:b48423a135d8 | 14 | genData* generalData = new genData(); |
FiveDollar | 0:b2b3955cd77b | 15 | chamberData* atrium = new chamberData(io->getSerial(),'a'); |
FiveDollar | 0:b2b3955cd77b | 16 | chamberData* ventricle = new chamberData(io->getSerial(), 'v'); |
FiveDollar | 0:b2b3955cd77b | 17 | pulse* ventPulse = new pulse(ventricle,io); |
trane3 | 11:35b259e70c9a | 18 | pulse* atrPulse = new pulse(atrium,io); |
trane3 | 19:d58e1e1a9a24 | 19 | |
trane3 | 19:d58e1e1a9a24 | 20 | Thread motionThread(osPriorityNormal); |
trane3 | 19:d58e1e1a9a24 | 21 | initialize_motion (); |
trane3 | 19:d58e1e1a9a24 | 22 | motion_set_chamber(0, ventricle); |
trane3 | 19:d58e1e1a9a24 | 23 | motionThread.start(motion_thread); |
trane3 | 19:d58e1e1a9a24 | 24 | |
FiveDollar | 9:b48423a135d8 | 25 | interface a(io->getSerial() , ventPulse , generalData, atrium , ventricle); |
trane3 | 19:d58e1e1a9a24 | 26 | |
FiveDollar | 9:b48423a135d8 | 27 | a.startScreen(); |
trane3 | 11:35b259e70c9a | 28 | |
trane3 | 11:35b259e70c9a | 29 | |
FiveDollar | 0:b2b3955cd77b | 30 | delete ventricle; //code never reaches here, since we're stuck in the while loops of the pacing, user interface, etc. |
FiveDollar | 0:b2b3955cd77b | 31 | delete atrium; |
FiveDollar | 0:b2b3955cd77b | 32 | delete ventPulse; |
FiveDollar | 0:b2b3955cd77b | 33 | delete io; |
FiveDollar | 0:b2b3955cd77b | 34 | |
FiveDollar | 0:b2b3955cd77b | 35 | return 0; |
FiveDollar | 9:b48423a135d8 | 36 | } |