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.

main.cpp

Committer:
noahzwiep
Date:
2016-11-24
Revision:
25:d816de7067da
Parent:
19:d58e1e1a9a24
Child:
27:f8deff828a00
Child:
30:cc7586a259fd

File content as of revision 25:d816de7067da:

#pragma once
#include "mbed.h"
#include "chamberData.h"
#include "genData.h"
#include "pulse.h"
#include "hardware.h"
#include "interface.h"
#include "voor.h"
#include "sense.h"
#include "motion.h"

int main(){
    hardware* io = new hardware();
    genData* generalData = new genData();
    chamberData* atrium = new chamberData(io->getSerial(),'a');
    chamberData* ventricle = new chamberData(io->getSerial(), 'v');
    pulse* ventPulse = new pulse(ventricle,io);
    pulse* atrPulse = new pulse(atrium,io);
    
    Thread motionThread(osPriorityNormal);
    initialize_motion ();
    motion_set_chamber(0, ventricle);
    motionThread.start(motion_thread);
    
    interface a(io->getSerial() , ventPulse , generalData, atrium , ventricle,io); 
    
    a.startScreen();   
    
    
    delete ventricle; //code never reaches here, since we're stuck in the while loops of the pacing, user interface, etc.
    delete atrium;
    delete ventPulse;
    delete io;
    
return 0;
    }