Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit80b70aa

Browse files
author
fpr
committed
Code cleaned.
Required comments added.Documentation updated.Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
1 parent0442f1f commit80b70aa

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

‎cores/arduino/stm32/ethernet.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
******************************************************************************
3-
* @filedigital_io.h
3+
* @fileethernet.h
44
* @author WI6LABS
55
* @version V1.0.0
6-
* @date01-August-2016
7-
* @brief Header fordigital_io module
6+
* @date14-June-2017
7+
* @brief Header forethernet background task for LwIP stack.
88
******************************************************************************
99
* @attention
1010
*
@@ -49,6 +49,8 @@
4949
/* Exported macro ------------------------------------------------------------*/
5050
/* Exported functions ------------------------------------------------------- */
5151

52+
/* This function is defined by the NativeEthernet library and it is used as
53+
background task inside the main loop. */
5254
__weakvoidstm32_eth_scheduler(void)
5355
{
5456
/* NOTE : This function should not be modified. It is defined in the Ethernet

‎libraries/NativeEthernet/README.adoc‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ http://git.savannah.gnu.org/cgit/lwip.git
1313
EthernetClass::maintain() in no more required to renew IP address from DHCP.
1414
It is done automatically by the LwIP stack in a background task.
1515

16-
An Idle task is required to handle timer and data reception. Be careful to not
17-
lock the system in a loop where LwIP could never be updated.
16+
An Idle task is required by the LwIP stack to handle timer and data reception.
17+
This idle task is called inside the main loop in background by the function
18+
stm32_eth_scheduler(). Be careful to not lock the system inside the function
19+
loop() where LwIP could never be updated. Call EthernetUDP::parsePacket() or
20+
EthernetClient::available() performs an update of the LwIP stack.
1821

1922
== License ==
2023

‎libraries/NativeEthernet/src/EthernetClient.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ bool EthernetClient::operator==(const EthernetClient& rhs) {
192192
return _tcp_client == rhs._tcp_client && _tcp_client->pcb == rhs._tcp_client->pcb;
193193
}
194194

195+
/* This function is not a function defined by Arduino. This is a function
196+
specific to the W5100 architecture. To keep the compatibility we leave it and
197+
returns always 0.*/
195198
uint8_tEthernetClient::getSocketNumber() {
196199
return0;
197200
}

‎libraries/NativeEthernet/src/NativeEthernet.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
4545
voidEthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
4646
{
4747
stm32_eth_init(mac, local_ip.raw_address(), gateway.raw_address(), subnet.raw_address());
48+
/* If there is a local DHCP informs it of our manual IP configuration to
49+
prevent IP conflict*/
4850
stm32_DHCP_manual_config();
4951
_dnsServerAddress = dns_server;
5052
}

‎libraries/NativeEthernet/src/utility/stm32_eth.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ struct pbuf *stm32_new_data(struct pbuf *p, const uint8_t *buffer, size_t size)
593593

594594
if(q!=NULL) {
595595
if(ERR_OK==pbuf_copy(q,p)) {
596-
err_terr=pbuf_take_at(q, (uint8_t*)buffer,size,p->tot_len);
597-
if(ERR_OK==/*pbuf_take_at(q, (uint8_t *)buffer, size, p->tot_len)*/err) {
596+
if(ERR_OK==pbuf_take_at(q, (uint8_t*)buffer,size,p->tot_len)) {
598597
pbuf_free(p);
599598
p=q;
600599
returnp;
@@ -742,9 +741,6 @@ err_t tcp_connected_callback(void *arg, struct tcp_pcb *tpcb, err_t err)
742741
/* initialize LwIP tcp_sent callback function */
743742
tcp_sent(tpcb,tcp_sent_callback);
744743

745-
/* initialize LwIP tcp_poll callback function */
746-
// tcp_poll(tpcb, tcp_poll_callback, 1);
747-
748744
/* initialize LwIP tcp_err callback function */
749745
tcp_err(tpcb,tcp_err_callback);
750746

@@ -814,9 +810,6 @@ err_t tcp_accept_callback(void *arg, struct tcp_pcb *newpcb, err_t err)
814810
/* initialize LwIP tcp_sent callback function */
815811
tcp_sent(newpcb,tcp_sent_callback);
816812

817-
/* initialize lwip tcp_poll callback function for newpcb */
818-
// tcp_poll(newpcb, tcp_echoserver_poll, 0);
819-
820813
ret_err=ERR_OK;
821814
}else {
822815
/* close tcp connection */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp