Updated DNE Coding Standards (mediawiki)

Scott Lahteine 2017-04-26 19:22:55 -05:00
parent 93c7a1caae
commit 5933f0292a

@ -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.