Skip to content

Commit 093461e

Browse files
committed
Fixed indentation
1 parent deccdcc commit 093461e

File tree

4 files changed

+205
-205
lines changed

4 files changed

+205
-205
lines changed

shared-bindings/busio/I2C.c

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ STATIC mp_obj_t busio_i2c_make_new(const mp_obj_type_t *type, size_t n_args, con
8585
return (mp_obj_t)self;
8686
}
8787

88-
//| def deinit(self, ) -> Any:
89-
//| """Releases control of the underlying hardware so other classes can use it."""
90-
//| ...
88+
//| def deinit(self, ) -> Any:
89+
//| """Releases control of the underlying hardware so other classes can use it."""
90+
//| ...
9191
STATIC mp_obj_t busio_i2c_obj_deinit(mp_obj_t self_in) {
9292
busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in);
9393
common_hal_busio_i2c_deinit(self);
@@ -101,15 +101,15 @@ STATIC void check_for_deinit(busio_i2c_obj_t *self) {
101101
}
102102
}
103103

104-
//| def __enter__(self, ) -> Any:
105-
//| """No-op used in Context Managers."""
106-
//| ...
104+
//| def __enter__(self, ) -> Any:
105+
//| """No-op used in Context Managers."""
106+
//| ...
107107
// Provided by context manager helper.
108108

109-
//| def __exit__(self, ) -> Any:
110-
//| """Automatically deinitializes the hardware on context exit. See
111-
//| :ref:`lifetime-and-contextmanagers` for more info."""
112-
//| ...
109+
//| def __exit__(self, ) -> Any:
110+
//| """Automatically deinitializes the hardware on context exit. See
111+
//| :ref:`lifetime-and-contextmanagers` for more info."""
112+
//| ...
113113
STATIC mp_obj_t busio_i2c_obj___exit__(size_t n_args, const mp_obj_t *args) {
114114
(void)n_args;
115115
common_hal_busio_i2c_deinit(args[0]);
@@ -124,14 +124,14 @@ static void check_lock(busio_i2c_obj_t *self) {
124124
}
125125
}
126126

127-
//| def scan(self, ) -> Any:
127+
//| def scan(self, ) -> Any:
128128
//|
129-
//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a
130-
//| list of those that respond.
129+
//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a
130+
//| list of those that respond.
131131
//|
132-
//| :return: List of device ids on the I2C bus
133-
//| :rtype: list"""
134-
//| ...
132+
//| :return: List of device ids on the I2C bus
133+
//| :rtype: list"""
134+
//| ...
135135
STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) {
136136
busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in);
137137
check_for_deinit(self);
@@ -148,22 +148,22 @@ STATIC mp_obj_t busio_i2c_scan(mp_obj_t self_in) {
148148
}
149149
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_scan_obj, busio_i2c_scan);
150150

151-
//| def try_lock(self, ) -> Any:
152-
//| """Attempts to grab the I2C lock. Returns True on success.
151+
//| def try_lock(self, ) -> Any:
152+
//| """Attempts to grab the I2C lock. Returns True on success.
153153
//|
154-
//| :return: True when lock has been grabbed
155-
//| :rtype: bool"""
156-
//| ...
154+
//| :return: True when lock has been grabbed
155+
//| :rtype: bool"""
156+
//| ...
157157
STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) {
158158
busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in);
159159
check_for_deinit(self);
160160
return mp_obj_new_bool(common_hal_busio_i2c_try_lock(self));
161161
}
162162
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock);
163163

164-
//| def unlock(self, ) -> Any:
165-
//| """Releases the I2C lock."""
166-
//| ...
164+
//| def unlock(self, ) -> Any:
165+
//| """Releases the I2C lock."""
166+
//| ...
167167
STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) {
168168
busio_i2c_obj_t *self = MP_OBJ_TO_PTR(self_in);
169169
check_for_deinit(self);
@@ -172,20 +172,20 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) {
172172
}
173173
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock);
174174

