Skip to content

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

Merged
merged 2 commits into from Oct 20, 2017
Merged

Fix issue #3 and #4 #5

merged 2 commits into from Oct 20, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 16, 2017

This PR should fix #3

  • Ethernet scheduler called by timer every 1ms
  • function close client reworked

To test this PR please add #define DEFAULT_ETHERNET_TIMER TIM6 in lwipopts.h

The issue #4 is also fixed:

  • init sequence is done only once even if begin() is called several time.

Copy link
Member

@fpistm fpistm left a 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

TimHandle.timer = DEFAULT_ETHERNET_TIMER;

/* Timer set to 1ms */
TimerHandleInit(&TimHandle, (uint16_t)(1000 - 1), ((uint32_t)(getTimerClkFreq(TIM6) / (1000000)) - 1));
Copy link
Member

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;
Copy link
Member

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 ?

Copy link
Author

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.

@ghost
Copy link
Author

ghost commented Oct 16, 2017

If this PR is validated, the register callback could be removed indeed.

@fpistm
Copy link
Member

fpistm commented Oct 18, 2017

please @fprwi6labs could you remove the register cb.
DEFAULT_ETHERNET_TIMER should also be added in the lwipot.h?

@ghost
Copy link
Author

ghost commented Oct 18, 2017

Please merge also:

@ghost
Copy link
Author

ghost commented Oct 19, 2017

Issue #4 fixed. Initialization sequence must be done only once.

@ghost ghost changed the title Fix issue #3 Fix issue #3 and #4 Oct 19, 2017
@ghost ghost requested a review from fpistm October 19, 2017 08:57
Copy link
Member

@fpistm fpistm left a 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.

fpr added 2 commits October 20, 2017 12:01
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
Signed-off-by: fpr <fabien.perroquin@wi6labs.com>
@ghost ghost requested a review from fpistm October 20, 2017 10:05
@fpistm fpistm merged commit d5a2142 into stm32duino:master Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ethernet instable, kind of deadlocking the controller; Nucleo F429ZI
1 participant