From 36ec29d4e85b19487c868287f09d2492eecc0274 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Thu, 14 Dec 2017 12:02:43 -0600 Subject: Documentation Updates (mcu.delay() and Design Guide) (#481) /docs/design_guide: added links to firmware build learning guides for SAMD21 & ESP8266. Changes were placed in the "Adding native modules" section, since that seemed to me the best place based on target audience. Updated documentation for `delay()` which fixes #243. --- docs/design_guide.rst | 7 +++++++ shared-bindings/microcontroller/__init__.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/design_guide.rst b/docs/design_guide.rst index 7d20a8261..8d3de3d69 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -416,6 +416,13 @@ live in ``shared-module``. If it is port specific then it should live in ``commo within the port's folder. In either case, the file and folder structure should mimic the structure in ``shared-bindings``. +To test your native modules or core enhancements, follow these Adafruit Learning Guides +for building local firmware to flash onto your device(s): + +`SAMD21 - Build Firmware Learning Guide `_ + +`ESP8266 - Build Firmware Learning Guide `_ + MicroPython compatibility -------------------------------------------------------------------------------- diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index d2567bd65..58ed876c2 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -71,7 +71,11 @@ //| .. method:: delay_us(delay) //| //| Dedicated delay method used for very short delays. **Do not** do long delays -//| because it will stall any concurrent code. +//| because this stops all other functions from completing. Think of this as an empty +//| ``while`` loop that runs for the specified ``(delay)`` time. If you have other +//| code or peripherals (e.g audio recording) that require specific timing or +//| processing while you are waiting, explore a different avenue such as using +//| `time.sleep()`. //| STATIC mp_obj_t mcu_delay_us(mp_obj_t delay_obj) { uint32_t delay = mp_obj_get_int(delay_obj); -- cgit v1.2.3