Simple program for introduction of mirror actuator.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ThreadFlag.h Source File

ThreadFlag.h

00001 /*
00002  * ThreadFlag.h
00003  * Copyright (c) 2019, ZHAW
00004  * All rights reserved.
00005  *
00006  *  Created on: 29.11.2019
00007  *      Author: Marcel Honegger
00008  */
00009 
00010 #ifndef THREAD_FLAG_H_
00011 #define THREAD_FLAG_H_
00012 
00013 #include <cstdlib>
00014 #include <stdint.h>
00015 #include <mbed.h>
00016 
00017 /**
00018  * This class manages the handling of unique thread flags to trigger rtos threads.
00019  */
00020 class ThreadFlag {
00021     
00022     public:
00023         
00024                             ThreadFlag();
00025         virtual             ~ThreadFlag();
00026         virtual uint32_t    read();
00027                             operator uint32_t();
00028         
00029     private:
00030         
00031         static uint32_t threadFlags;    // variable that holds all assigned thread flags
00032         uint32_t        threadFlag;     // thread flag of this object
00033         Mutex           mutex;          // mutex to lock critical sections
00034 };
00035 
00036 #endif /* THREAD_FLAG_H_ */
00037