Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Diff: Motion.cpp
- 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