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

drivers/dose: calculate timeout based on symbol rate #16768

Merged
merged 1 commit into from Nov 10, 2021

Conversation

benpicco
Copy link
Contributor

Contribution description

A fixed timeout is either too long for high symbol rates or too short for low symbol rates.

To fix this, calculate the timeout based on the symbol rate.

For this, the old 5ms timeout is equivalent to 58 bytes being transmitted at 115200 baud (8 data bit + start & stop bit).

I rounded this to 50 bytes which should yield 4340 µs.

Testing procedure

2021-08-23 13:30:48,954 # main(): This is RIOT! (Version: 2021.10-devel-406-gdbd4d5-drivers/dose-timeout_bytes)
2021-08-23 13:33:21,675 # dose dose_setup(): mac addr a6:ed:29:ec:c3:f3
2021-08-23 13:33:21,678 # dose timeout set to 4340 µs

Issues/PRs references

@benpicco benpicco added Area: drivers Area: Device drivers Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Aug 23, 2021
@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label Aug 23, 2021
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 25, 2021
A fixed timeout is either too long for high symbol rates or too short
for low symbol rates.

To fix this, calculate the timeout based on the symbol rate.

For this, the old 5ms timeout is equivalent to 58 bytes being transmitted
at 115200 baud (8 data bit + start & stop bit).

I rounded this to 50 bytes which should yield 4340 µs.
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 25, 2021
@benpicco benpicco added this to Backlog / Proposals in RIOT Sprint Day via automation Nov 10, 2021
RIOT Sprint Day automation moved this from Backlog / Proposals to Waiting For Murdock Nov 10, 2021
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK. lgtm.

Feel free to amend a comment for "8bits + stop bit + start bit".

@benpicco benpicco merged commit 026d6cf into RIOT-OS:master Nov 10, 2021
RIOT Sprint Day automation moved this from Waiting For Murdock to Done Nov 10, 2021
@benpicco benpicco deleted the drivers/dose-timeout_bytes branch November 10, 2021 11:40
@fjmolinas fjmolinas added this to the Release 2022.01 milestone Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants