Skip to content

Commit 3191357

Browse files
committed
Merge remote-tracking branch 'origin/main' into refine-stubs
2 parents 9449a35 + e51d5e4 commit 3191357

File tree

362 files changed

+9047
-2522
lines changed

Some content is hidden

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

362 files changed

+9047
-2522
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# tools/gen-cpydiff.py: Fix formatting of doc strings for new Black.
2+
0f78c36c5aa458a954eed39a46942209107a553e
3+
14
# tests/run-tests.py: Reformat with Black.
25
2a38d7103672580882fb621a5b76e8d26805d593
36

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 🐞 Bug Report
2+
description: Create a bug report to help us improve
3+
labels:
4+
- bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: >-
9+
Thanks! for testing out CircuitPython. Now that you have encountered a
10+
bug... you can file a report for it.
11+
- type: textarea
12+
id: firmware
13+
attributes:
14+
label: CircuitPython version
15+
description: >-
16+
Include the version of CircuitPython you're running. You can see it in
17+
the `boot_out.txt` file, as well as in the `REPL`.
18+
placeholder: Adafruit CircuitPython 6.2.0 on 2021-03-01; Raspberry Pi Pico with rp2040
19+
render: python
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: code
24+
attributes:
25+
label: Code/REPL
26+
description: This is automatically rendered as Python, so no need for backticks.
27+
placeholder: |
28+
import busio, bitbangio
29+
i2c = bitbangio.I2C(board.GP1, board.GP0)
30+
render: python
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: behavior
35+
attributes:
36+
label: Behavior
37+
description: What happens when you run the code above? Include error messages (if any).
38+
placeholder: |
39+
```python
40+
Traceback (most recent call last):
41+
File "<stdin>", line 1, in <module>
42+
TimeoutError: Clock stretch too long
43+
```
44+
On-board led pulses red.
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: description
49+
attributes:
50+
label: Description
51+
description: Optionally, describe the bug in more detail.
52+
placeholder: |
53+
- Error while using i2c...
54+
- Only happens when...
55+
- might be related to #4291...
56+
- type: textarea
57+
id: more-info
58+
attributes:
59+
label: Additional information
60+
description: >-
61+
Optionally, add any other information like hardware connection, scope
62+
output etc. If you have already done some debugging, mention it here.
63+
placeholder: Removing [this](url) line resolves the issue.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
contact_links:
2-
- name: Adafruit Forum
2+
- name: 🔗 Adafruit Forum
33
url: https://forums.adafruit.com/
44
about: Official Adafruit technical support forum. Good for getting help on getting a project working.
5-
- name: Adafruit Discord
5+
- name: 🔗 Adafruit Discord
66
url: https://adafru.it/discord
77
about: Unofficial chat with many helpful folks and normally prompt replies.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
name: Feature request
2+
name: 🚀 Feature Request
33
about: Suggest an idea for this project
44
title: ''
55
labels: 'enhancement'
66
assignees: ''
77

88
---
99

10-
<!-- We are always adding new features and enhancements to CircuitPython 🚀
10+
<!-- We keep adding new features and enhancements to CircuitPython 🚀
1111
and would love ❤ to see what new challenge you have got for us... 🙂 -->

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ jobs:
132132
TWINE_USERNAME: ${{ secrets.pypi_username }}
133133
TWINE_PASSWORD: ${{ secrets.pypi_password }}
134134
run: |
135-
echo "Uploading dev release to PyPi"
136-
twine upload circuitpython-stubs/dist/*
135+
# setup.py sdist was run by 'make stubs'
136+
if [ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
137+
if [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
137138
138139
mpy-cross-mac:
139140
runs-on: macos-10.15

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
[submodule "ports/esp32s2/esp-idf"]
154154
path = ports/esp32s2/esp-idf
155155
url = https://github.com/adafruit/esp-idf.git
156+
branch = circuitpython-v4.3
156157
[submodule "ports/esp32s2/certificates/nina-fw"]
157158
path = ports/esp32s2/certificates/nina-fw
158159
url = https://github.com/adafruit/nina-fw.git

conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@
417417

418418
# Example configuration for intersphinx: refer to the Python standard library.
419419
intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None),
420-
"bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),
421420
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
422421

423422
# Adapted from sphinxcontrib-redirects

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
118118
SECURITY_MODE_NO_ACCESS,
119119
248, // max length, from Bluetooth spec
120120
false, // not fixed length
121-
&generic_name_bufinfo
121+
&generic_name_bufinfo,
122+
NULL
122123
);
123124

124125
uint16_t zero_16 = 0;
@@ -140,7 +141,8 @@ STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
140141
SECURITY_MODE_NO_ACCESS,
141142
2, // max length, from Bluetooth spec
142143
true, // fixed length
143-
&zero_16_value
144+
&zero_16_value,
145+
NULL
144146
);
145147

146148
// Generic Attribute Service setup.
@@ -176,7 +178,8 @@ STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
176178
SECURITY_MODE_NO_ACCESS,
177179
4, // max length, from Bluetooth spec
178180
true, // fixed length
179-
&zero_32_value
181+
&zero_32_value,
182+
NULL
180183
);
181184
}
182185

@@ -645,7 +648,11 @@ STATIC void check_data_fit(size_t data_len, bool connectable) {
645648
// return true;
646649
// }
647650

648-
uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, float interval, uint8_t *advertising_data, uint16_t advertising_data_len, uint8_t *scan_response_data, uint16_t scan_response_data_len, mp_int_t tx_power) {
651+
uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self,
652+
bool connectable, bool anonymous, uint32_t timeout, float interval,
653+
const uint8_t *advertising_data, uint16_t advertising_data_len,
654+
const uint8_t *scan_response_data, uint16_t scan_response_data_len,
655+
mp_int_t tx_power, const bleio_address_obj_t *directed_to) {
649656
check_enabled(self);
650657

651658
if (self->now_advertising) {
@@ -769,7 +776,11 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self,
769776
return 0;
770777
}
771778

772-
void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo, mp_int_t tx_power) {
779+
void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self,
780+
bool connectable, bool anonymous, uint32_t timeout, mp_float_t interval,
781+
mp_buffer_info_t *advertising_data_bufinfo,
782+
mp_buffer_info_t *scan_response_data_bufinfo,
783+
mp_int_t tx_power, const bleio_address_obj_t *directed_to) {
773784
check_enabled(self);
774785

775786
// interval value has already been validated.
@@ -803,7 +814,7 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool
803814
advertising_data_bufinfo->len,
804815
scan_response_data_bufinfo->buf,
805816
scan_response_data_bufinfo->len,
806-
tx_power);
817+
tx_power, directed_to);
807818

808819
if (result) {
809820
mp_raise_bleio_BluetoothError(translate("Already advertising"));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#define CCCD_INDICATE 0x2
4242

4343

44-
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
44+
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_service_obj_t *service, uint16_t handle, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo, const char *user_description) {
4545
self->service = service;
4646
self->uuid = uuid;
4747
self->decl_handle = BLE_GATT_HANDLE_INVALID;
@@ -66,7 +66,7 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
6666
if (service->is_remote) {
6767
self->handle = handle;
6868
} else {
69-
common_hal_bleio_service_add_characteristic(self->service, self, initial_value_bufinfo);
69+
common_hal_bleio_service_add_characteristic(self->service, self, initial_value_bufinfo, user_description);
7070
}
7171
}
7272

0 commit comments

Comments
 (0)