TaskManagerIO
Loading...
Searching...
No Matches
TaskPlatformDeps.h File Reference

provides the platform specific configuration for task manager More...

Go to the source code of this file.

Typedefs

typedef uint32_t pintype_t
typedef TimerTask *volatile tm_internal::TimerTaskAtomicPtr
typedef volatile bool tm_internal::TmAtomicBool
typedef uint16_t sched_t

Functions

void * getCurrentThreadId ()
bool tm_internal::atomicSwapBool (volatile bool *ptr, bool expected, bool newValue)
bool tm_internal::atomicReadBool (TmAtomicBool *pPtr)
void tm_internal::atomicWriteBool (TmAtomicBool *pPtr, bool newVal)
TimerTasktm_internal::atomicReadPtr (TimerTaskAtomicPtr *pPtr)
void tm_internal::atomicWritePtr (TimerTaskAtomicPtr *pPtr, TimerTask *volatile newValue)
void tm_internal::initPicoTmLock ()

Variables

critical_section_t * tm_internal::tmLock

Detailed Description

provides the platform specific configuration for task manager

Function Documentation

◆ atomicSwapBool()

bool tm_internal::atomicSwapBool ( volatile bool * ptr,
bool expected,
bool newValue )
inline

Sets the boolean to the new value ONLY when the existing value matches expected.

Parameters
ptrthe bool memory location to compare / swap
expectedthe expected value
newValuethe replacement, replaced on if expected matches
Returns
true if the replacement was done, otherwise false

◆ atomicReadBool()

bool tm_internal::atomicReadBool ( TmAtomicBool * pPtr)
inline

Reads the value in an atomic boolean object

Reads an atomic boolean value

Parameters
pPtrthe pointer to an atomic boolean value
Returns
the boolean value.

◆ atomicWriteBool()

void tm_internal::atomicWriteBool ( TmAtomicBool * pPtr,
bool newVal )
inline

Writes a boolean value atomically

Parameters
pPtrthe atomic ref
newValthe new value

◆ atomicReadPtr()

TimerTask * tm_internal::atomicReadPtr ( TimerTaskAtomicPtr * pPtr)
inline

Dereferences and returns the value of the pointer at ptr type. On mbed boards this is already an atomic operation and therefore volatile is enough.

Template Parameters
PTR_TYPEclass type of the pointer
Parameters
pPtrreference to memory of the pointer
Returns
the pointer.

◆ atomicWritePtr()

void tm_internal::atomicWritePtr ( TimerTaskAtomicPtr * pPtr,
TimerTask *volatile newValue )
inline

Dereferences and then sets the memory of the pointer type. On mbed boards this is already an atomic operation

Template Parameters
PTR_TYPE
Parameters
pPtr
newValue