Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
Diff: Controller.h
- Revision:
- 10:fd4670ec0806
- Parent:
- 9:b3674516729d
- Child:
- 38:930469a33001
diff -r b3674516729d -r fd4670ec0806 Controller.h
--- a/Controller.h Fri Jun 10 12:56:53 2016 +0000
+++ b/Controller.h Fri Jun 10 22:21:04 2016 +0000
@@ -1,10 +1,36 @@
#ifndef __CONTROLLER_H__
#define __CONTROLLER_H__
+#include <string>
+
+#include "rtos.h"
+
class Controller {
public:
+ Controller(bool threaded, int interval_ms);
+
virtual void update() = 0;
- virtual float getValue() = 0;
+
+ virtual std::string get_name() = 0;
+
+ bool is_threaded();
+
+ void run();
+
+ int get_interval_ms();
+
+ void set_priority(osPriority priority);
+
+ osPriority get_priority();
+
+ private:
+ bool threaded;
+ bool has_spawned;
+ Thread *ctrl_thread;
+ int interval_ms;
+ osPriority prio;
+
+ static void thread_stub(void const *args);
};
#endif
\ No newline at end of file