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

Configuration overrides from defaults + .gitignore #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carneeki
Copy link

This PR permits the Configuration.h file to be a set of default options and a separate file, Configuration_overrides.h to act as user-specific changes to the defaults.

This has several benefits:

  1. We can .gitignore the user file such that they can pull from the repo / copy+paste config files between versions easily without needing to worry about merge.
  2. When troubleshooting, we can simply ask for the override file to see the differences between stock and the user's configuration without needing to run through diffs.

To use the override, I personally have a metric lathe with a 2mm pitch lead screw, so Configuration.h file remains unchanged, and my override looks as follows:

#ifndef __CONFIGURATION_OVERRIDES_H
#define __CONFIGURATION_OVERRIDES_H

////////////////////////////////////////////////////////////////////////
// Place your configuration below
////////////////////////////////////////////////////////////////////////

#undef LEADSCREW_TPI
#define LEADSCREW_HMM 200

#undef STEPPER_MICROSTEPS // this is to squelch a warning in CCS, it may not be required, I don't know
#define STEPPER_MICROSTEPS 2

////////////////////////////////////////////////////////////////////////
// Place your configuration above
////////////////////////////////////////////////////////////////////////

#endif // __CONFIGURATION_OVERRIDES_H

@braddr
Copy link

braddr commented Mar 1, 2023

I'm a fan of this style. It makes it harder to check in unintended changes accidentally and also keeps it easy to keep track of what's changed from the default values. I'd vote to merge this PR.

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

Successfully merging this pull request may close these issues.

None yet

2 participants