Rohit Dureja / Mbed 2 deprecated Pacemaker

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
rohitdureja
Date:
Mon Nov 25 04:34:07 2013 +0000
Parent:
1:c6b87b3cc7af
Child:
3:4d586c7c2a46
Commit message:
Pacemaker model with 850ms between atrial and ventricle pace

Changed in this revision

pacemaker.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/pacemaker.cpp	Mon Nov 25 03:02:33 2013 +0000
+++ b/pacemaker.cpp	Mon Nov 25 04:34:07 2013 +0000
@@ -50,8 +50,6 @@
         as = 0;*/
         //Disable the LRI timer as a AS has been received
         LRI.detach();
-        //Disable the PVARP timer as a AS has been recieved
-        PVARP.detach();
         //Make asValid=0 and vsValid=0
         asValid = 0;
         vsValid = 0;
@@ -79,8 +77,6 @@
         vsValid = 0;
         //Set up timer to interrupt at PVARP
         PVARP.attach(&postPVARP, pvarp);
-        //Set up timer to interrupt at LRI-AVI
-        LRI.attach(&noAtrialEvent, lri-avi);
         //Wait for VRP and disable all interrupts
         __disable_irq();
         wait(vrp);
@@ -105,6 +101,10 @@
 void postPVARP() {
     vsValid = 1;
     asValid = 1;
+    //Disable the PVARP timer as a AS has been recieved
+    PVARP.detach();
+    //Set up timer to interrupt at LRI-AVI-PVARP
+    LRI.attach(&noAtrialEvent, lri-avi-pvarp);
 }