summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorfoamyguy <foamyguy@gmail.com>2020-11-08 18:32:15 -0600
committerGitHub <noreply@github.com>2020-11-08 18:32:15 -0600
commitcf21c4da601e00a614efd8ade774a0c8e5444c64 (patch)
tree118a157edbc1884f502de8e9e26f79d178ed8c9a /docs
parent7611e71a1bc49bcb426e0854519d5143eb262a17 (diff)
parenteec9821fdc19ca81c2d0811a6b6c5909a54b8c81 (diff)
Merge pull request #1 from adafruit/main
merge from adafruit
Diffstat (limited to 'docs')
-rw-r--r--docs/design_guide.rst13
-rw-r--r--docs/supported_ports.rst1
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/design_guide.rst b/docs/design_guide.rst
index 2d52e988b..cc2a3b296 100644
--- a/docs/design_guide.rst
+++ b/docs/design_guide.rst
@@ -485,6 +485,19 @@ struct.pack
Use `struct.pack_into` instead of `struct.pack`.
+Use of MicroPython ``const()``
+--------------------------------------------------------------------------------
+The MicroPython ``const()`` feature, as discussed in `this forum post
+<https://forum.micropython.org/viewtopic.php?t=450>`_, and in `this issue thread
+<https://github.com/micropython/micropython/issues/573>`_, provides some
+optimizations that can be useful on smaller, memory constrained devices. However,
+when using ``const()``, keep in mind these general guide lines:
+
+- Always use via an import, ex: ``from micropython import const``
+- Limit use to global (module level) variables only.
+- If user will not need access to variable, prefix name with a leading
+ underscore, ex: ``_SOME_CONST``.
+
Sensor properties and units
--------------------------------------------------------------------------------
diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst
index 09571afb6..e74067e28 100644
--- a/docs/supported_ports.rst
+++ b/docs/supported_ports.rst
@@ -17,3 +17,4 @@ is limited.
../ports/mimxrt10xx/README
../ports/nrf/README
../ports/stm/README
+ ../ports/esp32s2/README