diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-07 14:39:12 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-07 14:39:12 -0700 |
| commit | 714521a4c7a6814c365c061bcf967c4c45692e3d (patch) | |
| tree | c490c22fd15137be6b7def7311da9da0aef3457d /shared-bindings/audioio | |
| parent | c5e515b8fe38a346125265fcebb86f857f29e053 (diff) | |
shared-bindings: Update docs to remove with statements from examples but add more detail to the design guide about their use.
Diffstat (limited to 'shared-bindings/audioio')
| -rw-r--r-- | shared-bindings/audioio/AudioOut.c | 11 | ||||
| -rw-r--r-- | shared-bindings/audioio/__init__.c | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index a765994d5..b47652104 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -66,10 +66,10 @@ //| for i in range(length): //| b[i] = int(math.sin(math.pi * 2 * i / 18) * (2 ** 15) + 2 ** 15) //| -//| with audioio.AudioOut(board.SPEAKER, sin_wave) as sample: -//| sample.play(loop=True) -//| time.sleep(1) -//| sample.stop() +//| sample = audioio.AudioOut(board.SPEAKER, sin_wave) +//| sample.play(loop=True) +//| time.sleep(1) +//| sample.stop() //| //| Playing a wave file from flash:: //| @@ -136,7 +136,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_deinit_obj, audioio_audioout_d //| .. method:: __exit__() //| -//| Automatically deinitializes the hardware when exiting a context. +//| Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info. //| STATIC mp_obj_t audioio_audioout_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index 3e831a171..07305a45a 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -49,9 +49,10 @@ //| //| AudioOut //| -//| All libraries change hardware state and should be deinitialized when they -//| are no longer needed. To do so, either call :py:meth:`!deinit` or use a -//| context manager. +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. //| STATIC const mp_rom_map_elem_t audioio_module_globals_table[] = { |
