diff --git a/ion/include/ion.h b/ion/include/ion.h index da2313b55..33039e69f 100644 --- a/ion/include/ion.h +++ b/ion/include/ion.h @@ -20,6 +20,7 @@ void ion_app(); namespace Ion { void msleep(long ms); +void usleep(long us); /* CAUTION: This is a complete reset! */ void reset(); diff --git a/ion/src/device/device.cpp b/ion/src/device/device.cpp index 0d7c5bb82..cfe69f9ab 100644 --- a/ion/src/device/device.cpp +++ b/ion/src/device/device.cpp @@ -19,6 +19,11 @@ void Ion::msleep(long ms) { __asm volatile("nop"); } } +void Ion::usleep(long us) { + for (volatile long i=0; irequestReset(); diff --git a/ion/src/simulator/init.cpp b/ion/src/simulator/init.cpp index c2027a13c..e9fda54b0 100644 --- a/ion/src/simulator/init.cpp +++ b/ion/src/simulator/init.cpp @@ -63,7 +63,7 @@ bool Ion::Keyboard::keyDown(Ion::Keyboard::Key key) { } void Ion::msleep(long ms) { - usleep(1000*ms); + ::usleep(1000*ms); sDisplay->redraw(); Fl::wait(); }