Nicolas Borla / Mbed OS BBR_1Ebene
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  *  Created on: 08.02.2017
00007  *      Author: Marcel Honegger
00008  */
00009 
00010 #ifndef SIGNAL_H_
00011 #define SIGNAL_H_
00012 
00013 #include <cstdlib>
00014 #include <stdint.h>
00015 #include <mbed.h>
00016 
00017 /**
00018  * This class manages the handling of unique signal flags to trigger rtos threads.
00019  */
00020 class Signal {
00021     
00022     public:
00023         
00024                         Signal();
00025         virtual         ~Signal();
00026         virtual int32_t read();
00027                         operator int32_t();
00028         
00029     private:
00030         
00031         static int32_t  signals;    // variable that holds all assigned signal flags
00032         int32_t         signal;     // signal flag of this object
00033         Mutex           mutex;      // mutex to lock critical sections
00034 };
00035 
00036 #endif /* SIGNAL_H_ */
00037 
00038