Added emac_stack_mem_copy. Needed by the u-blox ODIN-W2 driver.

pull/3227/head
andreas.larsson 2016-10-27 13:51:32 +02:00 committed by Anna Bridge
parent a49783c34f
commit 10cfea3bd8
2 changed files with 14 additions and 0 deletions

View File

@ -47,6 +47,11 @@ void emac_stack_mem_free(emac_stack_t* stack, emac_stack_mem_t *mem)
pbuf_free((struct pbuf*)mem);
}
void emac_stack_mem_copy(emac_stack_t* stack, emac_stack_mem_t *to, emac_stack_mem_t *from)
{
pbuf_copy((struct pbuf*)to, (struct pbuf*)from);
}
void *emac_stack_mem_ptr(emac_stack_t* stack, emac_stack_mem_t *mem)
{
return ((struct pbuf*)mem)->payload;

View File

@ -49,6 +49,15 @@ emac_stack_mem_t *emac_stack_mem_alloc(emac_stack_t* stack, uint32_t size, uint3
*/
void emac_stack_mem_free(emac_stack_t* stack, emac_stack_mem_t *mem);
/**
* Copy memory
*
* @param stack Emac stack context
* @param to Memory to copy to
* @param from Memory to copy from
*/
void emac_stack_mem_copy(emac_stack_t* stack, emac_stack_mem_t *to, emac_stack_mem_t *from);
/**
* Return pointer to the payload
*