Skip to content

Commit c3897d0

Browse files
committed
Fixed whitespace in analogio
1 parent 724dcda commit c3897d0

File tree

2 files changed

+59
-60
lines changed

2 files changed

+59
-60
lines changed

shared-bindings/analogio/AnalogIn.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@
3737
#include "shared-bindings/util.h"
3838

3939
//|class AnalogIn:
40-
//| """:class:`AnalogIn` -- read analog voltage
41-
//| ============================================
40+
//|""":class:`AnalogIn` -- read analog voltage
41+
//|============================================
4242
//|
43-
//| Usage::
43+
//|Usage::
4444
//|
45-
//| import analogio
46-
//| from board import *
45+
//|import analogio
46+
//|from board import *
4747
//|
48-
//| adc = analogio.AnalogIn(A1)
49-
//| val = adc.value"""
48+
//|adc = analogio.AnalogIn(A1)
49+
//|val = adc.value"""
5050
//|
51-
//| def __init__(self, pin: microcontroller.Pin):
51+
//|def __init__(self, pin: microcontroller.Pin):
5252
//|
53-
//| """Use the AnalogIn on the given pin. The reference voltage varies by
54-
//| platform so use ``reference_voltage`` to read the configured setting.
53+
//|"""Use the AnalogIn on the given pin. The reference voltage varies by
54+
//|platform so use ``reference_voltage`` to read the configured setting.
5555
//|
56-
//| :param ~microcontroller.Pin pin: the pin to read from"""
57-
//| ...
56+
//|:param ~microcontroller.Pin pin: the pin to read from"""
57+
//|...
5858
STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type,
5959
mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
6060
// check number of arguments
@@ -70,9 +70,9 @@ STATIC mp_obj_t analogio_analogin_make_new(const mp_obj_type_t *type,
7070
return MP_OBJ_FROM_PTR(self);
7171
}
7272

73-
//| def deinit(self, ) -> Any:
74-
//| """Turn off the AnalogIn and release the pin for other use."""
75-
//| ...
73+
//|def deinit(self, ) -> Any:
74+
//|"""Turn off the AnalogIn and release the pin for other use."""
75+
//|...
7676
STATIC mp_obj_t analogio_analogin_deinit(mp_obj_t self_in) {
7777
analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in);
7878
common_hal_analogio_analogin_deinit(self);
@@ -85,28 +85,28 @@ STATIC void check_for_deinit(analogio_analogin_obj_t *self) {
8585
raise_deinited_error();
8686
}
8787
}
88-
//| def __enter__(self, ) -> Any:
89-
//| """No-op used by Context Managers."""
90-
//| ...
88+
//|def __enter__(self, ) -> Any:
89+
//|"""No-op used by Context Managers."""
90+
//|...
9191
// Provided by context manager helper.
9292

93-
//| def __exit__(self, ) -> Any:
94-
//| """Automatically deinitializes the hardware when exiting a context. See
95-
//| :ref:`lifetime-and-contextmanagers` for more info."""
96-
//| ...
93+
//|def __exit__(self, ) -> Any:
94+
//|"Automatically deinitializes the hardware when exiting a context. See
95+
//|:ref:`lifetime-and-contextmanagers` for more info."""
96+
//|...
9797
STATIC mp_obj_t analogio_analogin___exit__(size_t n_args, const mp_obj_t *args) {
9898
(void)n_args;
9999
common_hal_analogio_analogin_deinit(args[0]);
100100
return mp_const_none;
101101
}
102102
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogin___exit___obj, 4, 4, analogio_analogin___exit__);
103103

104-
//| value: Any =
105-
//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only)
104+
//|value: Any =
105+
//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (read-only)
106106
//|
107-
//| Even if the underlying analog to digital converter (ADC) is lower
108-
//| resolution, the value is 16-bit."""
109-
//| ...
107+
//|Even if the underlying analog to digital converter (ADC) is lower
108+
//|resolution, the value is 16-bit."""
109+
//|...
110110
STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) {
111111
analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in);
112112
check_for_deinit(self);
@@ -121,10 +121,10 @@ const mp_obj_property_t analogio_analogin_value_obj = {
121121
(mp_obj_t)&mp_const_none_obj},
122122
};
123123