175-
//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any:
176-
//| """Read into ``buffer`` from the slave specified by ``address``.
177-
//| The number of bytes read will be the length of ``buffer``.
178-
//| At least one byte must be read.
175+
//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> Any:
176+
//| """Read into ``buffer`` from the slave specified by ``address``.
177+
//| The number of bytes read will be the length of ``buffer``.
178+
//| At least one byte must be read.
179179
//|
180-
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
181-
//| as if ``buffer[start:end]``. This will not cause an allocation like
182-
//| ``buf[start:end]`` will so it saves memory.
180+
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
181+
//| as if ``buffer[start:end]``. This will not cause an allocation like
182+
//| ``buf[start:end]`` will so it saves memory.
183183
//|
184-
//| :param int address: 7-bit device address
185-
//| :param bytearray buffer: buffer to write into
186-
//| :param int start: Index to start writing at
187-
//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``"""
188-
//| ...
184+
//| :param int address: 7-bit device address
185+
//| :param bytearray buffer: buffer to write into
186+
//| :param int start: Index to start writing at
187+
//| :param int end: Index to write up to but not include. Defaults to ``len(buffer)``"""
188+
//| ...
189189
// Shared arg parsing for readfrom_into and writeto_then_readfrom.
190190
STATIC void readfrom(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end) {
191191
mp_buffer_info_t bufinfo;
@@ -223,26 +223,26 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
223223
}
224224
MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into);
225225

226-
//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any:
227-
//| """Write the bytes from ``buffer`` to the slave specified by ``address``.
228-
//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
229-
//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
230-
//| repeated start before a read.
226+
//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any:
227+
//| """Write the bytes from ``buffer`` to the slave specified by ``address``.
228+
//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
229+
//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
230+
//| repeated start before a read.
231231
//|
232-
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
233-
//| as if ``buffer[start:end]``. This will not cause an allocation like
234-
//| ``buffer[start:end]`` will so it saves memory.
232+
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
233+
//| as if ``buffer[start:end]``. This will not cause an allocation like
234+
//| ``buffer[start:end]`` will so it saves memory.
235235
//|
236-
//| Writing a buffer or slice of length zero is permitted, as it can be used
237-
//| to poll for the existence of a device.
236+
//| Writing a buffer or slice of length zero is permitted, as it can be used
237+
//| to poll for the existence of a device.
238238
//|
239-
//| :param int address: 7-bit device address
240-
//| :param bytearray buffer: buffer containing the bytes to write
241-
//| :param int start: Index to start writing from
242-
//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``
243-
//| :param bool stop: If true, output an I2C stop condition after the buffer is written.
244-
//| Deprecated. Will be removed in 6.x and act as stop=True."""
245-
//| ...
239+
//| :param int address: 7-bit device address
240+
//| :param bytearray buffer: buffer containing the bytes to write
241+
//| :param int start: Index to start writing from
242+
//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``
243+
//| :param bool stop: If true, output an I2C stop condition after the buffer is written.
244+
//| Deprecated. Will be removed in 6.x and act as stop=True."""
245+
//| ...
246246
// Shared arg parsing for writeto and writeto_then_readfrom.
247247
STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, int32_t start, mp_int_t end, bool stop) {
248248
// get the buffer to write the data from
@@ -281,23 +281,23 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma
281281
}
282282
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
283283

