26#ifndef INCLUDE_MANAGEDTASKMAP_H_
27#define INCLUDE_MANAGEDTASKMAP_H_
37#define MTM_NULL_KEY (0U)
43#define MTME_IS_EMPTY(p_element) (((p_element)->value.p_mtask_obj == NULL) && ((p_element)->key == MTM_NULL_KEY))
111 assert_param(_this != NULL);
112 assert_param(p_elements != NULL);
120 for(i = 0; i < size; i++)
127 return SYS_NO_ERROR_CODE;
140 assert_param(_this != NULL);
167 assert_param(_this != NULL);
171 while((_this->
p_elements[i].
key != key) && (i < _this->size))
193 p_free_element = NULL;
199 if (p_free_element != NULL)
202 p_free_element->
key = key;
208 return p_free_element;
222 assert_param(_this != NULL);
228 if(++i >= _this->
size)
255 assert_param(_this != NULL);
257 return _this->
size != 0;
269 assert_param(_this != NULL);
279void MTMapValue_SetStaticParam(
MTMapValue_t *_this,
void *p_static_param)
281 assert_param(_this != NULL);
287void* MTMapValue_GetStaticParam(
const MTMapValue_t *
const _this)
289 assert_param(_this != NULL);
299uint32_t MTMap_GetKeyForGPIO(GPIO_TypeDef *p_port, uint32_t pin)
301 uint32_t port = (uint32_t)p_port;
302 uint32_t position = 0U;
306 uint32_t iocurrent = 0U;
307 while ((iocurrent == 0U) && (position < 16))
309 iocurrent = (pin) & (1UL << position++);
314 key = port + position;
This file declare the Managed task Interface.
static sys_error_code_t MTMap_Init(MTMap_t *_this, MTMapElement_t *p_elements, uint16_t size)
Definition ManagedTaskMap.h:109
static MTMapElement_t * MTMap_AddElement(MTMap_t *_this, uint32_t key, AManagedTask *p_instance)
Definition ManagedTaskMap.h:165
#define MTM_NULL_KEY
Definition ManagedTaskMap.h:37
struct _MTMapValue MTMapValue_t
struct _MTMapElement MTMapElement_t
static bool MTMap_GetElementCount(const MTMap_t *const _this)
Definition ManagedTaskMap.h:267
static MTMapValue_t * MTMap_FindByKey(MTMap_t *_this, uint32_t key)
Definition ManagedTaskMap.h:138
static bool MTMap_IsInitialized(MTMap_t *_this)
Definition ManagedTaskMap.h:253
#define MTME_IS_EMPTY(p_element)
Definition ManagedTaskMap.h:43
static bool MTMap_RemoveElement(MTMap_t *_this, uint32_t key)
Definition ManagedTaskMap.h:220
Definition AManagedTask_vtbl.h:94
Definition ManagedTaskMap.h:66
MTMapValue_t value
Definition ManagedTaskMap.h:75
uint32_t key
Definition ManagedTaskMap.h:70
Definition ManagedTaskMap.h:83
uint16_t element_count
Definition ManagedTaskMap.h:97
MTMapElement_t * p_elements
Definition ManagedTaskMap.h:87
uint16_t size
Definition ManagedTaskMap.h:92
Definition ManagedTaskMap.h:50
AManagedTask * p_mtask_obj
Definition ManagedTaskMap.h:54
void * p_static_param
Definition ManagedTaskMap.h:59
uint16_t sys_error_code_t
Definition syserror.h:41