3K04 Project / Mbed 2 deprecated Pacemaker

Dependencies:   mbed-rtos mbed

Revision:
1:8f545f45d899
Parent:
0:00669618559e
Child:
2:4fb5a8d15f9c
--- a/pulsegenerator.cpp	Thu Nov 24 16:37:00 2016 +0000
+++ b/pulsegenerator.cpp	Fri Nov 25 03:44:54 2016 +0000
@@ -16,7 +16,7 @@
 Thread timerThread(osPriorityNormal);
 
 uint32_t pace_period_ms;
-uint32_t new_pace_period_ms;
+uint32_t next_pace_period_ms;
 
 
 uint8_t initialized = 0;
@@ -32,6 +32,11 @@
     return currentMode;    
 }
 
+uint32_t set_pace_period_ms(new_pace_period_ms){
+    next_pace_period_ms = new_pace_period_ms;
+    return pace_period_ms;
+}
+
 /*
 Deactivates both pacing circuits
 Cancels any existing pace event
@@ -141,8 +146,13 @@
 }
 
 void pace_VOOR() {
-    //check accelerometer
-    //pace accordingly
+    if(isMotionThresholdExceeded()){
+            set_vent_pulse_width_us();//pace faster
+            pace_VOO();
+            resetMotionDetection();
+        }
+        else {
+            //pace with previous value
 }
 
 void begin_pace () {