Minor updates to LWIP support for uGFXnet.

Application supplied Start_LWIP() routine is now optional.
This commit is contained in:
inmarket 2013-11-17 00:52:52 +10:00
parent c0f52dee38
commit 9a5a480870
2 changed files with 11 additions and 5 deletions

View File

@ -68,11 +68,16 @@
#define SOCKET_TYPE int
#else
extern void Start_LWIP(void); // Where the application does the lwip stack setup
#define StartSockets() Start_LWIP();
#define LWIP_COMPAT_SOCKETS TRUE
#include <lwip/sockets.h>
#if GDISP_GFXNET_CUSTOM_LWIP_STARTUP
extern void Start_LWIP(void); // Where the application does the lwip stack setup
#define StartSockets() Start_LWIP();
#else
#include "lwipthread.h"
#define StartSockets() chThdCreateStatic(wa_lwip_thread, LWIP_THREAD_STACK_SIZE, NORMALPRIO + 1, lwip_thread, 0);
#endif
#if !LWIP_SOCKET
#error "GDISP: uGFXnet - LWIP_SOCKETS must be defined in your lwipopts.h file"
#endif
@ -129,7 +134,7 @@ static bool_t sendpkt(SOCKET_TYPE netfd, uint16_t *pkt, int len) {
return send(netfd, (const char *)pkt, len, 0) == len;
}
static DECLARE_THREAD_STACK(waNetThread, 512);
static DECLARE_THREAD_STACK(waNetThread, 1024);
static DECLARE_THREAD_FUNCTION(NetThread, param) {
SOCKET_TYPE listenfd, fdmax, i, clientfd;
socklen_t len;

View File

@ -191,6 +191,7 @@
#define GDISP_SCREEN_WIDTH 320
#define GDISP_SCREEN_HEIGHT 240
#define GDISP_GFXNET_PORT 13001
#define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE
#define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE
#define GDISP_USE_DMA FALSE
#define TDISP_COLUMNS 16