Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Controller.h

Committer:
sbouber1
Date:
2016-06-10
Revision:
10:fd4670ec0806
Parent:
9:b3674516729d
Child:
38:930469a33001

File content as of revision 10:fd4670ec0806:

#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 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