Skip to content

Commit 10cfea3

Browse files
andreas.larssonadbridge
authored andcommitted
Added emac_stack_mem_copy. Needed by the u-blox ODIN-W2 driver.
1 parent a49783c commit 10cfea3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

features/FEATURE_LWIP/lwip-interface/emac_stack_lwip.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ void emac_stack_mem_free(emac_stack_t* stack, emac_stack_mem_t *mem)
4747
pbuf_free((struct pbuf*)mem);
4848
}
4949

50+
void emac_stack_mem_copy(emac_stack_t* stack, emac_stack_mem_t *to, emac_stack_mem_t *from)
51+
{
52+
pbuf_copy((struct pbuf*)to, (struct pbuf*)from);
53+
}
54+
5055
void *emac_stack_mem_ptr(emac_stack_t* stack, emac_stack_mem_t *mem)
5156
{
5257
return ((struct pbuf*)mem)->payload;

features/netsocket/emac_stack_mem.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ emac_stack_mem_t *emac_stack_mem_alloc(emac_stack_t* stack, uint32_t size, uint3
4949
*/
5050
void emac_stack_mem_free(emac_stack_t* stack, emac_stack_mem_t *mem);
5151

52+
/**
53+
* Copy memory
54+
*
55+
* @param stack Emac stack context
56+
* @param to Memory to copy to
57+
* @param from Memory to copy from
58+
*/
59+
void emac_stack_mem_copy(emac_stack_t* stack, emac_stack_mem_t *to, emac_stack_mem_t *from);
60+
5261
/**
5362
* Return pointer to the payload
5463
*

0 commit comments

Comments
 (0)