-
Notifications
You must be signed in to change notification settings - Fork 48
Fix issue #3 and #4 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the register callback could be remove in this case
src/utility/stm32_eth.c
Outdated
TimHandle.timer = DEFAULT_ETHERNET_TIMER; | ||
|
||
/* Timer set to 1ms */ | ||
TimerHandleInit(&TimHandle, (uint16_t)(1000 - 1), ((uint32_t)(getTimerClkFreq(TIM6) / (1000000)) - 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be DEFAULT_ETHERNET_TIMER?
static void TIM_scheduler_Config(void) | ||
{ | ||
/* Set TIMx instance. */ | ||
TimHandle.timer = DEFAULT_ETHERNET_TIMER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be defined in variant.h ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I defined it in lwipopt.h. I think it is better to keep all Ethernet options in this file.
If this PR is validated, the register callback could be removed indeed. |
please @fprwi6labs could you remove the register cb. |
Issue #4 fixed. Initialization sequence must be done only once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: it is planned to extend Timer API of the Arduino STM32 core. They could be used for this library when available.
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
This PR should fix #3
To test this PR please add
#define DEFAULT_ETHERNET_TIMER TIM6
in lwipopts.hThe issue #4 is also fixed:
begin()
is called several time.