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.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
Diff: CThunk.h
- Revision:
- 122:f9eeca106725
- Parent:
- 120:7c328cabac7e
- Child:
- 127:25aea2a3f4e3
--- a/CThunk.h Wed May 25 16:44:06 2016 +0100 +++ b/CThunk.h Thu Jul 07 14:34:11 2016 +0100 @@ -19,6 +19,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* General C++ Object Thunking class + * + * - allows direct callbacks to non-static C++ class functions + * - keeps track for the corresponding class instance + * - supports an optional context parameter for the called function + * - ideally suited for class object receiving interrupts (NVIC_SetVector) + */ + #ifndef __CTHUNK_H__ #define __CTHUNK_H__ @@ -62,6 +71,11 @@ /* IRQ/Exception compatible thunk entry function */ typedef void (*CThunkEntry)(void); +/** + * Class for created a pointer with data bound to it + * + * @Note Synchronization level: Not protected + */ template<class T> class CThunk {