284-
//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any:
285-
//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop
286-
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
287-
//| ``in_buffer`` can be the same buffer because they are used sequentially.
284+
//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any:
285+
//| """Write the bytes from ``out_buffer`` to the slave specified by ``address``, generate no stop
286+
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
287+
//| ``in_buffer`` can be the same buffer because they are used sequentially.
288288
//|
289-
//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
290-
//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]``
291-
//| will so it saves memory.
289+
//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
290+
//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]``
291+
//| will so it saves memory.
292292
//|
293-
//| :param int address: 7-bit device address
294-
//| :param bytearray out_buffer: buffer containing the bytes to write
295-
//| :param bytearray in_buffer: buffer to write into
296-
//| :param int out_start: Index to start writing from
297-
//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)``
298-
//| :param int in_start: Index to start writing at
299-
//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``"""
300-
//| ...
293+
//| :param int address: 7-bit device address
294+
//| :param bytearray out_buffer: buffer containing the bytes to write
295+
//| :param bytearray in_buffer: buffer to write into
296+
//| :param int out_start: Index to start writing from
297+
//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)``
298+
//| :param int in_start: Index to start writing at
299+
//| :param int in_end: Index to write up to but not include. Defaults to ``len(buffer)``"""
300+
//| ...
301301
STATIC mp_obj_t busio_i2c_writeto_then_readfrom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
302302
enum { ARG_address, ARG_out_buffer, ARG_in_buffer, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end };
303303
static const mp_arg_t allowed_args[] = {

shared-bindings/busio/OneWire.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args,
7979
return MP_OBJ_FROM_PTR(self);
8080
}
8181

82-
//| def deinit(self, ) -> Any:
83-
//| """Deinitialize the OneWire bus and release any hardware resources for reuse."""
84-
//| ...
82+
//| def deinit(self, ) -> Any:
83+
//| """Deinitialize the OneWire bus and release any hardware resources for reuse."""
84+
//| ...
8585
STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) {
8686
busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in);
8787
common_hal_busio_onewire_deinit(self);
@@ -95,28 +95,28 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) {
9595
}
9696
}
9797

98-
//| def __enter__(self, ) -> Any:
99-
//| """No-op used by Context Managers."""
100-
//| ...
98+
//| def __enter__(self, ) -> Any:
99+
//| """No-op used by Context Managers."""
100+
//| ...
101101
// Provided by context manager helper.
102102

103-
//| def __exit__(self, ) -> Any:
104-
//| """Automatically deinitializes the hardware when exiting a context. See
105-
//| :ref:`lifetime-and-contextmanagers` for more info."""
106-
//| ...
103+
//| def __exit__(self, ) -> Any:
104+
//| """Automatically deinitializes the hardware when exiting a context. See
105+
//| :ref:`lifetime-and-contextmanagers` for more info."""
106+
//| ...
107107
STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) {
108108
(void)n_args;
109109
common_hal_busio_onewire_deinit(args[0]);
110110
return mp_const_none;
111111
}
112112
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__);
113113

114-
//| def reset(self, ) -> Any:
115-
//| """Reset the OneWire bus and read presence
114+
//| def reset(self, ) -> Any:
115+
//| """Reset the OneWire bus and read presence
116116
//|
117-
//| :returns: False when at least one device is present
118-
//| :rtype: bool"""
119-
//| ...
117+
//| :returns: False when at least one device is present
118+
//| :rtype: bool"""
119+
//| ...
120120
STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) {
121121
busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in);
122122
check_for_deinit(self);
@@ -125,12 +125,12 @@ STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) {
125125
}
126126
MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset);
127127

128-
//| def read_bit(self, ) -> Any:
129-
//| """Read in a bit
128+
//| def read_bit(self, ) -> Any:
129+
//| """Read in a bit
130130
//|
131-
//| :returns: bit state read
132-
//| :rtype: bool"""
133-
//| ...
131+
//| :returns: bit state read
132+
//| :rtype: bool"""
133+
//| ...
134134
STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) {
135135
busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in);
136136
check_for_deinit(self);
@@ -139,9 +139,9 @@ STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) {
139139
}
140140
MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit);
141141

142-
//| def write_bit(self, value: Any) -> Any:
143-
//| """Write out a bit based on value."""
144-
//| ...
142+
//| def write_bit(self, value: Any) -> Any:
143+
//| """Write out a bit based on value."""
144+
//| ...
145145
STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) {
146146
busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in);
147147
check_for_deinit(self);

0 commit comments

Comments
 (0)