Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ed5b34

Browse files
committed
esp32/machine_i2s: Code review cleanup.
- remove unneeded blank lines - remove I2S warning suppressor macro - change #include to reference new I2S driver Signed-off-by: Mike Teachman <[email protected]>
1 parent 6fda293 commit 7ed5b34

File tree

4 files changed

+1
-9
lines changed

4 files changed

+1
-9
lines changed

extmod/machine_i2s.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ STATIC mp_uint_t machine_i2s_stream_write(mp_obj_t self_in, const void *buf_in,
600600

601601
return size;
602602
} else { // blocking or asyncio mode
603-
604603
mp_buffer_info_t appbuf;
605604
appbuf.buf = (void *)buf_in;
606605
appbuf.len = size;
@@ -625,7 +624,6 @@ STATIC mp_uint_t machine_i2s_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
625624

626625
if (flags & MP_STREAM_POLL_RD) {
627626
if (self->mode != MICROPY_PY_MACHINE_I2S_CONSTANT_RX) {
628-
629627
*errcode = MP_EPERM;
630628
return MP_STREAM_ERROR;
631629
}
@@ -642,7 +640,6 @@ STATIC mp_uint_t machine_i2s_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
642640
}
643641

644642
if (flags & MP_STREAM_POLL_WR) {
645-
646643
if (self->mode != MICROPY_PY_MACHINE_I2S_CONSTANT_TX) {
647644
*errcode = MP_EPERM;
648645
return MP_STREAM_ERROR;
@@ -653,14 +650,12 @@ STATIC mp_uint_t machine_i2s_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_
653650
ret |= MP_STREAM_POLL_WR;
654651
}
655652
#else
656-
657653
if (self->dma_buffer_status == DMA_MEMORY_NOT_FULL) {
658654
ret |= MP_STREAM_POLL_WR;
659655
}
660656
#endif
661657
}
662658
} else {
663-
664659
*errcode = MP_EINVAL;
665660
ret = MP_STREAM_ERROR;
666661
}

ports/esp32/boards/sdkconfig.base

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ CONFIG_UART_ISR_IN_IRAM=y
112112
# IDF 5 deprecated
113113
CONFIG_ADC_SUPPRESS_DEPRECATE_WARN=y
114114
CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y
115-
CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y
116115

117116
CONFIG_ETH_USE_SPI_ETHERNET=y
118117
CONFIG_ETH_SPI_ETHERNET_W5500=y

ports/esp32/machine_i2s.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ i2s_event_callbacks_t i2s_callbacks_null = {
304304
.on_send_q_ovf = NULL,
305305
};
306306

307-
308307
STATIC void mp_machine_i2s_init_helper(machine_i2s_obj_t *self, mp_arg_val_t *args) {
309308
// are Pins valid?
310309
int8_t sck = args[ARG_sck].u_obj == MP_OBJ_NULL ? -1 : machine_pin_get_id(args[ARG_sck].u_obj);
@@ -437,7 +436,6 @@ STATIC void mp_machine_i2s_deinit(machine_i2s_obj_t *self) {
437436
}
438437
}
439438

440-
441439
STATIC void mp_machine_i2s_irq_update(machine_i2s_obj_t *self) {
442440
if (self->io_mode == NON_BLOCKING) {
443441
// create a queue linking the MicroPython task to a FreeRTOS task

ports/esp32/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "esp_random.h"
1010
#include "esp_system.h"
1111
#include "freertos/FreeRTOS.h"
12-
#include "driver/i2s.h"
12+
#include "driver/i2s_std.h"
1313
#include "esp_wifi_types.h"
1414

1515
#ifndef MICROPY_CONFIG_ROM_LEVEL

0 commit comments

Comments
 (0)