Skip to content

Commit fe98248

Browse files
committed
Merge remote-tracking branch 'origin/7.2.x' into merge-7.2.x
2 parents 47d3d0d + e0827eb commit fe98248

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ jobs:
400400
id: idf-cache
401401
with:
402402
path: ${{ github.workspace }}/.idf_tools
403-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210923
403+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404
404404
- name: Clone IDF submodules
405405
run: |
406406
(cd $IDF_PATH && git submodule update --init)

ports/nrf/common-hal/pwmio/PWMOut.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ STATIC void reset_single_pwmout(uint8_t i) {
108108

109109
for (int ch = 0; ch < CHANNELS_PER_PWM; ch++) {
110110
pwm_seq[i][ch] = (1 << 15); // polarity = 0
111+
pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnnect from I/O
111112
}
112113
}
113114

ports/raspberrypi/common-hal/busio/UART.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void shared_callback(busio_uart_obj_t *self) {
8585
_copy_into_ringbuf(&self->ringbuf, self->uart);
8686
// We always clear the interrupt so it doesn't continue to fire because we
8787
// may not have read everything available.
88-
uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS;
88+
uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS;
8989
}
9090

9191
static void uart0_callback(void) {

py/ringbuf.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ringbuf.h"
2929

3030
bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) {
31-
r->heap = false;
3231
r->buf = buf;
3332
r->size = capacity;
3433
r->iget = r->iput = 0;
@@ -40,17 +39,15 @@ bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) {
4039
// size of the buffer is one greater than that, due to how the buffer
4140
// handles empty and full statuses.
4241
bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) {
43-
r->heap = true;
4442
r->buf = gc_alloc(capacity + 1, false, long_lived);
4543
r->size = capacity + 1;
4644
r->iget = r->iput = 0;
4745
return r->buf != NULL;
4846
}
4947

5048
void ringbuf_free(ringbuf_t *r) {
51-
if (r->heap) {
52-
gc_free(r->buf);
53-
}
49+
// Free buf by letting gc take care of it. If the VM has finished already,
50+
// this will be safe.
5451
r->buf = (uint8_t *)NULL;
5552
r->size = 0;
5653
ringbuf_clear(r);

py/ringbuf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ typedef struct _ringbuf_t {
3737
uint32_t size;
3838
uint32_t iget;
3939
uint32_t iput;
40-
bool heap;
4140
} ringbuf_t;
4241

4342
// Note that the capacity of the buffer is N-1!

py/vm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ unwind_jump:;
739739
obj = mp_getiter(obj, iter_buf);
740740
if (obj != MP_OBJ_FROM_PTR(iter_buf)) {
741741
// Iterator didn't use the stack so indicate that with MP_OBJ_NULL.
742-
sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL;
743-
sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj;
742+
*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) = MP_OBJ_NULL;
743+
*(sp - MP_OBJ_ITER_BUF_NSLOTS + 2) = obj;
744744
}
745745
DISPATCH();
746746
}
@@ -751,8 +751,8 @@ unwind_jump:;
751751
DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward
752752
code_state->sp = sp;
753753
mp_obj_t obj;
754-
if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) {
755-
obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2];
754+
if (*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) == MP_OBJ_NULL) {
755+
obj = *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2);
756756
} else {
757757
obj = MP_OBJ_FROM_PTR(&sp[-MP_OBJ_ITER_BUF_NSLOTS + 1]);
758758
}

requirements-dev.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ huffman
44
# For nvm.toml
55
cascadetoml
66
jinja2
7-
typer
7+
# Undo this pin when click and typer are again compatible.
8+
typer==0.4.0
89

910
sh
10-
click
11+
# Undo this pin when click and typer are again compatible.
12+
click==8.0.4
1113
cpp-coveralls
1214
requests
1315
requests-cache

shared-module/audiomp3/MP3Decoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
364364
}
365365

366366
self->samples_decoded += *buffer_length / sizeof(int16_t);
367-
return GET_BUFFER_MORE_DATA;
367+
return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
368368
}
369369

370370
void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output,

0 commit comments

Comments
 (0)