124-
//| reference_voltage: Any =
125-
//| """The maximum voltage measurable (also known as the reference voltage) as a
126-
//| `float` in Volts."""
127-
//| ...
124+
//|reference_voltage: Any =
125+
//|"""The maximum voltage measurable (also known as the reference voltage) as a
126+
//|`float` in Volts."""
127+
//|...
128128
STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) {
129129
analogio_analogin_obj_t *self = MP_OBJ_TO_PTR(self_in);
130130
check_for_deinit(self);

shared-bindings/analogio/AnalogOut.c

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,25 @@
3737
#include "supervisor/shared/translate.h"
3838

3939
//|class AnalogOut:
40-
//| """.. currentmodule:: analogio
40+
//|""".. currentmodule:: analogio
4141
//|
42-
//| :class:`AnalogOut` -- output analog voltage
43-
//| ============================================
42+
//|:class:`AnalogOut` -- output analog voltage
43+
//|============================================
4444
//|
45-
//| The AnalogOut is used to output analog values (a specific voltage).
45+
//|The AnalogOut is used to output analog values (a specific voltage).
4646
//|
47-
//| Example usage::
47+
//|Example usage::
4848
//|
49-
//| import analogio
50-
//| from microcontroller import pin
49+
//|import analogio
50+
//|from microcontroller import pin
5151
//|
52-
//| dac = analogio.AnalogOut(pin.PA02) # output on pin PA02
53-
//| dac.value = 32768 # makes PA02 1.65V"""
54-
//| def __init__(self, pin: microcontroller.Pin):
52+
//|dac = analogio.AnalogOut(pin.PA02) # output on pin PA02
53+
//|dac.value = 32768 # makes PA02 1.65V"""
54+
//|def __init__(self, pin: microcontroller.Pin):
55+
//|"""Use the AnalogOut on the given pin.
5556
//|
56-
//| """Use the AnalogOut on the given pin.
57-
//|
58-
//| :param ~microcontroller.Pin pin: the pin to output to"""
59-
//| ...
57+
//|:param ~microcontroller.Pin pin: the pin to output to"""
58+
//|...
6059
STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
6160
// check arguments
6261
mp_arg_check_num(n_args, kw_args, 1, 1, false);
@@ -70,9 +69,9 @@ STATIC mp_obj_t analogio_analogout_make_new(const mp_obj_type_t *type, mp_uint_t
7069
return MP_OBJ_FROM_PTR(self);
7170
}
7271

73-
//| def deinit(self, ) -> Any:
74-
//| """Turn off the AnalogOut and release the pin for other use."""
75-
//| ...
72+
//|def deinit(self, ) -> Any:
73+
//|"""Turn off the AnalogOut and release the pin for other use."""
74+
//|...
7675
STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) {
7776
analogio_analogout_obj_t *self = self_in;
7877

@@ -82,28 +81,28 @@ STATIC mp_obj_t analogio_analogout_deinit(mp_obj_t self_in) {
8281
}
8382
STATIC MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogout_deinit_obj, analogio_analogout_deinit);
8483

85-
//| def __enter__(self, ) -> Any:
86-
//| """No-op used by Context Managers."""
87-
//| ...
84+
//|def __enter__(self, ) -> Any:
85+
//|"""No-op used by Context Managers."""
86+
//|...
8887
// Provided by context manager helper.
8988

90-
//| def __exit__(self, ) -> Any:
91-
//| """Automatically deinitializes the hardware when exiting a context. See
92-
//| :ref:`lifetime-and-contextmanagers` for more info."""
93-
//| ...
89+
//|def __exit__(self, ) -> Any:
90+
//|"""Automatically deinitializes the hardware when exiting a context. See
91+
//|:ref:`lifetime-and-contextmanagers` for more info."""
92+
//|...
9493
STATIC mp_obj_t analogio_analogout___exit__(size_t n_args, const mp_obj_t *args) {
9594
(void)n_args;
9695
common_hal_analogio_analogout_deinit(args[0]);
9796
return mp_const_none;
9897
}
9998
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogio_analogout___exit___obj, 4, 4, analogio_analogout___exit__);
10099

101-
//| value: Any =
102-
//| """The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only)
100+
//|value: Any =
101+
//|"""The value on the analog pin between 0 and 65535 inclusive (16-bit). (write-only)
103102
//|
104-
//| Even if the underlying digital to analog converter (DAC) is lower
105-
//| resolution, the value is 16-bit."""
106-
//| ...
103+
//|Even if the underlying digital to analog converter (DAC) is lower
104+
//|resolution, the value is 16-bit."""
105+
//|...
107106
STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t value) {
108107
analogio_analogout_obj_t *self = MP_OBJ_TO_PTR(self_in);
109108
if (common_hal_analogio_analogout_deinited(self)) {

0 commit comments

Comments
 (0)