Lib_Misc

Dependents:   IndNav_QK3_T265

Committer:
altb
Date:
Mon Mar 04 11:03:51 2019 +0000
Revision:
0:3312872854c4
New Lib Folder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
altb 0:3312872854c4 1 /*
altb 0:3312872854c4 2 * Signal.h
altb 0:3312872854c4 3 * Copyright (c) 2017, ZHAW
altb 0:3312872854c4 4 * All rights reserved.
altb 0:3312872854c4 5 */
altb 0:3312872854c4 6
altb 0:3312872854c4 7 #ifndef SIGNAL_H_
altb 0:3312872854c4 8 #define SIGNAL_H_
altb 0:3312872854c4 9
altb 0:3312872854c4 10 #include <cstdlib>
altb 0:3312872854c4 11 #include <stdint.h>
altb 0:3312872854c4 12 #include <mbed.h>
altb 0:3312872854c4 13
altb 0:3312872854c4 14 /**
altb 0:3312872854c4 15 * This class manages the handling of unique signal flags to trigger rtos threads.
altb 0:3312872854c4 16 */
altb 0:3312872854c4 17 class Signal {
altb 0:3312872854c4 18
altb 0:3312872854c4 19 public:
altb 0:3312872854c4 20
altb 0:3312872854c4 21 Signal();
altb 0:3312872854c4 22 virtual ~Signal();
altb 0:3312872854c4 23 virtual int32_t read();
altb 0:3312872854c4 24 operator int32_t();
altb 0:3312872854c4 25
altb 0:3312872854c4 26 private:
altb 0:3312872854c4 27
altb 0:3312872854c4 28 static int32_t signals; // variable that holds all assigned signal flags
altb 0:3312872854c4 29 int32_t signal; // signal flag of this object
altb 0:3312872854c4 30 Mutex mutex; // mutex to lock critical sections
altb 0:3312872854c4 31 };
altb 0:3312872854c4 32
altb 0:3312872854c4 33 #endif /* SIGNAL_H_ */
altb 0:3312872854c4 34