Updated DNE Coding Standards (mediawiki)
parent
93c7a1caae
commit
5933f0292a
1 changed files with 1 additions and 0 deletions
|
|
@ -107,6 +107,7 @@ Marlin is written in C/C++ and must be able to compile with the supplied Makefil
|
|||
* Use <code>#if ENABLED(FEATURE_NAME)</code> / <code>#endif</code> to compile enabled features. (Using these macros allows features to be set externally.)
|
||||
* Use <code>#if DISABLED(FEATURE_NAME)</code> / <code>#endif</code> to compile disabled features. (Using these macros allows features to be set externally.)
|
||||
* Use <code>#define</code> macros to avoid repeating boilerplate code.<br />Consider both readability and maintainability.
|
||||
* Label <code>#endif</code> with the opening <code>#if</code> condition(s) if the block is over ~15 lines. Make the label compact. For example, <code>#endif // SDSUPPORT || ULTRALCD</code>.
|
||||
|
||||
=== Adding a New Feature ===
|
||||
Since Marlin is an Arduino firmware and not a desktop application, much care has been taken to keep code size at a minimum, and to avoid using any features that may overtax the hardware, including demanding math operations. New features should try to conserve the limited resources available and allocate a fixed amount of memory (apart from <code>auto</code> variables) to do their work.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue