aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rw-r--r--py/nativeglue.c2
-rw-r--r--py/objfun.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/py/nativeglue.c b/py/nativeglue.c
index 979265a87..eb02907bd 100644
--- a/py/nativeglue.c
+++ b/py/nativeglue.c
@@ -65,7 +65,7 @@ mp_uint_t mp_native_from_obj(mp_obj_t obj, mp_uint_t type) {
case MP_NATIVE_TYPE_UINT: return mp_obj_get_int_truncated(obj);
default: { // cast obj to a pointer
mp_buffer_info_t bufinfo;
- if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_RW)) {
+ if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_READ)) {
return (mp_uint_t)bufinfo.buf;
} else {
// assume obj is an integer that represents an address
diff --git a/py/objfun.c b/py/objfun.c
index d96c79ede..e0c6fb927 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -472,7 +472,7 @@ STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) {
return (mp_uint_t)items;
} else {
mp_buffer_info_t bufinfo;
- if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_WRITE)) {
+ if (mp_get_buffer(obj, &bufinfo, MP_BUFFER_READ)) {
// supports the buffer protocol, return a pointer to the data
return (mp_uint_t)bufinfo.buf;
} else {