diff options
| author | Nicko van Someren <nicko@nicko.org> | 2024-01-06 16:33:12 -0700 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-01-07 18:25:52 +1100 |
| commit | f8cabe82f71add182702f32e1b1444a44c83eb74 (patch) | |
| tree | 6f05462f513d8f2bccc083818c80a2f2e9bb0a4e | |
| parent | 80fd575c8cc103133fed4c7386f0b7165abd2678 (diff) | |
rp2/rp2_dma: Fix fetching 'write' buffers for writing not reading.
Signed-off-by: Nicko van Someren <nicko@nicko.org>
| -rw-r--r-- | ports/rp2/rp2_dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/rp2/rp2_dma.c b/ports/rp2/rp2_dma.c index acc18d08c..893498265 100644 --- a/ports/rp2/rp2_dma.c +++ b/ports/rp2/rp2_dma.c @@ -86,7 +86,7 @@ STATIC const uint32_t rp2_dma_ctrl_field_count = MP_ARRAY_SIZE(rp2_dma_ctrl_fiel STATIC uint32_t rp2_dma_register_value_from_obj(mp_obj_t o, int reg_type) { if (reg_type == REG_TYPE_ADDR_READ || reg_type == REG_TYPE_ADDR_WRITE) { mp_buffer_info_t buf_info; - mp_uint_t flags = MP_BUFFER_READ; + mp_uint_t flags = (reg_type == REG_TYPE_ADDR_READ) ? MP_BUFFER_READ : MP_BUFFER_WRITE; if (mp_get_buffer(o, &buf_info, flags)) { return (uint32_t)buf_info.buf; } |
