summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorNicko van Someren <nicko@nicko.org>2024-01-06 16:33:12 -0700
committerDamien George <damien@micropython.org>2024-02-16 10:44:10 +1100
commitd5f3fcd935f778d89918449b123f1c7bd6398cdf (patch)
treea4ee91a58dcb60f5ea4fadb11742685ee1aca375
parent9b8c64c9cee8203be167e6bffc74e186ae2fc958 (diff)
downloadmicropython-d5f3fcd935f778d89918449b123f1c7bd6398cdf.tar.gz
micropython-d5f3fcd935f778d89918449b123f1c7bd6398cdf.zip
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/rp2/rp2_dma.c b/ports/rp2/rp2_dma.c
index acc18d08c5..893498265a 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;
}