Shundo Kishi / Mbed 2 deprecated Hobby_Humanoid_controlor

Dependencies:   Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed

Revision:
10:be8b10e54ecb
Parent:
9:d9ce965299d2
Child:
11:1539d181e159
--- a/Motion.cpp	Sat Sep 22 06:16:15 2012 +0000
+++ b/Motion.cpp	Sat Sep 22 06:58:21 2012 +0000
@@ -18,6 +18,7 @@
     }
     
     m_mode = 1;
+    m_in_interrupt = false;
     
     //zero clear
     m_idx = 0;
@@ -34,8 +35,12 @@
 void Motion::step()
 {
     if (m_idx < m_IDX_MAX - 1) {
+        m_in_interrupt = true;
         update();
     } else {
+        m_in_interrupt = false;
+        m_idx = 0;
+        m_play = 0;
         tick.detach();
     }
 }
@@ -111,4 +116,9 @@
         pwm.SetDuty(i, (uint32_t)m_buf[i]);
         __enable_irq();
     }
+}
+
+bool Motion::is_in_interrupt()
+{
+    return m_in_interrupt;
 }
\ No newline at end of file