mbed(エンベッド)の仕組みを学び、試作体験!用のサンプル

Dependencies:   Milkcocoa-os

Fork of MilkcocoaOsSample_Eth by Junichi Katsu

Revision:
5:103da32c92c7
Parent:
2:727e3e0fcb81
Child:
7:49a5a7e621d6
diff -r abbddd0c8984 -r 103da32c92c7 main.cpp
--- a/main.cpp	Fri May 19 01:34:41 2017 +0000
+++ b/main.cpp	Thu Jun 01 00:25:37 2017 +0000
@@ -38,15 +38,19 @@
     
     pc.printf("%d\n\r",milkcocoa->on(MILKCOCOA_DATASTORE, "push", onpush));
     
+#ifdef __MILKCOCOA_THREAD
     milkcocoa->setLoopCycle(5000);
     milkcocoa->start();
-
+#endif
     while(1) {
         DataElement elem = DataElement();
         elem.setValue("v", 1);
         
         milkcocoa->push(MILKCOCOA_DATASTORE, elem);
 
+#ifndef __MILKCOCOA_THREAD
+        milkcocoa->loop();
+#endif
         Thread::wait(7000);
         
     }