Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LSM9DS1 RangeFinder FastPWM
Dependents: PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board ... more
ThreadFlag.h@4:9c003c402033, 2021-04-06 (annotated)
- Committer:
- pmic
- Date:
- Tue Apr 06 11:21:54 2021 +0000
- Revision:
- 4:9c003c402033
- Parent:
- 0:86129f1b4a93
Update Libary via copy+past, no idea why it is not working via mbed studio.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pmic | 0:86129f1b4a93 | 1 | /* |
| pmic | 0:86129f1b4a93 | 2 | * ThreadFlag.h |
| pmic | 0:86129f1b4a93 | 3 | * Copyright (c) 2020, ZHAW |
| pmic | 0:86129f1b4a93 | 4 | * All rights reserved. |
| pmic | 0:86129f1b4a93 | 5 | */ |
| pmic | 0:86129f1b4a93 | 6 | |
| pmic | 0:86129f1b4a93 | 7 | #ifndef THREAD_FLAG_H_ |
| pmic | 0:86129f1b4a93 | 8 | #define THREAD_FLAG_H_ |
| pmic | 0:86129f1b4a93 | 9 | |
| pmic | 0:86129f1b4a93 | 10 | #include <cstdlib> |
| pmic | 0:86129f1b4a93 | 11 | #include <mbed.h> |
| pmic | 0:86129f1b4a93 | 12 | |
| pmic | 0:86129f1b4a93 | 13 | /** |
| pmic | 0:86129f1b4a93 | 14 | * This class manages the handling of unique thread flags to trigger rtos threads. |
| pmic | 0:86129f1b4a93 | 15 | */ |
| pmic | 4:9c003c402033 | 16 | class ThreadFlag |
| pmic | 4:9c003c402033 | 17 | { |
| pmic | 4:9c003c402033 | 18 | |
| pmic | 4:9c003c402033 | 19 | public: |
| pmic | 4:9c003c402033 | 20 | |
| pmic | 4:9c003c402033 | 21 | ThreadFlag(); |
| pmic | 4:9c003c402033 | 22 | virtual ~ThreadFlag(); |
| pmic | 4:9c003c402033 | 23 | virtual unsigned int read(); |
| pmic | 4:9c003c402033 | 24 | operator unsigned int(); |
| pmic | 4:9c003c402033 | 25 | |
| pmic | 4:9c003c402033 | 26 | private: |
| pmic | 4:9c003c402033 | 27 | |
| pmic | 4:9c003c402033 | 28 | static unsigned int threadFlags; // variable that holds all assigned thread flags |
| pmic | 4:9c003c402033 | 29 | unsigned int threadFlag; // thread flag of this object |
| pmic | 4:9c003c402033 | 30 | Mutex mutex; // mutex to lock critical sections |
| pmic | 0:86129f1b4a93 | 31 | }; |
| pmic | 0:86129f1b4a93 | 32 | |
| pmic | 0:86129f1b4a93 | 33 | #endif /* THREAD_FLAG_H_ */ |
| pmic | 0:86129f1b4a93 | 34 |
