Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

Committer:
trane3
Date:
Wed Nov 16 20:55:27 2016 +0000
Revision:
18:aef2f75f216b
Parent:
8:75c1dd8b0d61
test for threading and width setting - (eric)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
FiveDollar 0:b2b3955cd77b 1 #pragma once
FiveDollar 0:b2b3955cd77b 2 #include "mbed.h"
FiveDollar 0:b2b3955cd77b 3 #include "pulse.h"
trane3 18:aef2f75f216b 4 #include "rtos.h"
FiveDollar 0:b2b3955cd77b 5
FiveDollar 0:b2b3955cd77b 6 pulse::pulse(){}
FiveDollar 0:b2b3955cd77b 7
FiveDollar 0:b2b3955cd77b 8 pulse::pulse(chamberData* chamber, hardware* IOpins){
FiveDollar 0:b2b3955cd77b 9 myIOpins = IOpins;
FiveDollar 0:b2b3955cd77b 10 myChamber = chamber;
FiveDollar 1:fbba2687ddfe 11 // myPaceWidth = 0; //mSec, width of ventricular pace
FiveDollar 0:b2b3955cd77b 12 // myPaceAmp = 0; //mV, amplitude of ventricular pace
FiveDollar 0:b2b3955cd77b 13 // myRP = 0; //mSec, duration of refractory period
FiveDollar 0:b2b3955cd77b 14 // p_hysteresisInterval = 0;
FiveDollar 0:b2b3955cd77b 15 // p_lowrateInterval = 0;
FiveDollar 0:b2b3955cd77b 16 // p_hysteresis = false;
FiveDollar 0:b2b3955cd77b 17
FiveDollar 0:b2b3955cd77b 18 }
FiveDollar 0:b2b3955cd77b 19
FiveDollar 0:b2b3955cd77b 20 pulse::~pulse(){
FiveDollar 0:b2b3955cd77b 21 delete myChamber;
FiveDollar 0:b2b3955cd77b 22 delete myIOpins;
FiveDollar 0:b2b3955cd77b 23 delete pc;
FiveDollar 0:b2b3955cd77b 24 delete aOut;
FiveDollar 0:b2b3955cd77b 25 }
FiveDollar 0:b2b3955cd77b 26
trane3 8:75c1dd8b0d61 27 void pulse::setChamber(chamberData* c){
trane3 8:75c1dd8b0d61 28 myChamber = c;
trane3 8:75c1dd8b0d61 29 }
trane3 8:75c1dd8b0d61 30
FiveDollar 0:b2b3955cd77b 31
FiveDollar 0:b2b3955cd77b 32 void pulse::startPulse(){
FiveDollar 0:b2b3955cd77b 33 // while(true){
FiveDollar 0:b2b3955cd77b 34 pc = myIOpins->getSerial();
FiveDollar 0:b2b3955cd77b 35 aOut = myIOpins->getChamber(myChamber->getChamberType());
FiveDollar 0:b2b3955cd77b 36 aOut->write(myChamber->getPaceAmp());
FiveDollar 0:b2b3955cd77b 37 wait(myChamber->getPaceWidth());
FiveDollar 0:b2b3955cd77b 38 aOut->write(0);
FiveDollar 0:b2b3955cd77b 39
FiveDollar 0:b2b3955cd77b 40 pc->printf("\nPulsing...check your oscilloscope!");
FiveDollar 0:b2b3955cd77b 41 // wait(myChamber->getPaceWidth());
FiveDollar 0:b2b3955cd77b 42
FiveDollar 0:b2b3955cd77b 43 // }
FiveDollar 0:b2b3955cd77b 44 }
FiveDollar 0:b2b3955cd77b 45