Merge remote-tracking branch 'origin/7.2.x' into merge-7.2.x

This commit is contained in:
Jeff Epler 2022-04-05 08:45:13 -05:00
commit fe98248a3d
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
8 changed files with 14 additions and 15 deletions

View File

@ -400,7 +400,7 @@ jobs:
id: idf-cache
with:
path: ${{ github.workspace }}/.idf_tools
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404
- name: Clone IDF submodules
run: |
(cd $IDF_PATH && git submodule update --init)

View File

@ -108,6 +108,7 @@ STATIC void reset_single_pwmout(uint8_t i) {
for (int ch = 0; ch < CHANNELS_PER_PWM; ch++) {
pwm_seq[i][ch] = (1 << 15); // polarity = 0
pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnnect from I/O
}
}

View File

@ -85,7 +85,7 @@ static void shared_callback(busio_uart_obj_t *self) {
_copy_into_ringbuf(&self->ringbuf, self->uart);
// We always clear the interrupt so it doesn't continue to fire because we
// may not have read everything available.
uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS;
uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS;
}
static void uart0_callback(void) {

View File

@ -28,7 +28,6 @@
#include "ringbuf.h"
bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) {
r->heap = false;
r->buf = buf;
r->size = capacity;
r->iget = r->iput = 0;
@ -40,7 +39,6 @@ bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) {
// size of the buffer is one greater than that, due to how the buffer
// handles empty and full statuses.
bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) {
r->heap = true;
r->buf = gc_alloc(capacity + 1, false, long_lived);
r->size = capacity + 1;
r->iget = r->iput = 0;
@ -48,9 +46,8 @@ bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) {
}
void ringbuf_free(ringbuf_t *r) {
if (r->heap) {
gc_free(r->buf);
}
// Free buf by letting gc take care of it. If the VM has finished already,
// this will be safe.
r->buf = (uint8_t *)NULL;
r->size = 0;
ringbuf_clear(r);

View File

@ -37,7 +37,6 @@ typedef struct _ringbuf_t {
uint32_t size;
uint32_t iget;
uint32_t iput;
bool heap;
} ringbuf_t;
// Note that the capacity of the buffer is N-1!

View File

@ -739,8 +739,8 @@ unwind_jump:;
obj = mp_getiter(obj, iter_buf);
if (obj != MP_OBJ_FROM_PTR(iter_buf)) {
// Iterator didn't use the stack so indicate that with MP_OBJ_NULL.
sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL;
sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj;
*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) = MP_OBJ_NULL;
*(sp - MP_OBJ_ITER_BUF_NSLOTS + 2) = obj;
}
DISPATCH();
}
@ -751,8 +751,8 @@ unwind_jump:;
DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward
code_state->sp = sp;
mp_obj_t obj;
if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) {
obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2];
if (*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) == MP_OBJ_NULL) {
obj = *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2);
} else {
obj = MP_OBJ_FROM_PTR(&sp[-MP_OBJ_ITER_BUF_NSLOTS + 1]);
}

View File

@ -4,10 +4,12 @@ huffman
# For nvm.toml
cascadetoml
jinja2
typer
# Undo this pin when click and typer are again compatible.
typer==0.4.0
sh
click
# Undo this pin when click and typer are again compatible.
click==8.0.4
cpp-coveralls
requests
requests-cache

View File

@ -364,7 +364,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
}
self->samples_decoded += *buffer_length / sizeof(int16_t);
return GET_BUFFER_MORE_DATA;
return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
}
void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output,