Option for lwip link status poll interval.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5047 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2013-01-09 09:34:48 +00:00
parent fe7aa77ae0
commit 9754c3a6ce
4 changed files with 35 additions and 29 deletions

View File

@ -177,7 +177,7 @@ typedef struct MACDriver MACDriver;
*
* @api
*/
#define magGetNextReceiveBuffer(rdp, sizep) \
#define macGetNextReceiveBuffer(rdp, sizep) \
mac_lld_get_next_receive_buffer(rdp, sizep)
#endif /* MAC_USE_ZERO_COPY */
/** @} */

View File

@ -262,7 +262,7 @@ msg_t lwip_thread(void *p) {
netif_set_up(&thisif);
/* Setup event sources.*/
evtInit(&evt, S2ST(5));
evtInit(&evt, LWIP_LINK_POLL_INTERVAL);
evtStart(&evt);
chEvtRegisterMask(&evt.et_es, &el0, PERIODIC_TIMER_ID);
chEvtRegisterMask(macGetReceiveEventSource(&ETHD1), &el1, FRAME_RECEIVED_ID);

View File

@ -30,77 +30,82 @@
/** @brief MAC thread priority.*/
#ifndef LWIP_THREAD_PRIORITY
#define LWIP_THREAD_PRIORITY LOWPRIO
#endif
/** @brief IP Address. */
#if !defined(LWIP_IPADDR) || defined(__DOXYGEN__)
#define LWIP_IPADDR(p) IP4_ADDR(p, 192, 168, 1, 20)
#endif
/** @brief IP Gateway. */
#if !defined(LWIP_GATEWAY) || defined(__DOXYGEN__)
#define LWIP_GATEWAY(p) IP4_ADDR(p, 192, 168, 1, 1)
#endif
/** @brief IP netmask. */
#if !defined(LWIP_NETMASK) || defined(__DOXYGEN__)
#define LWIP_NETMASK(p) IP4_ADDR(p, 255, 255, 255, 0)
#define LWIP_THREAD_PRIORITY LOWPRIO
#endif
/** @brief MAC thread stack size. */
#if !defined(LWIP_THREAD_STACK_SIZE) || defined(__DOXYGEN__)
#define LWIP_THREAD_STACK_SIZE 512
#define LWIP_THREAD_STACK_SIZE 512
#endif
/** @brief Link poll interval. */
#if !defined(LWIP_LINK_POLL_INTERVAL) || defined(__DOXYGEN__)
#define LWIP_LINK_POLL_INTERVAL S2ST(5)
#endif
/** @brief IP Address. */
#if !defined(LWIP_IPADDR) || defined(__DOXYGEN__)
#define LWIP_IPADDR(p) IP4_ADDR(p, 192, 168, 1, 20)
#endif
/** @brief IP Gateway. */
#if !defined(LWIP_GATEWAY) || defined(__DOXYGEN__)
#define LWIP_GATEWAY(p) IP4_ADDR(p, 192, 168, 1, 1)
#endif
/** @brief IP netmask. */
#if !defined(LWIP_NETMASK) || defined(__DOXYGEN__)
#define LWIP_NETMASK(p) IP4_ADDR(p, 255, 255, 255, 0)
#endif
/** @brief Transmission timeout. */
#if !defined(LWIP_SEND_TIMEOUT) || defined(__DOXYGEN__)
#define LWIP_SEND_TIMEOUT 50
#define LWIP_SEND_TIMEOUT 50
#endif
/** @brief Link speed. */
#if !defined(LWIP_LINK_SPEED) || defined(__DOXYGEN__)
#define LWIP_LINK_SPEED 100000000
#define LWIP_LINK_SPEED 100000000
#endif
/** @brief MAC Address byte 0. */
#if !defined(LWIP_ETHADDR_0) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_0 0xC2
#define LWIP_ETHADDR_0 0xC2
#endif
/** @brief MAC Address byte 1. */
#if !defined(LWIP_ETHADDR_1) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_1 0xAF
#define LWIP_ETHADDR_1 0xAF
#endif
/** @brief MAC Address byte 2. */
#if !defined(LWIP_ETHADDR_2) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_2 0x51
#define LWIP_ETHADDR_2 0x51
#endif
/** @brief MAC Address byte 3. */
#if !defined(LWIP_ETHADDR_3) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_3 0x03
#define LWIP_ETHADDR_3 0x03
#endif
/** @brief MAC Address byte 4. */
#if !defined(LWIP_ETHADDR_4) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_4 0xCF
#define LWIP_ETHADDR_4 0xCF
#endif
/** @brief MAC Address byte 5. */
#if !defined(LWIP_ETHADDR_5) || defined(__DOXYGEN__)
#define LWIP_ETHADDR_5 0x46
#define LWIP_ETHADDR_5 0x46
#endif
/** @brief Interface name byte 0. */
#if !defined(LWIP_IFNAME0) || defined(__DOXYGEN__)
#define LWIP_IFNAME0 'm'
#define LWIP_IFNAME0 'm'
#endif
/** @brief Interface name byte 1. */
#if !defined(LWIP_IFNAME1) || defined(__DOXYGEN__)
#define LWIP_IFNAME1 's'
#define LWIP_IFNAME1 's'
#endif
/**

View File

@ -98,6 +98,7 @@
TODO: Create a FatFS wrapper implementing the interface and using a server
thread for synchronization.
TODO: Create an implementation over a read-only file system in code space.
- NEW: Added an option to lwipthread to change the link status poll interval.
- NEW: Added new C++ demo for the STM32F4-Discovery.
- NEW: Updated C++ wrapper with a much more logical classes structure.
TODO: Opdate older C++ demos.