-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fast IO access #240
base: main
Are you sure you want to change the base?
Fast IO access #240
Conversation
Firmware for this pull request: |
A few first-look comments:
|
Give me some time to think about (and understand ;) ) this
Yeah, I thought about this a longer time. Idea's are welcome.
Good point! Thanks and regards Ralf |
Thanks to you for trying to find even more improvements! OK, hoping to spare you some time by trying to be clearer: inline uint8_t digitalReadFast(uint8_t pinNr)
{
return (*portOutputRegister(digitalPinToPort(pinNr) & digitalPinToBitMask(pinNr)) ? HIGH : LOW;
} this way, e.g. Buttons would continue to use pin numbers without the need to store pin port and pin mask. About the Switching unused pins back to input is definitely a thing to recommend though. |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Firmware for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Board and firmware folder for this pull request: |
Description of changes
For each device with multiple accesses to I/O's the arduino functions
digitalread()
anddigitalWrite()
is replaced by direct port access to reduce the time each changed device needs.This will allow to increase the number of multiplexers while keeping the functionality of encoders and will give the possibility to implement encoders connected to multiplexers.
As this change will exceed the flash for the ProMicro, it will be only implemented for:
per compile flag and could be implemented for the Pico (not changed so far).
More description is available in issue #239
Fixes #239