Forklift lift thread

Files at this revision

API Documentation at this revision

Comitter:
williampeers
Date:
Wed Aug 23 02:25:54 2017 +0000
Commit message:

Changed in this revision

lift.cpp Show annotated file Show diff for this revision Revisions of this file
lift.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lift.cpp	Wed Aug 23 02:25:54 2017 +0000
@@ -0,0 +1,25 @@
+#include "lift.h"
+
+/*
+Initialise object.
+Call initators for any local objects.
+*/
+Lift::Lift(osPriority priority, int memory) {
+    lift_thread = new Thread(priority, memory);
+}
+
+/*
+Infinite loop that will be run. like a main loop.
+*/
+void Lift::run() {
+    while (true) {
+        
+    }
+}
+
+/*
+Called by main at the start of operation to start the thread running.
+*/
+void Lift::start() {
+    lift_thread.start(callback(this, &Lift::run));
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lift.h	Wed Aug 23 02:25:54 2017 +0000
@@ -0,0 +1,16 @@
+#ifndef __LIFT_INCLUDED__
+#define __LIFT_INCLUDED__
+
+#include "mbed.h"
+
+class Lift{
+private:
+    Thread lift_thread;
+    void run();
+
+public:
+    Lift();
+    void start();
+};
+
+#endif
\ No newline at end of file