Skip to content

Commit db3a47d

Browse files
authored
Merge branch 'adafruit:main' into audiodelays_stereo_freq_shift_fix
2 parents b4698a5 + 25216c8 commit db3a47d

File tree

143 files changed

+656
-725
lines changed

Some content is hidden

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

143 files changed

+656
-725
lines changed

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Thanks for submitting a pull request to CircuitPython! Remove these instructions before submitting.
2+
3+
See https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github for detailed instructions.
4+
5+
- Consider whether to submit this PR against `main` or against (if it exists) the branch for the current stable release or an upcoming minor release. The branch will be named `i.j.x`, for example, `9.2.x`. Bug fixes and minor enhancements can be submitted against the stable release branch, and will be merged to `main` regularly.
6+
- Create your own fork of `circuitpython` and create a branch for your changes.
7+
- Use `pre-commit` to check your commits before submitting. See https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/check-your-code.
8+
- Test your changes and tell us how you tested.
9+
10+
---

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ repos:
1010
hooks:
1111
- id: check-yaml
1212
- id: end-of-file-fixer
13-
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/raspberrypi/sdk|lib/tinyusb)'
13+
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/mimxrt10xx/sdk|ports/raspberrypi/sdk|lib/tinyusb)'
1414
- id: trailing-whitespace
15-
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff|ports/raspberrypi/sdk|lib/tinyusb)'
15+
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff|ports/raspberrypi/sdk|ports/mimxrt10xx/sdk|lib/tinyusb)'
1616
- repo: https://github.com/codespell-project/codespell
1717
rev: v2.2.4
1818
hooks:
@@ -59,3 +59,4 @@ repos:
5959
rev: "v2.5.0"
6060
hooks:
6161
- id: pyproject-fmt
62+
exclude: '^(ports/mimxrt10xx/sdk)'

docs/library/errno.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|see_cpython_module| :mod:`python:errno`.
88

99
This module provides access to symbolic error codes for `OSError` exception.
10-
The codes available may vary per CircuitPython build.
10+
Some codes are not available on the smallest CircuitPython builds, such as SAMD21, for space reasons.
1111

1212
Constants
1313
---------

lib/tinyusb

Submodule tinyusb updated 92 files

main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ static uint8_t *_allocate_memory(safe_mode_t safe_mode, const char *env_key, siz
131131
*final_size = default_size;
132132
#if CIRCUITPY_OS_GETENV
133133
if (safe_mode == SAFE_MODE_NONE) {
134-
(void)common_hal_os_getenv_int(env_key, (mp_int_t *)final_size);
135-
if (*final_size < 0) {
136-
*final_size = default_size;
134+
mp_int_t size;
135+
if (common_hal_os_getenv_int(env_key, &size) == GETENV_OK && size > 0) {
136+
*final_size = size;
137137
}
138138
}
139139
#endif

ports/analog/common-hal/os/__init__.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,6 @@
1515

1616
// #include "peripherals/periph.h"
1717

18-
static const qstr os_uname_info_fields[] = {
19-
MP_QSTR_sysname, MP_QSTR_nodename,
20-
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
21-
};
22-
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "max32");
23-
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "max32");
24-
25-
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
26-
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
27-
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);
28-
29-
static MP_DEFINE_ATTRTUPLE(
30-
os_uname_info_obj,
31-
os_uname_info_fields,
32-
5,
33-
(mp_obj_t)&os_uname_info_sysname_obj,
34-
(mp_obj_t)&os_uname_info_nodename_obj,
35-
(mp_obj_t)&os_uname_info_release_obj,
36-
(mp_obj_t)&os_uname_info_version_obj,
37-
(mp_obj_t)&os_uname_info_machine_obj
38-
);
39-
40-
mp_obj_t common_hal_os_uname(void) {
41-
return (mp_obj_t)&os_uname_info_obj;
42-
}
43-
4418
bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
4519
#if (HAS_TRNG)
4620
// todo (low prior): implement

ports/analog/mpconfigport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
#include <stdint.h>
1111

12-
#define MICROPY_PY_FUNCTION_ATTRS (1)
13-
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
14-
1512
// 24KiB stack
1613
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000
1714

ports/atmel-samd/common-hal/audioio/AudioOut.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ static void ramp_value(uint16_t start, uint16_t end) {
7979
// Caller validates that pins are free.
8080
void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self,
8181
const mcu_pin_obj_t *left_channel, const mcu_pin_obj_t *right_channel, uint16_t quiescent_value) {
82+
83+
// The case of left_channel == right_channel is already disallowed in shared-bindings.
84+
8285
#ifdef SAM_D5X_E5X
8386
bool dac_clock_enabled = hri_mclk_get_APBDMASK_DAC_bit(MCLK);
8487
#endif
@@ -107,10 +110,6 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self,
107110
if (right_channel != NULL && right_channel != &pin_PA02 && right_channel != &pin_PA05) {
108111
raise_ValueError_invalid_pin_name(MP_QSTR_right_channel);
109112
}
110-
if (right_channel == left_channel) {
111-
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q and %q must be different"),
112-
MP_QSTR_left_channel, MP_QSTR_right_channel);
113-
}
114113
claim_pin(left_channel);
115114
if (right_channel != NULL) {
116115
claim_pin(right_channel);

ports/atmel-samd/common-hal/os/__init__.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,6 @@
1616
#include "hal/include/hal_rand_sync.h"
1717
#endif
1818

19-
static const qstr os_uname_info_fields[] = {
20-
MP_QSTR_sysname, MP_QSTR_nodename,
21-
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
22-
};
23-
#ifdef SAMD21
24-
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21");
25-
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21");
26-
#endif
27-
#ifdef SAM_D5X_E5X
28-
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51");
29-
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51");
30-
#endif
31-
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
32-
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
33-
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);
34-
35-
36-
static MP_DEFINE_ATTRTUPLE(
37-
os_uname_info_obj,
38-
os_uname_info_fields,
39-
5,
40-
(mp_obj_t)&os_uname_info_sysname_obj,
41-
(mp_obj_t)&os_uname_info_nodename_obj,
42-
(mp_obj_t)&os_uname_info_release_obj,
43-
(mp_obj_t)&os_uname_info_version_obj,
44-
(mp_obj_t)&os_uname_info_machine_obj
45-
);
46-
47-
mp_obj_t common_hal_os_uname(void) {
48-
return (mp_obj_t)&os_uname_info_obj;
49-
}
50-
5119
bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
5220
#ifdef SAM_D5X_E5X
5321
hri_mclk_set_APBCMASK_TRNG_bit(MCLK);

ports/atmel-samd/mpconfigport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54"
6969
#endif
7070
#define SPI_FLASH_MAX_BAUDRATE 24000000
71-
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
72-
#define MICROPY_PY_FUNCTION_ATTRS (1)
71+
7372
// MICROPY_PY_ERRNO_LIST - Use the default
7473

7574
#endif // SAM_D5X_E5X

0 commit comments

Comments
 (0)