Ruprecht Altenburger / Misc_Lib

Dependents:  

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Signal.h Source File

Signal.h

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