3k04 team / Mbed 2 deprecated Pacemaker

Dependencies:   mbed Queue mbed-rtos FXOS8700Q

Fork of Pacemaker by Eric dollar

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #pragma once
00002 #include "mbed.h"
00003 #include "chamberData.h"
00004 #include "genData.h"
00005 #include "pulse.h"
00006 #include "hardware.h"
00007 #include "interface.h"
00008 #include "voor.h"
00009 #include "sense.h"
00010 #include "motion.h"
00011 #include "VVI.h"
00012 
00013 int main(){
00014     hardware* io = new hardware();
00015     genData* generalData = new genData();
00016     chamberData* atrium = new chamberData('a');
00017     chamberData* ventricle = new chamberData('v');
00018     pulse* ventPulse = new pulse(ventricle,io);
00019     pulse* atrPulse = new pulse(atrium,io);
00020     sense* isSense = new sense(generalData);
00021     
00022     
00023     Thread vviThread(osPriorityNormal);
00024     vvi_set_chamber(atrPulse,atrium,isSense);
00025     vviThread.start(start_VVI);
00026     
00027     Thread motionThread(osPriorityBelowNormal);
00028     initialize_motion ();
00029     motion_set_chamber(0, ventricle);
00030     motionThread.start(motion_thread);
00031 
00032     
00033     interface a(io->getSerial() , ventPulse , generalData, atrium , ventricle,io); 
00034     
00035     a.readValues();   
00036     
00037     
00038     delete ventricle; //code never reaches here, since we're stuck in the while loops of the pacing, user interface, etc.
00039     delete atrium;
00040     delete ventPulse;
00041     delete atrPulse;
00042     delete isSense;
00043     delete io;
00044     
00045 return 0;
00046     }