Skip to content

Commit 1a65c97

Browse files
authored
Merge branch 'main' into improve_espulp
2 parents 9130940 + 5cc8d44 commit 1a65c97

File tree

3,786 files changed

+33093
-68230
lines changed

Some content is hidden

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

3,786 files changed

+33093
-68230
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,7 @@ TAGS
9191

9292
# Uncrustify formatting
9393
*.uncrustify
94+
95+
# clangd cache
96+
##############
97+
.cache

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,6 @@
383383
[submodule "frozen/Adafruit_CircuitPython_SHT4x"]
384384
path = frozen/Adafruit_CircuitPython_SHT4x
385385
url = https://github.com/adafruit/Adafruit_CircuitPython_SHT4x
386+
[submodule "frozen/Adafruit_CircuitPython_Bitmap_Font"]
387+
path = frozen/Adafruit_CircuitPython_Bitmap_Font
388+
url = https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font

LICENSES/lgpl-2.1.txt

Lines changed: 502 additions & 0 deletions
Large diffs are not rendered by default.

conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@
110110
autoapi_python_class_content = "both"
111111
autoapi_python_use_implicit_namespaces = True
112112
autoapi_root = "shared-bindings"
113+
114+
# Suppress cache warnings to prevent "unpickable" [sic] warning
115+
# about autoapi_prepare_jinja_env() from sphinx >= 7.3.0.
116+
# See https://github.com/sphinx-doc/sphinx/issues/12300
117+
suppress_warnings = ["config.cache"]
118+
113119
def autoapi_prepare_jinja_env(jinja_env):
114120
jinja_env.globals['support_matrix_reverse'] = modules_support_matrix_reverse
115121

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

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
7-
* Copyright (c) 2016 Glenn Ruben Bakke
8-
* Copyright (c) 2018 Artur Pacholec
9-
*
10-
* Permission is hereby granted, free of charge, to any person obtaining a copy
11-
* of this software and associated documentation files (the "Software"), to deal
12-
* in the Software without restriction, including without limitation the rights
13-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
* copies of the Software, and to permit persons to whom the Software is
15-
* furnished to do so, subject to the following conditions:
16-
*
17-
* The above copyright notice and this permission notice shall be included in
18-
* all copies or substantial portions of the Software.
19-
*
20-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26-
* THE SOFTWARE.
27-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Dan Halbert for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2016 Glenn Ruben Bakke
5+
// SPDX-FileCopyrightText: Copyright (c) 2018 Artur Pacholec
6+
//
7+
// SPDX-License-Identifier: MIT
288

299
#include <math.h>
3010
#include <stdint.h>
@@ -77,7 +57,7 @@
7757

7858
bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT];
7959

