Skip to content
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

Split up pins.h to make pins more manageable #1416

Merged
merged 26 commits into from
Jan 28, 2015

Conversation

thinkyhead
Copy link
Member

Hopefully this is helpful to organization and future expansion….

Hopefully this is helpful to organization and future expansion….
MarlinFirmware#1405 includes some changes to pins.h for a 4th extruder. This commit
applies those changes. It also deals with a possible problem with
SENSITIVE_PINS.
There’s no need to ask users to uncomment Max Endstop pins when they
have them. These will be set to -1 later if the endstop option is
disabled.
@CONSULitAS
Copy link
Contributor

@MagoKimbra I Think this would be great. For languages_xxx.h, too. But have a look at sudar/Arduino-Makefile#249 and just google for .

It does not work now with Arduino. It would break support for the Arduino IDE.

There are discussions for years, but the collaborators of the Arduino project don't seem to see the point. :-(

If you have a way to realize it, please tell.

@CONSULitAS
Copy link
Contributor

@thinkyhead Thanks for the great "pins_K8200.h". I think it's the right way, because you can see how easy it is to add a new board if it's identical to an other.

And "pins_3Drag" shows how easy it is to add a board that is similar to an other.

@MagoKimbra
Copy link
Contributor

@CONSULitAS Yes i see... Ok!!!

Hopefully this is helpful to organization and future expansion….
There’s no need to ask users to uncomment Max Endstop pins when they
have them. These will be set to -1 later if the endstop option is
disabled.
@thinkyhead thinkyhead added Needs: More Data We need more data in order to proceed PR: Improvement labels Jan 27, 2015
thinkyhead and others added 10 commits January 27, 2015 14:26
Also fix analogInputToDigitalPin so it uses proper C hex notation
Hopefully this is helpful to organization and future expansion….
MarlinFirmware#1405 includes some changes to pins.h for a 4th extruder. This commit
applies those changes. It also deals with a possible problem with
SENSITIVE_PINS.
There’s no need to ask users to uncomment Max Endstop pins when they
have them. These will be set to -1 later if the endstop option is
disabled.
Also fix analogInputToDigitalPin so it uses proper C hex notation
…nto cleanup_pins

Remote has diverged, so pull
thinkyhead added a commit that referenced this pull request Jan 28, 2015
Split up pins.h to make pins more manageable
@thinkyhead thinkyhead merged commit 3475808 into MarlinFirmware:Development Jan 28, 2015
@thinkyhead thinkyhead removed the Needs: More Data We need more data in order to proceed label Jan 28, 2015
@thinkyhead thinkyhead mentioned this pull request Jan 28, 2015
@alexborro
Copy link
Contributor

It is nice, but all "pins_" files should be inside a folder "pins_mapping"... And the language files as well (may be "translation" folder).. The root folder is becoming a mess, too many files..

@bjmckenz
Copy link

+1 — however, the dir should be “config” and the files should be named “system.h” (e.g. “ramps_13_EFB.h”, “ultimaker2.h”).

I recommend “config” and not “pins” because I can see this evolving a bit. Can you imagine putting more things than pins there? I can. Given some of these are actual machines and some are motherboards, I see the machine people moving things like bed dimensions into the config files.

In other words, there are hardware features and software options. I’d like to group the feature-related things together, and keep the options (what a person tweaks) to a minimum so that they are easy to distinguish.

Admittedly the downside of this is that if a new feature or #define is added it must be spread out to all the config files.

Just a thought…

@alexborro
Copy link
Contributor

We can have different folders for different things.. Like "Pins_Mapping" for pins_*.h, "Machine_Specifics" for software configs related to specific machines and so one.. splitting things in folders are a good idea.

@thinkyhead
Copy link
Member Author

@alexborro @bjmckenz Subfolders are not supported by Arduino's compiler, or we'd be using them already.

@thinkyhead thinkyhead deleted the cleanup_pins branch February 1, 2015 05:13
@alexborro
Copy link
Contributor

Damn it.. What age do these arduino's guys live?
Em 01/02/2015 02:33, "Scott Lahteine" notifications@github.com escreveu:

@alexborro https://github.com/alexborro Subfolders are not supported by
Arduino's compiler.


Reply to this email directly or view it on GitHub
#1416 (comment)
.

@CONSULitAS
Copy link
Contributor

@alexborro To answer your question, have a look at this:

arduino/Arduino#1004
sudar/Arduino-Makefile#251
sudar/Arduino-Makefile#249

:-)))

CONSULitAS added a commit to CONSULitAS/Marlin-K8200 that referenced this pull request Feb 7, 2015
pins_3DRAG.h: Fixed Z_ENABLE_PIN after split up pins.h in MarlinFirmware#1416

* @tinkyhead 62 is wrong for K8200 and should be 63 for 3Drag, too
* @testers Could a 3Drag user please check? Thanks, @CONSULitAS

tested with my K8200, working now
@thinkyhead
Copy link
Member Author

@alexborro @MagoKimbra Ok, so yes I discovered we can move things into subfolders. But, we have to "pretend" they are libraries. Here's the trick.

  1. Make a libraries folder inside the Marlin folder.
  2. Make a MarlinPins folder inside Marlin/libraries.
  3. Move all the pins files into this folder.
  4. Rename pins.h to MarlinPins.h.
  5. Add #include <MarlinPins.h> to Marlin.ino and Marlin.pde.
  6. Replace #include "pins.h" to #include <MarlinPins.h> everywhere else.

I just did this with the pins and language files ("MarlinLanguage"), and it worked great.

It also needs some lines in the Makefile for command-line build....

VPATH += ./libraries/MarlinPins
VPATH += ./libraries/MarlinLanguage

@thinkyhead
Copy link
Member Author

#1537

@alexborro
Copy link
Contributor

I'm ok with such solution.
It is transparent to end user and make things more organized.
So far we can have:
Libraries/MarlinPins
Libraries/MarlinLanguages

And I think we can apply the same idea for thermistor tables as well.

Cheers.

Alex.

2015-02-24 4:18 GMT-03:00 Scott Lahteine notifications@github.com:

#1537 #1537


Reply to this email directly or view it on GitHub
#1416 (comment)
.

"Não é o mais forte da espécie que sobrevive, nem o mais inteligente. É
aquele que se adapta melhor as mudanças" ( Charles Darwin )

Alex Borro

@MagoKimbra
Copy link
Contributor

I tried to download the marlin with the libraries folder, but when i compile do it error because it can not find the libraries MarlinLanguage.h. I have Arduino IDE 1.6.0

@thinkyhead
Copy link
Member Author

@MagoKimbra Hmm, I'm not too surprised. I closed my PR for the time-being because I got stuck on building with the Makefile. But it was working for me in the IDE, both 1.5.2 and 1.0.5. I will download 1.6 and try it later!

@thinkyhead
Copy link
Member Author

I have a new update of temperature.cpp (etc.) pending with #1541 and that might behave differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants