Nicolas Borla
/
BBR_1Ebene
BBR 1 Ebene
Signal.h@0:fbdae7e6d805, 2018-05-14 (annotated)
- Committer:
- borlanic
- Date:
- Mon May 14 11:29:06 2018 +0000
- Revision:
- 0:fbdae7e6d805
BBR
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
borlanic | 0:fbdae7e6d805 | 1 | /* |
borlanic | 0:fbdae7e6d805 | 2 | * Signal.h |
borlanic | 0:fbdae7e6d805 | 3 | * Copyright (c) 2017, ZHAW |
borlanic | 0:fbdae7e6d805 | 4 | * All rights reserved. |
borlanic | 0:fbdae7e6d805 | 5 | * |
borlanic | 0:fbdae7e6d805 | 6 | * Created on: 08.02.2017 |
borlanic | 0:fbdae7e6d805 | 7 | * Author: Marcel Honegger |
borlanic | 0:fbdae7e6d805 | 8 | */ |
borlanic | 0:fbdae7e6d805 | 9 | |
borlanic | 0:fbdae7e6d805 | 10 | #ifndef SIGNAL_H_ |
borlanic | 0:fbdae7e6d805 | 11 | #define SIGNAL_H_ |
borlanic | 0:fbdae7e6d805 | 12 | |
borlanic | 0:fbdae7e6d805 | 13 | #include <cstdlib> |
borlanic | 0:fbdae7e6d805 | 14 | #include <stdint.h> |
borlanic | 0:fbdae7e6d805 | 15 | #include <mbed.h> |
borlanic | 0:fbdae7e6d805 | 16 | |
borlanic | 0:fbdae7e6d805 | 17 | /** |
borlanic | 0:fbdae7e6d805 | 18 | * This class manages the handling of unique signal flags to trigger rtos threads. |
borlanic | 0:fbdae7e6d805 | 19 | */ |
borlanic | 0:fbdae7e6d805 | 20 | class Signal { |
borlanic | 0:fbdae7e6d805 | 21 | |
borlanic | 0:fbdae7e6d805 | 22 | public: |
borlanic | 0:fbdae7e6d805 | 23 | |
borlanic | 0:fbdae7e6d805 | 24 | Signal(); |
borlanic | 0:fbdae7e6d805 | 25 | virtual ~Signal(); |
borlanic | 0:fbdae7e6d805 | 26 | virtual int32_t read(); |
borlanic | 0:fbdae7e6d805 | 27 | operator int32_t(); |
borlanic | 0:fbdae7e6d805 | 28 | |
borlanic | 0:fbdae7e6d805 | 29 | private: |
borlanic | 0:fbdae7e6d805 | 30 | |
borlanic | 0:fbdae7e6d805 | 31 | static int32_t signals; // variable that holds all assigned signal flags |
borlanic | 0:fbdae7e6d805 | 32 | int32_t signal; // signal flag of this object |
borlanic | 0:fbdae7e6d805 | 33 | Mutex mutex; // mutex to lock critical sections |
borlanic | 0:fbdae7e6d805 | 34 | }; |
borlanic | 0:fbdae7e6d805 | 35 | |
borlanic | 0:fbdae7e6d805 | 36 | #endif /* SIGNAL_H_ */ |
borlanic | 0:fbdae7e6d805 | 37 | |
borlanic | 0:fbdae7e6d805 | 38 |