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
test/xtimer hang: separate debug pins #10397
test/xtimer hang: separate debug pins #10397
Conversation
2264f71
to
468b5a7
Compare
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.
Hi Josar, some questions came up while reading your code, and trying to understand it. :)
tests/xtimer_hang/main.c
Outdated
#if defined(WORKER_THREAD_PIN) | ||
gpio_t worker_pin = WORKER_THREAD_PIN; | ||
gpio_init(worker_pin, GPIO_OUT); | ||
#if defined(WORKER_THREAD_PIN_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.
You are using the pins only when both are defined (see line 60). Why don't you require the same condition for initialization?
Also, each gpio is initialized twice.
tests/xtimer_hang/main.c
Outdated
gpio_t worker_pin_1 = WORKER_THREAD_PIN_1; | ||
gpio_init(worker_pin_1, GPIO_OUT); | ||
#endif | ||
#if defined(WORKER_THREAD_PIN_2) |
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.
Same as line 49
@@ -65,8 +79,8 @@ int main(void) | |||
#endif | |||
|
|||
LOG_DEBUG("[INIT]\n"); | |||
uint32_t sleep_timer1 = 1000; | |||
uint32_t sleep_timer2 = 1100; | |||
uint32_t sleep_timer1 = TEST_SLEEP_TIME_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.
Thumbs up for eliminating literal numbers. :-)
tests/xtimer_hang/main.c
Outdated
|
||
while (1) { | ||
#if defined(WORKER_THREAD_PIN_1) && defined(WORKER_THREAD_PIN_2) | ||
if (*(uint32_t *)(arg) == TEST_SLEEP_TIME_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.
I think a switch case might be a cleaner approach here.
fc59214
to
f363896
Compare
f363896
to
43cfc1d
Compare
@A-Paul i pushed an updated Version. |
@A-Paul any time to have a second look? |
@A-Paul still no Time? @haukepetersen maybe you? |
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.
Hi @Josar. Happy new year and sorry for you shouting in the desert.
I have looked into your changes give a "pre approval" now. I will do some testing with a scope on HW the next days.
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.
Running test on arduino-mega2560 and samd21-xpro with a scope was successful.
Merging when Murdock is O.K.
Hi @Josar, please squash. |
43cfc1d
to
9627d65
Compare
@A-Paul sqaushed and rebased. |
Previously one pin was used for both slacker threads. For better debugging seperating the threads to use one pin each is better.
9627d65
to
254d25f
Compare
Previously one pin was used for both slacker threads.
For better debugging seperating the threads to use one pin each is better.