80-
STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
60+
static void add_generic_services(bleio_adapter_obj_t *adapter) {
8161
// Create Generic Access UUID, Service, and Characteristics.
8262

8363
// Generic Access Service setup.
@@ -178,13 +158,13 @@ STATIC void add_generic_services(bleio_adapter_obj_t *adapter) {
178158
}
179159

180160

181-
STATIC void check_enabled(bleio_adapter_obj_t *adapter) {
161+
static void check_enabled(bleio_adapter_obj_t *adapter) {
182162
if (!common_hal_bleio_adapter_get_enabled(adapter)) {
183163
mp_raise_bleio_BluetoothError(MP_ERROR_TEXT("Adapter not enabled"));
184164
}
185165
}
186166

187-
// STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
167+
// static bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
188168
// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in;
189169

190170
// // For debugging.
@@ -278,7 +258,7 @@ static void _adapter_set_name(bleio_adapter_obj_t *self, mp_obj_str_t *name_obj)
278258

279259
// Get various values and limits set by the adapter.
280260
// Set event mask.
281-
STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) {
261+
static void bleio_adapter_hci_init(bleio_adapter_obj_t *self) {
282262
mp_int_t name_len = 0;
283263

284264
#if CIRCUITPY_OS_GETENV
@@ -438,7 +418,7 @@ void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *na
438418
}
439419

440420

441-
// STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
421+
// static bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) {
442422
// bleio_scanresults_obj_t *scan_results = (bleio_scanresults_obj_t*)scan_results_in;
443423

444424
// if (ble_evt->header.evt_id == BLE_GAP_EVT_TIMEOUT &&
@@ -536,7 +516,7 @@ void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self) {
536516
// volatile bool done;
537517
// } connect_info_t;
538518

539-
// STATIC bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) {
519+
// static bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) {
540520
// connect_info_t *info = (connect_info_t*)info_in;
541521

542522
// switch (ble_evt->header.evt_id) {
@@ -633,13 +613,13 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre
633613
return mp_const_none;
634614
}
635615

636-
STATIC void check_data_fit(size_t data_len, bool connectable) {
616+
static void check_data_fit(size_t data_len, bool connectable) {
637617
if (data_len > MAX_ADVERTISEMENT_SIZE) {
638618
mp_raise_ValueError(MP_ERROR_TEXT("Data too large for advertisement packet"));
639619
}
640620
}
641621

642-
// STATIC bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
622+
// static bool advertising_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
643623
// bleio_adapter_obj_t *self = (bleio_adapter_obj_t*)self_in;
644624

645625
// switch (ble_evt->header.evt_id) {

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

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,12 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
7-
* Copyright (c) 2018 Artur Pacholec
8-
* Copyright (c) 2016 Glenn Ruben Bakke
9-
*
10-
* Permission is hereby granted, free of charge, to any person obtaining a copy
11-
* of this software and associated documentation files (the "Software"), to deal
12-
* in the Software without restriction, including without limitation the rights
13-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
* copies of the Software, and to permit persons to whom the Software is
15-
* furnished to do so, subject to the following conditions:
16-
*
17-
* The above copyright notice and this permission notice shall be included in
18-
* all copies or substantial portions of the Software.
19-
*
20-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26-
* THE SOFTWARE.
27-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2018 Dan Halbert for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2018 Artur Pacholec
5+
// SPDX-FileCopyrightText: Copyright (c) 2016 Glenn Ruben Bakke
6+
//
7+
// SPDX-License-Identifier: MIT
288

29-
#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ADAPTER_H
30-
#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ADAPTER_H
9+
#pragma once
3110

3211
#include "py/obj.h"
3312
#include "py/objtuple.h"
@@ -95,5 +74,3 @@ uint16_t bleio_adapter_max_attribute_handle(bleio_adapter_obj_t *adapter);
9574
void bleio_adapter_background(bleio_adapter_obj_t *adapter);
9675
void bleio_adapter_gc_collect(bleio_adapter_obj_t *adapter);
9776
void bleio_adapter_reset(bleio_adapter_obj_t *adapter);
98-
99-
#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ADAPTER_H

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

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) 2019 Dan Halbert for Adafruit Industries
7-
*
8-
* Permission is hereby granted, free of charge, to any person obtaining a copy
9-
* of this software and associated documentation files (the "Software"), to deal
10-
* in the Software without restriction, including without limitation the rights
11-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
* copies of the Software, and to permit persons to whom the Software is
13-
* furnished to do so, subject to the following conditions:
14-
*
15-
* The above copyright notice and this permission notice shall be included in
16-
* all copies or substantial portions of the Software.
17-
*
18-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24-
* THE SOFTWARE.
25-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
266

277
#include "py/runtime.h"
288

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) 2020 Dan Halbert for Adafruit Industries
7-
*
8-
* Permission is hereby granted, free of charge, to any person obtaining a copy
9-
* of this software and associated documentation files (the "Software"), to deal
10-
* in the Software without restriction, including without limitation the rights
11-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
* copies of the Software, and to permit persons to whom the Software is
13-
* furnished to do so, subject to the following conditions:
14-
*
15-
* The above copyright notice and this permission notice shall be included in
16-
* all copies or substantial portions of the Software.
17-
*
18-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24-
* THE SOFTWARE.
25-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Dan Halbert for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
266

27-
#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H
28-
#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H
7+
#pragma once
298

309
#include "shared-module/_bleio/Attribute.h"
3110
#include "shared-bindings/_bleio/UUID.h"
3211

3312
bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute);
34-
35-
#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_ATTRIBUTE_H

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

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,9 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) Dan Halbert for Adafruit Industries
7-
* Copyright (c) 2018 Artur Pacholec
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy
10-
* of this software and associated documentation files (the "Software"), to deal
11-
* in the Software without restriction, including without limitation the rights
12-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
* copies of the Software, and to permit persons to whom the Software is
14-
* furnished to do so, subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in
17-
* all copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
* THE SOFTWARE.
26-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) Dan Halbert for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2018 Artur Pacholec
5+
//
6+
// SPDX-License-Identifier: MIT
277

288
#include "py/runtime.h"
299

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,11 @@
1-
/*
2-
* This file is part of the MicroPython project, http://micropython.org/
3-
*
4-
* The MIT License (MIT)
5-
*
6-
* Copyright (c) 2019 Dan Halbert for Adafruit Industries
7-
* Copyright (c) 2018 Artur Pacholec
8-
*
9-
* Permission is hereby granted, free of charge, to any person obtaining a copy
10-
* of this software and associated documentation files (the "Software"), to deal
11-
* in the Software without restriction, including without limitation the rights
12-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13-
* copies of the Software, and to permit persons to whom the Software is
14-
* furnished to do so, subject to the following conditions:
15-
*
16-
* The above copyright notice and this permission notice shall be included in
17-
* all copies or substantial portions of the Software.
18-
*
19-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
* THE SOFTWARE.
26-
*/
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2018 Artur Pacholec
5+
//
6+
// SPDX-License-Identifier: MIT
277

28-
#ifndef MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H
29-
#define MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H
8+
#pragma once
309

3110
#include "shared-bindings/_bleio/Attribute.h"
3211
#include "common-hal/_bleio/Descriptor.h"
@@ -59,5 +38,3 @@ bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_b
5938

6039
void bleio_characteristic_set_observer(bleio_characteristic_obj_t *self, mp_obj_t observer);
6140
void bleio_characteristic_clear_observer(bleio_characteristic_obj_t *self);
62-
63-
#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CHARACTERISTIC_H

0 commit comments

Comments
 (0)