-
-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Improve avr wait_us() #16879
Improve avr wait_us() #16879
Conversation
This reverts commit 3fb33b7.
Outside of correctness, do we actually care if |
I think it is very rare that we need to give a variable to wait_us. Frankly speaking, I think it is sufficient to specify only constants for wait_us. Nevertheless, if variables were allowed, people would expect them to be precise. EDIT: |
I think what zvecr is trying to get at is: is there an impact for the wait_us being more accurate? Eg, is there a specific gain or behavior correction that this introduces? |
If we are taking into account the overhead of loops at this lower level then is the consumer of the |
Description
The execution time of
wait_us()
has been made accurate.The test code is here
https://github.com/mtei/qmk_firmware/blob/3fb33b713ce97633a9d944ebb27ceeb609ab04ce/keyboards/helix/rev2/keymaps/five_rows/wait_test.c#L17-L58
Test Results (16MHz AVR)
* wait_us(variable): x=2000; wait_us(x)
* old version wait_us(variable): x=2000; wait_us(x)
Types of Changes
Checklist