8000 rp2/rp2_dma: Fix fetching 'write' buffers for writing not reading. · pimoroni/micropython@f8cabe8 · GitHub
[go: up one dir, main page]

Skip to content

Commit f8cabe8

Browse files
nickovsdpgeorge
authored andcommitted
rp2/rp2_dma: Fix fetching 'write' buffers for writing not reading.
Signed-off-by: Nicko van Someren <nicko@nicko.org>
1 parent 80fd575 commit f8cabe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/rp2/rp2_dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ STATIC const uint32_t rp2_dma_ctrl_field_count = MP_ARRAY_SIZE(rp2_dma_ctrl_fiel
8686
STATIC uint32_t rp2_dma_register_value_from_obj(mp_obj_t o, int reg_type) {
8787
if (reg_type == REG_TYPE_ADDR_READ || reg_type == REG_TYPE_ADDR_WRITE) {
8888
mp_buffer_info_t buf_info;
89-
mp_uint_t flags = MP_BUFFER_READ;
89+
mp_uint_t flags = (reg_type == REG_TYPE_ADDR_READ) ? MP_BUFFER_READ : MP_BUFFER_WRITE;
9090
if (mp_get_buffer(o, &buf_info, flags)) {
9191
return (uint32_t)buf_info.buf;
9292
}

0 commit comments

Comments
 (0)
0