Skip to content

Commit 83c4be6

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into remove-pwmout-from-pulseio
2 parents 1ca8058 + 94ed5e0 commit 83c4be6

File tree

110 files changed

+2817
-2710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2817
-2710
lines changed

devices/ble_hci/common-hal/_bleio/PacketBuffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_
245245
bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle);
246246
if (connection) {
247247
return MIN(MIN(common_hal_bleio_connection_get_max_packet_length(connection),
248-
self->max_packet_size),
249-
self->characteristic->max_length);
248+
self->max_packet_size),
249+
self->characteristic->max_length);
250250
}
251251
}
252252
// There's no current connection, so we don't know the MTU, and

docs/design_guide.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,58 @@ Renders as:
292292
:param ~busio.I2C i2c_bus: The I2C bus the DS3231 is connected to.
293293
:param int address: The I2C address of the device. Defaults to :const:`0x40`
294294

295+
296+
Documenting Parameters
297+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298+
Although there are different ways to document class and functions definitions in Python,
299+
the following is the prevalent method of documenting parameters
300+
for CircuitPython libraries. When documenting class parameters you should use the
301+
following structure:
302+
303+
.. code-block:: sh
304+
305+
:param param_type param_name: Parameter_description
306+
307+
308+
param_type
309+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310+
The type of the parameter. This could be among other `int`, `float`, `str` `bool`, etc.
311+
To document an object in the CircuitPython domain, you need to include a ``~`` before the
312+
definition as shown in the following example:
313+
314+
.. code-block:: sh
315+
316+
:param ~busio.I2C i2c_bus: The I2C bus the DS3231 is connected to.
317+
318+
319+
To include references to CircuitPython modules, cookiecutter creates an entry in the
320+
intersphinx_mapping section in the ``conf.py`` file located within the ``docs`` directory.
321+
To add different types outside CircuitPython you need to include them in the intersphinx_mapping::
322+
323+
324+
intersphinx_mapping = {
325+
"python": ("https://docs.python.org/3.4", None),
326+
"BusDevice":("https://circuitpython.readthedocs.io/projects/busdevice/en/latest/", None,),
327+
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
328+
}
329+
330+
The intersphinx_mapping above includes references to Python, BusDevice and CircuitPython
331+
Documentation
332+
333+
334+
param_name
335+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
336+
Parameter name used in the class or method definition
337+
338+
339+
Parameter_description
340+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341+
Parameter description. When the parameter defaults to a particular value, it is good
342+
practice to include the default::
343+
344+
:param int pitch: Pitch value for the servo. Defaults to :const:`4500`
345+
346+
295347
Attributes
296348
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
297349

mpy-cross/main.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@ STATIC int compile_and_save(const char *file, const char *output_file, const cha
7676

7777
STATIC int usage(char **argv) {
7878
printf(
79-
"usage: %s [<opts>] [-X <implopt>] <input filename>\n"
80-
"Options:\n"
81-
"--version : show version information\n"
82-
"-o : output file for compiled bytecode (defaults to input with .mpy extension)\n"
83-
"-s : source filename to embed in the compiled bytecode (defaults to input file)\n"
84-
"-v : verbose (trace various operations); can be multiple\n"
85-
"-O[N] : apply bytecode optimizations of level N\n"
86-
"\n"
87-
"Target specific options:\n"
88-
"-msmall-int-bits=number : set the maximum bits used to encode a small-int\n"
89-
"-mno-unicode : don't support unicode in compiled strings\n"
90-
"-mcache-lookup-bc : cache map lookups in the bytecode\n"
91-
"-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv7m, xtensa\n"
92-
"\n"
93-
"Implementation specific options:\n", argv[0]
94-
);
79+
"usage: %s [<opts>] [-X <implopt>] <input filename>\n"
80+
"Options:\n"
81+
"--version : show version information\n"
82+
"-o : output file for compiled bytecode (defaults to input with .mpy extension)\n"
83+
"-s : source filename to embed in the compiled bytecode (defaults to input file)\n"
84+
"-v : verbose (trace various operations); can be multiple\n"
85+
"-O[N] : apply bytecode optimizations of level N\n"
86+
"\n"
87+
"Target specific options:\n"
88+
"-msmall-int-bits=number : set the maximum bits used to encode a small-int\n"
89+
"-mno-unicode : don't support unicode in compiled strings\n"
90+
"-mcache-lookup-bc : cache map lookups in the bytecode\n"
91+
"-march=<arch> : set architecture for native emitter; x86, x64, armv6, armv7m, xtensa\n"
92+
"\n"
93+
"Implementation specific options:\n", argv[0]
94+
);
9595
int impl_opts_cnt = 0;
9696
printf(
9797
" emit={bytecode,native,viper} -- set the default code emitter\n"

ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "shared-bindings/board/__init__.h"
22

33
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
4-
//{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
4+
// { MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
55
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA06) },
66
{ MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA07) },
77
};

ports/atmel-samd/boards/cp_sapling_m0_revb/mpconfigboard.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#define MICROPY_PORT_B (0)
88
#define MICROPY_PORT_C (0)
99

10-
#define IGNORE_PIN_PA04 1
11-
#define IGNORE_PIN_PA05 1
12-
#define IGNORE_PIN_PA06 1
10+
#define IGNORE_PIN_PA04 1
11+
#define IGNORE_PIN_PA05 1
12+
#define IGNORE_PIN_PA06 1
1313
#define IGNORE_PIN_PA12 1
1414
#define IGNORE_PIN_PA13 1
1515
#define IGNORE_PIN_PA20 1

ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LONGINT_IMPL = NONE
1515
CIRCUITPY_ANALOGIO = 0
1616
CIRCUITPY_MATH = 0
1717
CIRCUITPY_NEOPIXEL_WRITE = 0
18+
CIRCUITPY_PULSEIO = 1
1819
CIRCUITPY_ROTARYIO = 0
1920
CIRCUITPY_RTC = 0
2021
CIRCUITPY_SAMD = 0

0 commit comments

Comments
 (0)