Commit 889dee80 authored by Damien George's avatar Damien George

extmod/modbluetooth: Fix conditional compilation of ringbuf_put_uuid.

This fixes a bug introduced in a76604afSigned-off-by: default avatarDamien George <damien@micropython.org>
parent f2ccf87e
...@@ -215,7 +215,9 @@ STATIC mp_int_t bluetooth_uuid_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bu ...@@ -215,7 +215,9 @@ STATIC mp_int_t bluetooth_uuid_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bu
return 0; 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) { STATIC void ringbuf_put_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) {
assert(ringbuf_free(ringbuf) >= (size_t)uuid->type + 1); assert(ringbuf_free(ringbuf) >= (size_t)uuid->type + 1);
ringbuf_put(ringbuf, uuid->type); ringbuf_put(ringbuf, uuid->type);
...@@ -223,7 +225,9 @@ STATIC void ringbuf_put_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) ...@@ -223,7 +225,9 @@ STATIC void ringbuf_put_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid)
ringbuf_put(ringbuf, uuid->data[i]); 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) { STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) {
assert(ringbuf_avail(ringbuf) >= 1); assert(ringbuf_avail(ringbuf) >= 1);
uuid->type = ringbuf_get(ringbuf); uuid->type = ringbuf_get(ringbuf);
...@@ -232,7 +236,9 @@ STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid) ...@@ -232,7 +236,9 @@ STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid)
uuid->data[i] = ringbuf_get(ringbuf); 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 = { const mp_obj_type_t mp_type_bluetooth_uuid = {
{ &mp_type_type }, { &mp_type_type },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment