Free (GPLv2) TCP/IP stack developed by TASS Belgium
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
Diff: include/pico_queue.h
- Revision:
- 149:5f4cb161cec3
- Parent:
- 131:4758606c9316
- Child:
- 152:a3d286bf94e5
--- a/include/pico_queue.h Tue Mar 11 15:34:51 2014 +0100 +++ b/include/pico_queue.h Wed Apr 09 14:31:41 2014 +0200 @@ -3,8 +3,8 @@ See LICENSE and COPYING for usage. *********************************************************************/ -#ifndef _INCLUDE_PICO_QUEUE -#define _INCLUDE_PICO_QUEUE +#ifndef INCLUDE_PICO_QUEUE +#define INCLUDE_PICO_QUEUE #include <stdint.h> #include "pico_config.h" #include "pico_frame.h" @@ -30,16 +30,16 @@ }; #ifdef PICO_SUPPORT_MUTEX -#define LOCK(x) { \ +#define PICOTCP_MUTEX_LOCK(x) { \ if (x == NULL) \ x = pico_mutex_init(); \ pico_mutex_lock(x); \ } -#define UNLOCK(x) pico_mutex_unlock(x) +#define PICOTCP_MUTEX_UNLOCK(x) pico_mutex_unlock(x) #else -#define LOCK(x) do {} while(0) -#define UNLOCK(x) do {} while(0) +#define PICOTCP_MUTEX_LOCK(x) do {} while(0) +#define PICOTCP_MUTEX_UNLOCK(x) do {} while(0) #endif #ifdef PICO_SUPPORT_DEBUG_TOOLS @@ -71,7 +71,7 @@ return -1; if (q->shared) - LOCK(q->mutex); + PICOTCP_MUTEX_LOCK(q->mutex); p->next = NULL; if (!q->head) { @@ -89,7 +89,7 @@ debug_q(q); if (q->shared) - UNLOCK(q->mutex); + PICOTCP_MUTEX_UNLOCK(q->mutex); return (int32_t)q->size; } @@ -97,11 +97,14 @@ static inline struct pico_frame *pico_dequeue(struct pico_queue *q) { struct pico_frame *p = q->head; + if (!p) + return NULL; + if (q->frames < 1) return NULL; if (q->shared) - LOCK(q->mutex); + PICOTCP_MUTEX_LOCK(q->mutex); q->head = p->next; q->frames--; @@ -110,9 +113,10 @@ q->tail = NULL; debug_q(q); + p->next = NULL; if (q->shared) - UNLOCK(q->mutex); + PICOTCP_MUTEX_UNLOCK(q->mutex); return p; } @@ -131,7 +135,7 @@ { struct pico_frame *p = pico_dequeue(q); while(p) { - pico_free(p); + PICO_FREE(p); p = pico_dequeue(q); } }