-
Notifications
You must be signed in to change notification settings - Fork 2.1k
tests/xtimer_usleep: improved test, added pin toggle #8865
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,86 @@ | ||
# xtimer_usleep test application | ||
|
||
This test tests `xtimer_usleep()` both against the timings of | ||
`xtimer_now_usec()` and by providing capabilities to compare against an external | ||
timer. | ||
This test tests `xtimer_usleep()` against the timings of `xtimer_now_usec()` | ||
and by comparing the incoming values with the test hosts time. | ||
|
||
The sleep times can be probed with a oscilloscope at a pin if `SLEEP_PIN` is set | ||
and the respective gpio `SLEEP_PORT` is defined in the makefile, the port | ||
information can be found in the enum in `cpu/include/periph_cpu.h`. | ||
|
||
``` | ||
FEATURES_REQUIRED += periph_gpio | ||
CFLAGS += -DSLEEP_PIN=7 | ||
CFLAGS += -DSLEEP_PORT=PORT_F | ||
``` | ||
|
||
## Usage | ||
Executed from the project directory | ||
``` | ||
make BOARD=<Board Name> flash test | ||
``` | ||
|
||
### Expected result running | ||
``` | ||
XXX-XX-XX XX:XX:XX,XXX - INFO # Connect to serial port /dev/ttyACM0 | ||
Welcome to pyterm! | ||
Type '/exit' to exit. | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # main(): This is RIOT! (Version: XXX ) | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Running test 5 times with 7 distinct sleep times | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Please hit any key and then ENTER to continue | ||
a | ||
a | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10232 us (expected: 10000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50232 us (expected: 50000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10464 us (expected: 10234 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 57008 us (expected: 56780 us) Offset: 228 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 12352 us (expected: 12122 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 98992 us (expected: 98765 us) Offset: 227 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 75232 us (expected: 75000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10232 us (expected: 10000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50224 us (expected: 50000 us) Offset: 224 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10464 us (expected: 10234 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 57008 us (expected: 56780 us) Offset: 228 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 12352 us (expected: 12122 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 98992 us (expected: 98765 us) Offset: 227 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 75232 us (expected: 75000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10232 us (expected: 10000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50232 us (expected: 50000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10456 us (expected: 10234 us) Offset: 222 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 57008 us (expected: 56780 us) Offset: 228 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 12352 us (expected: 12122 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 98992 us (expected: 98765 us) Offset: 227 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 75232 us (expected: 75000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10232 us (expected: 10000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50232 us (expected: 50000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10456 us (expected: 10234 us) Offset: 222 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 57008 us (expected: 56780 us) Offset: 228 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 12352 us (expected: 12122 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 98992 us (expected: 98765 us) Offset: 227 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 75232 us (expected: 75000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10232 us (expected: 10000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50232 us (expected: 50000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10464 us (expected: 10234 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 57008 us (expected: 56780 us) Offset: 228 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 12352 us (expected: 12122 us) Offset: 230 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 98992 us (expected: 98765 us) Offset: 227 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 75224 us (expected: 75000 us) Offset: 224 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Test ran for 2056976 us | ||
``` | ||
|
||
### On Error with pyterm | ||
``` | ||
make flash test | ||
XXX-XX-XX XX:XX:XX,XXX - INFO # Connect to serial port /dev/ttyACM0 | ||
Welcome to pyterm! | ||
Type '/exit' to exit. | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # main(): This is RIOT! (XXX) | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Running test 5 times with 7 distinct sleep times | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Please hit any key and then ENTER to continue | ||
a | ||
a | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 10224 us (expected: 10000 us) Offset: 224 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 50232 us (expected: 50000 us) Offset: 232 us | ||
XXXX-XX-XX XX:XX:XX,XXX - INFO # Slept for 1464 us (expected: 1234 us) Offset: 230 us | ||
Invalid timeout 1464 ,expected 1172 < 1234 < 1295 | ||
Host max error 61 | ||
error 291 | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you add just here
TEST_ON_CI_WHITELIST += all