Skip to content

Commit 95466f3

Browse files
committed
Update README.md and warn user about the default timer used.
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent d5a2142 commit 95466f3

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,28 @@
55
With an STM32 board with Ethernet compatibility, this library allows a STM32
66
board (NUCLEO, DISCOVERY, ...) to connect to the internet.
77

8-
For more information about this library please visit us at
9-
http://www.arduino.cc/en/Reference/Ethernet
8+
This library follows the Ethernet API from Arduino.<br>
9+
For more information about it please visit: http://www.arduino.cc/en/Reference/Ethernet
1010

1111
## Note
1212

13-
The library is based on LwIP, a Lightweight TCP/IP stack.
13+
The library is based on LwIP, a Lightweight TCP/IP stack, available here:
14+
1415
http://git.savannah.gnu.org/cgit/lwip.git
16+
1517
The LwIP has been ported as Arduino library. The STM32Ethernet library depends
1618
on it.
1719

18-
EthernetClass::maintain() in no more required to renew IP address from DHCP.
20+
`EthernetClass::maintain()` in no more required to renew IP address from DHCP.<br>
1921
It is done automatically by the LwIP stack in a background task.
2022

21-
An Idle task is required by the LwIP stack to handle timer and data reception.
22-
This idle task is called inside the main loop in background by the function
23-
stm32_eth_scheduler(). Be careful to not lock the system inside the function
24-
loop() where LwIP could never be updated. Call Ethernet::schedule() performs an
25-
update of the LwIP stack.
23+
An Idle task is required by the LwIP stack to handle timer and data reception.<br>
24+
This idle task is called inside a timer callback each 1 ms by the
25+
function `stm32_eth_scheduler()`.<br>
26+
A `DEFAULT_ETHERNET_TIMER` is set in the library to `TIM14`.<br>
27+
`DEFAULT_ETHERNET_TIMER` can be redefined in the core variant.<br>
28+
Be careful to not lock the system in a function which disabling IRQ.<br>
29+
Call `Ethernet::schedule()` performs an update of the LwIP stack.<br>
2630

2731
## Wiki
2832

src/utility/stm32_eth.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@
6060
/* Maximum number of retries for DHCP request */
6161
#define MAX_DHCP_TRIES 4
6262

63-
/* Timer used to call the scheduler */
63+
/*
64+
* Defined a default timer used to call ethernet scheduler at regular interval
65+
* Could be redefined in the variant
66+
* Note: This is planned to extend Timer API's of the Arduino STM32 core
67+
* They could be used for this library when available
68+
*/
6469
#ifndef DEFAULT_ETHERNET_TIMER
6570
#define DEFAULT_ETHERNET_TIMER TIM14
71+
#warning "Default timer used to call ethernet scheduler at regular interval: TIM14"
6672
#endif
6773

6874
/* Ethernet configuration: user parameters */

0 commit comments

Comments
 (0)