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.
Diff: main.cpp
- Revision:
- 2:824d7df88ed9
- Parent:
- 1:39b4d6e71f76
- Child:
- 3:accb9e3920f9
diff -r 39b4d6e71f76 -r 824d7df88ed9 main.cpp
--- a/main.cpp Tue Nov 06 11:22:47 2012 +0000
+++ b/main.cpp Tue Nov 06 12:31:06 2012 +0000
@@ -320,6 +320,8 @@
Thread::wait(3000);
writeCommand4(2, 0x51000100);//---6---
Thread::wait(2500);
+
+ *(bool*)argument = true;
}
void type1_speed (void const *argument)
@@ -339,6 +341,8 @@
writeCommand4(1, 0x51000078);
Thread::wait(5200);
writeCommand(1, 0xb0);
+
+ *(bool*)argument = true;
}
int main()
@@ -375,8 +379,12 @@
} else if (i == 4) {
reb1 ();
} else if (i == 5) {
- Thread speed_thread(&type1_speed);
- Thread tacho_thread(&type1_tacho);
+ bool speed_done = false;
+ bool tacho_done = false;
+ Thread speed_thread(&type1_speed, &speed_done);
+ Thread tacho_thread(&type1_tacho, tacho_done);
+ while (!speed_done || !tacho_done)
+ wait_ms(10);
} else if (i == 6) {
writeCommand4(1, 0x5000012c);
