Shohei Yasutake / Mbed 2 deprecated koibumi2000

Dependencies:   fll mbed-rtos mbed

Revision:
8:d16a0fcc2735
Parent:
7:61b4825304e2
Child:
9:0d6631edfc32
--- a/fll.cpp	Sat Feb 14 16:39:53 2015 +0000
+++ b/fll.cpp	Sat Feb 14 16:51:25 2015 +0000
@@ -167,3 +167,25 @@
         }
     }
 }
+
+// ----
+// main
+// ----
+void invoke_sinkrun(const void *p) {
+    ((Sink*)p)->run();
+}
+
+void fll_run(Producer* producer) {
+    Mail<button_t, MAIL_BOX_SIZE>* mail_box = new Mail<button_t, MAIL_BOX_SIZE>();
+    Mutex* mutex = new Mutex();
+
+    Sink* sink = new Sink(producer, mail_box, mutex);
+
+    Ticker ticker;
+    Output* output = new Output(mail_box);
+
+    Thread th(invoke_sinkrun, (void *)sink);
+    ticker.attach(output, &Output::run, FRAME);
+
+    Thread::wait(osWaitForever);
+}
\ No newline at end of file