Pacemaker code Implementation for SFWRENG 3K04
Dependencies: FXOS8700Q Queue mbed-rtos mbed
Fork of Pacemaker by
pulse.cpp@1:fbba2687ddfe, 2016-11-14 (annotated)
- Committer:
- FiveDollar
- Date:
- Mon Nov 14 01:27:31 2016 +0000
- Revision:
- 1:fbba2687ddfe
- Parent:
- 0:b2b3955cd77b
- Child:
- 8:75c1dd8b0d61
nov 13 commit
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 "pulse.h" |
FiveDollar | 0:b2b3955cd77b | 4 | |
FiveDollar | 0:b2b3955cd77b | 5 | pulse::pulse(){} |
FiveDollar | 0:b2b3955cd77b | 6 | |
FiveDollar | 0:b2b3955cd77b | 7 | pulse::pulse(chamberData* chamber, hardware* IOpins){ |
FiveDollar | 0:b2b3955cd77b | 8 | myIOpins = IOpins; |
FiveDollar | 0:b2b3955cd77b | 9 | myChamber = chamber; |
FiveDollar | 1:fbba2687ddfe | 10 | // myPaceWidth = 0; //mSec, width of ventricular pace |
FiveDollar | 0:b2b3955cd77b | 11 | // myPaceAmp = 0; //mV, amplitude of ventricular pace |
FiveDollar | 0:b2b3955cd77b | 12 | // myRP = 0; //mSec, duration of refractory period |
FiveDollar | 0:b2b3955cd77b | 13 | // p_hysteresisInterval = 0; |
FiveDollar | 0:b2b3955cd77b | 14 | // p_lowrateInterval = 0; |
FiveDollar | 0:b2b3955cd77b | 15 | // p_hysteresis = false; |
FiveDollar | 0:b2b3955cd77b | 16 | |
FiveDollar | 0:b2b3955cd77b | 17 | } |
FiveDollar | 0:b2b3955cd77b | 18 | |
FiveDollar | 0:b2b3955cd77b | 19 | pulse::~pulse(){ |
FiveDollar | 0:b2b3955cd77b | 20 | delete myChamber; |
FiveDollar | 0:b2b3955cd77b | 21 | delete myIOpins; |
FiveDollar | 0:b2b3955cd77b | 22 | delete pc; |
FiveDollar | 0:b2b3955cd77b | 23 | delete aOut; |
FiveDollar | 0:b2b3955cd77b | 24 | } |
FiveDollar | 0:b2b3955cd77b | 25 | |
FiveDollar | 0:b2b3955cd77b | 26 | |
FiveDollar | 0:b2b3955cd77b | 27 | |
FiveDollar | 0:b2b3955cd77b | 28 | void pulse::startPulse(){ |
FiveDollar | 0:b2b3955cd77b | 29 | // while(true){ |
FiveDollar | 0:b2b3955cd77b | 30 | pc = myIOpins->getSerial(); |
FiveDollar | 0:b2b3955cd77b | 31 | aOut = myIOpins->getChamber(myChamber->getChamberType()); |
FiveDollar | 0:b2b3955cd77b | 32 | aOut->write(myChamber->getPaceAmp()); |
FiveDollar | 0:b2b3955cd77b | 33 | wait(myChamber->getPaceWidth()); |
FiveDollar | 0:b2b3955cd77b | 34 | aOut->write(0); |
FiveDollar | 0:b2b3955cd77b | 35 | |
FiveDollar | 0:b2b3955cd77b | 36 | pc->printf("\nPulsing...check your oscilloscope!"); |
FiveDollar | 0:b2b3955cd77b | 37 | // wait(myChamber->getPaceWidth()); |
FiveDollar | 0:b2b3955cd77b | 38 | |
FiveDollar | 0:b2b3955cd77b | 39 | // } |
FiveDollar | 0:b2b3955cd77b | 40 | } |
FiveDollar | 0:b2b3955cd77b | 41 |