-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
See PR #6889 for a better solution (AT90USB - use only Teensy pin numbers in pins_XXX.h files) #6896
See PR #6889 for a better solution (AT90USB - use only Teensy pin numbers in pins_XXX.h files) #6896
Conversation
pins_XXX.h files can now use only the Teensyduino pin numbering. This was done by by re-defining the FASTIO second level macros to translate pin numbers from Teensy to FASTIO. I've verified that the stepper motors respond correctly. pinsDebug.h needs more work more testing needed
* supported by the Teensy type IDEs the digitalRead and digitalWrite commands will | ||
* not work for these pins. They can only be used with the FASTIO commands. That's | ||
* OK since 46 is not used by any AT90USB board and pin 47 is only used as an endstop | ||
* input. |
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.
Excellent. Based on recent discussions and the improved notes in the code, I think we will be able to make a pretty decent article for the site explaining pins and boards.
#define E0_ENABLE_PIN 19 | ||
#define E0_STEP_PIN 34 | ||
#define E0_DIR_PIN 35 | ||
#define E0_ENABLE_PIN 13 |
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.
If these pins are now matching the ones from my PR #6889, we should try to use the pins from my PR instead, because I labeled them all with their port/pin numbers and did some other helpful formatting. Let's do a comparison and bring them into conjunction.
Wouldn't it be the same (only better) to simply assign the DIO macros according to the Teensy mapping? We just want to get rid of the "Marlin" mapping completely. In other words, get rid of this: #define DIO0_PIN PINA0
#define DIO0_RPORT PINA
#define DIO0_WPORT PORTA
#define DIO0_PWM NULL
#define DIO0_DDR DDRA
. . . …and use the "Teensy" numbers in the first place, as they seem to already correspond to the digital pin number and the numbering that this PR translates… #define DIO0_PIN PIND0
#define DIO0_RPORT PIND
#define DIO0_WPORT PORTD
#define DIO0_PWM NULL
#define DIO0_DDR DDRD
. . . The |
Closing this PR because @thinkyhead has a superior solution in PR #6889 |
pins_XXX.h files can now use only the Teensyduino pin numbering.
This was done by by re-defining the FASTIO second level macros to translate pin numbers from Teensy to FASTIO. Now READ(X_MIN_PIN) and digitalRead(X_MIN_PIN) will use the same port.
I've verified that the stepper motors respond correctly.
pinsDebug.h needs more work
More testing needed.
So far I've translated Teensylu and both Printrboards.