Skip to content
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

Fix timeout management in ROBUS protocol #484

Closed

Conversation

houkhouk
Copy link

@houkhouk houkhouk commented May 6, 2024

By submiting this PR, you agree with the associated license MIT) and with our Contributor License Agreement (CLA).

Before to begin

Thank you for contributing to the Luos project!

Before to begin, please follow these steps:

  • Ensure that this PR is not a duplicate.

Feel free to read the Luos contribution's guidelines and the documentation page to have more insight about how to contribute to Luos.

PR Description section

Description and dependencies

Please include here a summary of the changes and the related issue. List any dependencies that are required for this change.

Changes

Please choose the relevant options:

  • Bug fix (non-breaking change which fixes an issue)

Related issue(s)

Provide a list of the related issues that will be fixed by this PR.


WARNING: Do not edit the checklist below.


Developer section

  • [Documentation] is up to date with new feature
  • [Tests] are passed OK (non regression, new features & bug fixes)
  • [Code Quality] please check if:
    • Each function has a header (description, inputs, outputs)
    • Code is commented (particularly in hard to understand areas)
    • There are no new warnings that can be corrected
    • Commits policy is respected (constitancy commits, clear commits comments)

QA section

  • [Review] tests for new features have been reviewed
  • [Changelog] is up-to-date with expected tags
    🆕 Feature: [Feature] Description...
    🆕 Added: [Feature] Description...
    🆕 Changed: [Feature] Description...
    🛠️ Fix: [Feature] Description...

@nicolas-rabault nicolas-rabault self-assigned this May 14, 2024
@nicolas-rabault nicolas-rabault added this to the 3.1.0 milestone May 14, 2024
@nicolas-rabault nicolas-rabault linked an issue May 14, 2024 that may be closed by this pull request
@nicolas-rabault nicolas-rabault self-requested a review May 14, 2024 07:23
Copy link
Member

@nicolas-rabault nicolas-rabault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could remove the boolean parameter from your modified function. This would drastically reduce the number of modifications and improve code readability.
By modifying Robus this way you broke the compilation for all the other HAL. You should consider applying your modifications to the other HAL.


LL_TIM_SetAutoReload(ROBUS_TIMER, DEFAULT_TIMEOUT);
LL_TIM_SetCounter(ROBUS_TIMER, 0);
// HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, RESET);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove those "test" comments.

RobusHAL_ResetTimeout(DEFAULT_TIMEOUT);
RobusHAL_ResetTimeout(true, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you want to enable the timer at DEFAULT_TIMEOUT. Instead of 0 you could use DEFAULT_TIMEOUT to improve readability.
(This would allow you to remove the boolean parameters, see other review comment)

RobusHAL_ResetTimeout(0);
RobusHAL_ResetTimeout(false, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you just want to shut down the timer so putting the value to 0 makes sense. You could remove the boolean value and just check if the value is 0.

@nicolas-rabault nicolas-rabault deleted the branch Luos-io:fix/Gate_autoUpdate May 14, 2024 13:02
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.

[BUG] robus infinite collision condition still exist
2 participants