File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,19 @@ struct.pack
448
448
449
449
Use `struct.pack_into ` instead of `struct.pack `.
450
450
451
+ Use of MicroPython `const() `
452
+ --------------------------------------------------------------------------------
453
+ The MicroPython `const() ` feature, as discussed in `this forum post
454
+ <https://forum.micropython.org/viewtopic.php?t=450> `_, and in `this issue thread
455
+ <https://github.com/micropython/micropython/issues/573> `_, provides some
456
+ optimizations that can be useful on smaller, memory constrained devices. However,
457
+ when using `const() `, keep in mind these general guide lines:
458
+
459
+ - Always use via an import, ex: `from micropython import const `
460
+ - Limit use to global (module level) variables only.
461
+ - If user will not need access to variable, prefix name with a leading
462
+ underscore, ex: `_SOME_CONST `.
463
+
451
464
Sensor properties and units
452
465
--------------------------------------------------------------------------------
453
466
You can’t perform that action at this time.
0 commit comments