diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2022-10-11 22:14:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 22:14:13 -0500 |
commit | 4d860f482e68f125788248ec63bd2b9a9120183d (patch) | |
tree | 6e629db544046a82f2fcdf233c7eb8abd870735b | |
parent | e36b3053792131d3ea6692206bc705243efa84a5 (diff) | |
parent | f79741a85fa08dff34a41ae7c804d80dc800343c (diff) | |
download | Sensor-Watch-4d860f482e68f125788248ec63bd2b9a9120183d.tar.gz Sensor-Watch-4d860f482e68f125788248ec63bd2b9a9120183d.tar.bz2 Sensor-Watch-4d860f482e68f125788248ec63bd2b9a9120183d.zip |
Merge pull request #93 from wryun/make-starter-proj-work-in-simulator
Make starter project work in simulator
-rw-r--r-- | watch-library/shared/watch/watch.h | 4 | ||||
-rw-r--r-- | watch-library/simulator/main.c | 4 | ||||
-rw-r--r-- | watch-library/simulator/watch/watch_main_loop.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/watch-library/shared/watch/watch.h b/watch-library/shared/watch/watch.h index 7526d03a..790f9a16 100644 --- a/watch-library/shared/watch/watch.h +++ b/watch-library/shared/watch/watch.h @@ -30,6 +30,10 @@ #include "driver_init.h" #include "pins.h" +#ifdef __EMSCRIPTEN__ +#include "watch_main_loop.h" +#endif // __EMSCRIPTEN__ + /** @mainpage Sensor Watch Documentation * @brief This documentation covers most of the functions you will use to interact with the Sensor Watch hardware. It is divided into the following sections: diff --git a/watch-library/simulator/main.c b/watch-library/simulator/main.c index ac9db6ac..6898fd06 100644 --- a/watch-library/simulator/main.c +++ b/watch-library/simulator/main.c @@ -101,6 +101,10 @@ static void main_loop_set_sleeping(bool sleeping) { }, sleeping); } +void delay_ms(const uint16_t ms) { + main_loop_sleep(ms); +} + int main(void) { app_init(); _watch_init(); diff --git a/watch-library/simulator/watch/watch_main_loop.h b/watch-library/simulator/watch/watch_main_loop.h index 82351919..7599f727 100644 --- a/watch-library/simulator/watch/watch_main_loop.h +++ b/watch-library/simulator/watch/watch_main_loop.h @@ -31,3 +31,5 @@ void resume_main_loop(void); void main_loop_sleep(uint32_t ms); bool main_loop_is_sleeping(void); + +void delay_ms(const uint16_t ms); |