Lines Matching refs:cmd_desc

1016 static inline bool i2c_cmd_link_is_static(i2c_cmd_desc_t *cmd_desc)  in i2c_cmd_link_is_static()  argument
1018 return (cmd_desc->free_buffer != NULL); in i2c_cmd_link_is_static()
1027 i2c_cmd_desc_t *cmd_desc = (i2c_cmd_desc_t *) buffer; in i2c_cmd_link_create_static() local
1028 cmd_desc->head = NULL; in i2c_cmd_link_create_static()
1029 cmd_desc->cur = NULL; in i2c_cmd_link_create_static()
1030 cmd_desc->free = NULL; in i2c_cmd_link_create_static()
1031 cmd_desc->free_buffer = cmd_desc + 1; in i2c_cmd_link_create_static()
1032 cmd_desc->free_size = size - sizeof(i2c_cmd_desc_t); in i2c_cmd_link_create_static()
1034 return (i2c_cmd_handle_t) cmd_desc; in i2c_cmd_link_create_static()
1040 i2c_cmd_desc_t *cmd_desc = (i2c_cmd_desc_t *) calloc(1, sizeof(i2c_cmd_desc_t)); in i2c_cmd_link_create() local
1042 …i2c_cmd_desc_t *cmd_desc = (i2c_cmd_desc_t *) heap_caps_calloc(1, sizeof(i2c_cmd_desc_t), MALLOC_C… in i2c_cmd_link_create()
1044 return (i2c_cmd_handle_t) cmd_desc; in i2c_cmd_link_create()
1080 static esp_err_t i2c_cmd_allocate(i2c_cmd_desc_t *cmd_desc, size_t n, size_t size, void** outptr) in i2c_cmd_allocate() argument
1084 if (i2c_cmd_link_is_static(cmd_desc)) { in i2c_cmd_allocate()
1088 if (cmd_desc->free_size < required) { in i2c_cmd_allocate()
1092 *outptr = cmd_desc->free_buffer; in i2c_cmd_allocate()
1095 cmd_desc->free_buffer += required; in i2c_cmd_allocate()
1096 cmd_desc->free_size -= required; in i2c_cmd_allocate()
1112 static inline void i2c_cmd_log_alloc_error(i2c_cmd_desc_t *cmd_desc) in i2c_cmd_log_alloc_error() argument
1114 if (i2c_cmd_link_is_static(cmd_desc)) { in i2c_cmd_log_alloc_error()
1124 i2c_cmd_desc_t *cmd_desc = (i2c_cmd_desc_t *) cmd_handle; in i2c_cmd_link_append() local
1126 assert(cmd_desc != NULL); in i2c_cmd_link_append()
1128 if (cmd_desc->head == NULL) { in i2c_cmd_link_append()
1129 err = i2c_cmd_allocate(cmd_desc, 1, sizeof(i2c_cmd_link_t), (void**) &cmd_desc->head); in i2c_cmd_link_append()
1131 i2c_cmd_log_alloc_error(cmd_desc); in i2c_cmd_link_append()
1134 cmd_desc->cur = cmd_desc->head; in i2c_cmd_link_append()
1135 cmd_desc->free = cmd_desc->head; in i2c_cmd_link_append()
1137 assert(cmd_desc->cur != NULL); in i2c_cmd_link_append()
1138 err = i2c_cmd_allocate(cmd_desc, 1, sizeof(i2c_cmd_link_t), (void**) &cmd_desc->cur->next); in i2c_cmd_link_append()
1140 i2c_cmd_log_alloc_error(cmd_desc); in i2c_cmd_link_append()
1143 cmd_desc->cur = cmd_desc->cur->next; in i2c_cmd_link_append()
1145 memcpy((uint8_t *) &cmd_desc->cur->cmd, (uint8_t *) cmd, sizeof(i2c_cmd_t)); in i2c_cmd_link_append()
1146 cmd_desc->cur->next = NULL; in i2c_cmd_link_append()