Minor: More documentation updates

This commit is contained in:
Dirk Ziegelmeier 2016-08-25 22:23:11 +02:00
parent 57468b8a30
commit 537bd836c9
2 changed files with 13 additions and 10 deletions

View File

@ -10,7 +10,7 @@ void eth_mac_irq()
pbuf_take(p, eth_data, eth_data_count); pbuf_take(p, eth_data, eth_data_count);
/* Put in a queue which is processed in main loop */ /* Put in a queue which is processed in main loop */
if(!queue->tryPut(p)) { if(!queue_try_put(&queue, p)) {
/* queue is full -> packet loss */ /* queue is full -> packet loss */
pbuf_free(p); pbuf_free(p);
} }
@ -30,10 +30,10 @@ static err_t netif_output(struct netif *netif, struct pbuf *p)
MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts); MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts);
} }
LockInterrupts(); lock_interrupts();
pbuf_copy_partial(p, mac_send_buffer, p->tot_len, 0); pbuf_copy_partial(p, mac_send_buffer, p->tot_len, 0);
/* Start MAC transmit here */ /* Start MAC transmit here */
UnlockInterrupts(); unlock_interrupts();
return ERR_OK; return ERR_OK;
} }
@ -71,13 +71,14 @@ void main(void)
netif_set_default(&netif); netif_set_default(&netif);
netif_set_up(&netif); netif_set_up(&netif);
/* Start DHCP */ /* Start DHCP and HTTPD */
dhcp_init(); dhcp_init();
httpd_init();
while(1) { while(1) {
/* Check link state, e.g. via MDIO communication with PHY */ /* Check link state, e.g. via MDIO communication with PHY */
if(linkStateChanged()) { if(link_state_changed()) {
if(linkIsUp()) { if(link_is_up()) {
netif_set_link_up(&netif); netif_set_link_up(&netif);
} else { } else {
netif_set_link_down(&netif); netif_set_link_down(&netif);
@ -85,9 +86,9 @@ void main(void)
} }
/* Check for received frames, feed them to lwIP */ /* Check for received frames, feed them to lwIP */
LockInterrupts(); lock_interrupts();
struct pbuf* p = queue->tryGet(); struct pbuf* p = queue_try_get(&queue);
UnlockInterrupts(); unlock_interrupts();
if(p != NULL) { if(p != NULL) {
LINK_STATS_INC(link.recv); LINK_STATS_INC(link.recv);

View File

@ -69,7 +69,9 @@ const struct eth_addr ethzero = {{0,0,0,0,0,0}};
* @param p the received packet, p->payload pointing to the ethernet header * @param p the received packet, p->payload pointing to the ethernet header
* @param netif the network interface on which the packet was received * @param netif the network interface on which the packet was received
* *
* @see @ref LWIP_HOOK_UNKNOWN_ETH_PROTOCOL * @see @ref LWIP_HOOK_UNKNOWN_ETH_PROTOCOL,
* @ref ETHARP_SUPPORT_VLAN and
* @ref LWIP_HOOK_VLAN_CHECK.
*/ */
err_t err_t
ethernet_input(struct pbuf *p, struct netif *netif) ethernet_input(struct pbuf *p, struct netif *netif)