Skip to content

Commit 7c84581

Browse files
committed
Merge branch 'main' into ap
2 parents a1e2afa + 5ef9b10 commit 7c84581

File tree

411 files changed

+11117
-5386
lines changed

Some content is hidden

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

411 files changed

+11117
-5386
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ jobs:
209209
- "clue_nrf52840_express"
210210
- "cp32-m4"
211211
- "cp_sapling_m0"
212+
- "cp_sapling_m0_revb"
212213
- "cp_sapling_m0_spiflash"
213214
- "datalore_ip_m4"
214215
- "datum_distance"
@@ -498,7 +499,7 @@ jobs:
498499
id: idf-cache
499500
with:
500501
path: ${{ github.workspace }}/.idf_tools
501-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210415
502+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210422
502503
- name: Clone IDF submodules
503504
run: |
504505
(cd $IDF_PATH && git submodule update --init)

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git
114114
[submodule "extmod/ulab"]
115115
path = extmod/ulab
116-
url = https://github.com/v923z/micropython-ulab
116+
url = https://github.com/adafruit/circuitpython-ulab
117117
[submodule "frozen/Adafruit_CircuitPython_ESP32SPI"]
118118
path = frozen/Adafruit_CircuitPython_ESP32SPI
119119
url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013, 2014 Damien P. George
3+
Copyright (c) 2013-2019 Damien P. George
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,10 @@ uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *att
886886
uint16_t handle = (uint16_t)adapter->attributes->len;
887887
mp_obj_list_append(adapter->attributes, attribute);
888888

889-
if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) {
889+
if (mp_obj_is_type(attribute, &bleio_service_type)) {
890890
adapter->last_added_service_handle = handle;
891891
}
892-
if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) {
892+
if (mp_obj_is_type(attribute, &bleio_characteristic_type)) {
893893
adapter->last_added_characteristic_handle = handle;
894894
}
895895

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434

3535
bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute) {
36-
if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) {
36+
if (mp_obj_is_type(attribute, &bleio_characteristic_type)) {
3737
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute);
3838
return characteristic->uuid;
3939
}
40-
if (MP_OBJ_IS_TYPE(attribute, &bleio_descriptor_type)) {
40+
if (mp_obj_is_type(attribute, &bleio_descriptor_type)) {
4141
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute);
4242
return descriptor->uuid;
4343
}
44-
if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) {
44+
if (mp_obj_is_type(attribute, &bleio_service_type)) {
4545
bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute);
4646
return service->uuid;
4747
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_b
213213

214214
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
215215

216-
if (MP_OBJ_IS_TYPE(self->observer, &bleio_characteristic_buffer_type)) {
216+
if (mp_obj_is_type(self->observer, &bleio_characteristic_buffer_type)) {
217217
bleio_characteristic_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo);
218-
} else if (MP_OBJ_IS_TYPE(self->observer, &bleio_packet_buffer_type)) {
218+
} else if (mp_obj_is_type(self->observer, &bleio_packet_buffer_type)) {
219219
bleio_packet_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo);
220220
} else {
221221
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
644644
// mp_obj_t iterable = mp_getiter(service_uuids_whitelist, &iter_buf);
645645
// mp_obj_t uuid_obj;
646646
// while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
647-
// if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
647+
// if (!mp_obj_is_type(uuid_obj, &bleio_uuid_type)) {
648648
// mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist"));
649649
// }
650650
// bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ void att_remove_connection(uint16_t conn_handle, uint8_t reason) {
539539
.len = sizeof(zero),
540540
};
541541

542-
if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) {
542+
if (mp_obj_is_type(attribute_obj, &bleio_descriptor_type)) {
543543
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj);
544544
if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) == BLE_UUID_CCCD) {
545545
common_hal_bleio_descriptor_set_value(descriptor, &zero_cccd_value);
@@ -800,7 +800,7 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
800800
// Fetch the uuid for the given attribute, which might be a characteristic or a descriptor.
801801
bleio_uuid_obj_t *uuid;
802802

803-
if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) {
803+
if (mp_obj_is_type(attribute_obj, &bleio_characteristic_type)) {
804804
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj);
805805
if (characteristic->handle != handle) {
806806
// If the handles don't match, this is the characteristic definition attribute.
@@ -971,7 +971,7 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui
971971
}
972972

973973
mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle);
974-
if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_service_type)) {
974+
if (mp_obj_is_type(attribute_obj, &bleio_service_type)) {
975975
bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute_obj);
976976

977977
// Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute
@@ -1083,7 +1083,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
10831083
size_t rsp_length = sizeof(rsp_t);
10841084

10851085
mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle);
1086-
if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_service_type)) {
1086+
if (mp_obj_is_type(attribute_obj, &bleio_service_type)) {
10871087
if (offset) {
10881088
send_error(conn_handle, BT_ATT_ERR_ATTRIBUTE_NOT_LONG, handle, BT_ATT_ERR_INVALID_PDU);
10891089
return;
@@ -1095,7 +1095,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
10951095
common_hal_bleio_uuid_pack_into(service->uuid, rsp->r.value);
10961096
rsp_length += sizeof_service_uuid;
10971097

1098-
} else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) {
1098+
} else if (mp_obj_is_type(attribute_obj, &bleio_characteristic_type)) {
10991099
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj);
11001100
if (characteristic->decl_handle == handle) {
11011101
// Read characteristic declaration. Return properties, value handle, and uuid.
@@ -1135,7 +1135,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
11351135
memcpy(rsp->r.value, bufinfo.buf + offset, value_length);
11361136
rsp_length += value_length;
11371137
}
1138-
} else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) {
1138+
} else if (mp_obj_is_type(attribute_obj, &bleio_descriptor_type)) {
11391139
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj);
11401140

