C027 Interface

Dependencies:   C027_Support

Fork of C027Interface by NetworkSocketAPI

Revision:
16:4015243c506d
Parent:
15:21d4f56eb172
--- a/C027Interface.cpp	Tue Apr 26 20:34:29 2016 +0000
+++ b/C027Interface.cpp	Tue Oct 04 20:23:22 2016 +0000
@@ -207,6 +207,17 @@
     return recv;
 }
 
+void C027Interface::_run()
+{
+    while (true) {
+        _callback(_data);
+        wait(0.25f);
+    }
+}
+ 
 void C027Interface::socket_attach(void *handle, void (*callback)(void *), void *data)
 {
+    _callback = callback;
+    _data = data;
+    _thread.start(this, &C027Interface::_run);
 }