Part of the Pacemaker Project; this models the Pacemaker.

Dependencies:   mbed TextLCD mbed-rtos

Revision:
29:5cec671cb80d
Parent:
27:2c5aefcf3000
Child:
30:97db5a684eaa
--- a/PacemakerController.cpp	Wed Dec 02 00:39:54 2015 +0000
+++ b/PacemakerController.cpp	Wed Dec 02 00:47:31 2015 +0000
@@ -5,7 +5,6 @@
 #include "Thread.h"
 using namespace rtos;
 
-
 // This is for the pacemaker
 volatile unsigned short timer_count;
 Serial pc(USBTX, USBRX);
@@ -107,17 +106,18 @@
 
 void PM_ALARM(void const *args)
 {
-
-    // min hr alarm
-    if( beats < MIN_PM_RT) {
-        lcd.locate(0,1);
-        lcd.printf("!<");
-    }
-
-    // max hr alarm
-    if(beats > MAX_PM_RT) {
-        lcd.locate(0,1);
-        lcd.printf("!>");
+    while (1) {
+        // min hr alarm
+        if( beats < MIN_PM_RT) {
+            lcd.locate(0,1);
+            lcd.printf("!<");
+        }
+    
+        // max hr alarm
+        if(beats > MAX_PM_RT) {
+            lcd.locate(0,1);
+            lcd.printf("!>");
+        }
     }
 
 }