Demo program for mbed 5 thread start compile rerror
Fork of mbed-os-example-mbed5-blinky by
Revision 18:7f2d0c1cfb33, committed 2016-11-03
- Comitter:
- Roietronics
- Date:
- Thu Nov 03 21:17:48 2016 +0000
- Parent:
- 17:267747192719
- Child:
- 19:1c65f0106b2c
- Commit message:
- Demo Bug is mbed-os Thread start
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 03 09:19:33 2016 +0000
+++ b/main.cpp Thu Nov 03 21:17:48 2016 +0000
@@ -1,28 +1,31 @@
#include "mbed.h"
#include "Thread.h"
+#include "Callback.h"
DigitalOut led1(LED1);
#define mySignal 0x01
-class Test
+class MyTest
{
public:
osThreadId _id;
Thread _thread;
- void myWorker(void* arge)
+ void myWorker(void const* arge)
{
+ MyTest* t = (MyTest*)arge;
int i;
i++;
osSignalSet(_id, mySignal);
}
- Test(osThreadId id) :
+ MyTest(osThreadId id) :
_id(id),
_thread()
{
- _thread.start(this, &Test::myWorker);
+ osStatus status = _thread.start(this, &MyTest::myWorker);
+// _thread.start(callback(this, &Test::myWorker));
}
};
@@ -31,7 +34,7 @@
// (note the calls to Thread::wait below for delays)
int main() {
osThreadId id = Thread::gettid();
- Test* test = new Test(id);
+ MyTest* test = new MyTest(id);
while (true) {
led1 = !led1;
Thread::wait(500);
--- a/mbed-os.lib Thu Nov 03 09:19:33 2016 +0000 +++ b/mbed-os.lib Thu Nov 03 21:17:48 2016 +0000 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#a6f3fd1a60d5df59246d7caf3f108c4d34e1808e +https://github.com/ARMmbed/mbed-os/#21dd7008a1540c02150f1b87c12294301db979bb
