Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Dynamic Mutex Implementation

For the dynamic peripheral driver implementation, the following definitions need to be made in the netx_drv_user_conf.h:

Code Block
languagecpp
titlenetx_drv_user_conf.h
/*!
 * \brief Define that has to be set if an RTOS is used.
 */
#define RTOS_USED

/*!
 * \brief RTOS_USED relevant define that ignores the compiler error that is
 * generated to let the engineer know, that those functions has to be implemented
 * by him.
 */
#define RTOS_ERROR_IGNORE

/*!
 * \brief RTOS_USED relevant type used for the element to be locked
 */
#define DRV_LOCK_T  SemaphoreHandle_t

/*!
 * \brief RTOS_USED relevant initializer type of the type to be locked as rvalue is in default the mutex initializer type.
 */
#define DRV_LOCK_INITIALIZER_TYPE SemaphoreHandle_t

/*!
 * \brief RTOS_USED relevant initializer value of the type to be locked as rvalue is in default the mutex initializer value.
 */
#define DRV_LOCK_INITIALIZER_VALUE NULL

/*!
 * \brief RTOS_USED relevant initializer of the type to be locked as rvalue.
 */
#define DRV_LOCK_INITIALIZER  xSemaphoreCreateMutex()

/*!
 * \brief RTOS_USED relevant function executing the lock.
 * Shall return DRV_LOCKED in case the mutex is not free or
 * might be implemented with priority inheritance or similiar functionality.
 */
#define DRV_LOCK(__HANDLE__)  if(xSemaphoreTake((__HANDLE__)->tLock,0)!=pdTRUE ){return DRV_LOCKED;}

/*!
 * \brief RTOS_USED relevant function releasing the lock.
 */
#define DRV_UNLOCK(__HANDLE__)  xSemaphoreGive((__HANDLE__)->tLock)

Static

...

Mutex Implementation

TBD