11411141
mp_buffer_info_t bufinfo;
@@ -1203,7 +1203,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
12031203
mp_obj_t *attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle);
12041204

12051205
if (type_uuid == BLE_UUID_CHARACTERISTIC &&
1206-
MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) {
1206+
mp_obj_is_type(attribute_obj, &bleio_characteristic_type)) {
12071207
// Request is for characteristic declarations.
12081208
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj);
12091209

@@ -1250,7 +1250,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
12501250
rsp_length += data_length;
12511251
no_data = false;
12521252

1253-
} else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) {
1253+
} else if (mp_obj_is_type(attribute_obj, &bleio_descriptor_type)) {
12541254
// See if request is for a descriptor value with a 16-bit UUID, such as the CCCD.
12551255
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj);
12561256
if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) == type_uuid) {
@@ -1271,7 +1271,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
12711271
break;
12721272
}
12731273

1274-
} else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) {
1274+
} else if (mp_obj_is_type(attribute_obj, &bleio_characteristic_type)) {
12751275
// See if request is for a characteristic value with a 16-bit UUID.
12761276
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj);
12771277
if (bleio_uuid_get_uuid16_or_unknown(characteristic->uuid) == type_uuid) {
@@ -1359,7 +1359,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t
13591359

13601360
mp_obj_t attribute_obj = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, req->handle);
13611361

1362-
if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_characteristic_type)) {
1362+
if (mp_obj_is_type(attribute_obj, &bleio_characteristic_type)) {
13631363
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute_obj);
13641364

13651365
// Don't write the characteristic declaration.
@@ -1377,7 +1377,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t
13771377
// Just change the local value. Don't fire off notifications, etc.
13781378
bleio_characteristic_set_local_value(characteristic, &bufinfo);
13791379

1380-
} else if (MP_OBJ_IS_TYPE(attribute_obj, &bleio_descriptor_type)) {
1380+
} else if (mp_obj_is_type(attribute_obj, &bleio_descriptor_type)) {
13811381
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute_obj);
13821382
// Only CCCD's are writable.
13831383
if (bleio_uuid_get_uuid16_or_unknown(descriptor->uuid) != BLE_UUID_CCCD) {
@@ -1427,7 +1427,7 @@ STATIC void process_prepare_write_req(uint16_t conn_handle, uint16_t mtu, uint8_
14271427

14281428
mp_obj_t *attribute = bleio_adapter_get_attribute(&common_hal_bleio_adapter_obj, handle);
14291429

1430-
if (!MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) {
1430+
if (!mp_obj_is_type(attribute, &bleio_characteristic_type)) {
14311431
send_error(conn_handle, BT_ATT_OP_PREPARE_WRITE_REQ, handle, BT_ATT_ERR_ATTRIBUTE_NOT_LONG);
14321432
return;
14331433
}

docs/design_guide.rst

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,34 @@ Module description
238238
After the license comment::
239239

240240
"""
241-
`<module name>` - <Short description>
241+
`<module name>`
242242
=================================================
243-
<Longer description.>
243+
244+
<Longer description>
245+
246+
* Author(s):
247+
248+
Implementation Notes
249+
--------------------
250+
251+
252+
**Hardware:**
253+
254+
* Adafruit `Device Description
255+
<hyperlink>`_ (Product ID: <Product Number>)
256+
257+
**Software and Dependencies:**
258+
259+
* Adafruit CircuitPython firmware for the supported boards:
260+
https://circuitpython.org/downloads
261+
* Adafruit's Bus Device library:
262+
https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
263+
* Adafruit's Register library:
264+
https://github.com/adafruit/Adafruit_CircuitPython_Register
265+
244266
"""
245267

268+
246269
Class description
247270
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
248271

@@ -383,6 +406,14 @@ Renders as:
383406

384407
:param float degrees: Degrees to turn right
385408

409+
Documentation References to other Libraries
410+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
411+
When you need to make references to documentation in other libraries you should refer the class using single
412+
backticks ``:class:`~adafruit_motor.servo.Servo```. You must also add the reference in the ``conf.py`` file in the
413+
``intersphinx_mapping section`` by adding a new entry::
414+
415+
"adafruit_motor": ("https://circuitpython.readthedocs.io/projects/motor/en/latest/", None,),
416+
386417
Use BusDevice
387418
--------------------------------------------------------------------------------
388419

docs/library/re.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Match objects
174174
Match objects as returned by `match()` and `search()` methods, and passed
175175
to the replacement function in `sub()`.
176176

177-
.. method:: match.group([index])
177+
.. method:: match.group(index)
178178

179179
Return matching (sub)string. *index* is 0 for entire match,
180180
1 and above for each capturing group. Only numeric groups are supported.

extmod/misc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_uos_dupterm_obj);
1616

1717
#if MICROPY_PY_OS_DUPTERM
18+
bool mp_uos_dupterm_is_builtin_stream(mp_const_obj_t stream);
1819
int mp_uos_dupterm_rx_chr(void);
1920
void mp_uos_dupterm_tx_strn(const char *str, size_t len);
2021
void mp_uos_deactivate(size_t dupterm_idx, const char *msg, mp_obj_t exc);

extmod/modubinascii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
static void check_not_unicode(const mp_obj_t arg) {
1515
#if MICROPY_CPYTHON_COMPAT
16-
if (MP_OBJ_IS_STR(arg)) {
16+
if (mp_obj_is_str(arg)) {
1717
mp_raise_TypeError(translate("a bytes-like object is required"));
1818
}
1919
#endif

0 commit comments

Comments
 (0)