summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-01-12 16:05:33 +1100
committerDamien George <damien@micropython.org>2022-01-13 13:45:07 +1100
commit889dee8076aa1c639dbbd6ce4993872e7feb4acf (patch)
tree4373db0b0a7e7fe70ea92deed19e15d5c3fc34c9 /extmod/modbluetooth.c
parentf2ccf87e0b139d7e0402e9f4a615cedfeac7a11e (diff)
extmod/modbluetooth: Fix conditional compilation of ringbuf_put_uuid.
This fixes a bug introduced in a76604afba109d990e466cdcd5a69a82077a7f56 Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/modbluetooth.c')
-rw-r--r--extmod/modbluetooth.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 1bf2ae6ad..c4b9675ce 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -215,7 +215,9 @@ STATIC mp_int_t bluetooth_uuid_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bu
return 0;
}
-#if !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS && MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
+#if !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
+
+#if MICROPY_PY_BLUETOOTH_ENABLE_GATT_CLIENT
STATIC void ringbuf_put_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) {
assert(ringbuf_free(ringbuf) >= (size_t)uuid->type + 1);
ringbuf_put(ringbuf, uuid->type);
@@ -223,7 +225,9 @@ STATIC void ringbuf_put_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid)
ringbuf_put(ringbuf, uuid->data[i]);
}
}
+#endif
+#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) {
assert(ringbuf_avail(ringbuf) >= 1);
uuid->type = ringbuf_get(ringbuf);
@@ -232,7 +236,9 @@ STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid)
uuid->data[i] = ringbuf_get(ringbuf);
}
}
-#endif // MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
+#endif
+
+#endif // !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
const mp_obj_type_t mp_type_bluetooth_uuid = {
{ &mp_type_type },