....

Dependencies:   Library_Cntrl Library_Misc_cuboid

Fork of cuboid_balance_ros by Ruprecht Altenburger

Committer:
altb2
Date:
Fri Nov 22 16:46:16 2019 +0000
Revision:
2:9b068d2a7994
Parent:
0:acf871f26563
updated ros version

Who changed what in which revision?

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