atmel-samd: Fix a tick hang when we hit the exact timing we're going for#771
atmel-samd: Fix a tick hang when we hit the exact timing we're going for#771tannewt wants to merge 1 commit into
Conversation
…for. The SysTick interrupt happens when the value is 0 so its never readable when 0 and interrupts are enabled.
|
@tannewt Won't this ignore any delay < 1000 if it happens to fit in before the next tick. say us = 50 and us_between ticks is >50 then this will just return. |
|
sorry - it will just ignore a delay that happens to meet the criterion us=us_between_ticks -- may happen, may not. |
|
If this is not urgent, I will combine it with #765 and submit it tonight. |
|
(@tannewt and I are sitting next to each other and discussing this.) |
|
I tried to deal with that in #765. I think it can handle this with a minor change. Or we can just close it and start over |
|
More time to write now.. In #765 I think I took care of the issue with the large negative numbers and decoupled tick_delay from ticks_ms so it does not care if interrupts are enabled or not. I you think this is a good approach, I think I can deal with the new case raised here, but if you prefer to just scrap it and start over, that is fine with me. |
|
@jerryneedell I hadn't read the #765 code. Yes, please try this fix as well, if you have a good way to test. Thanks! |
|
@jerryneedell Can you rename |
|
NP - I'll try to come up with a better version tonight or tomorrow. I can add the check to see if interrupt are enabled that we also talked about in that PR. |
|
I think the DHT is a good test since it uses pulseio and tick_delay. I have been using that for the testing so far. |
|
Closing in favor of #765 |
The SysTick interrupt happens when the value is 0 so its never
readable when 0 and interrupts are enabled.