Skip to content

Commit dbdf1aa

Browse files
Thalleyfabiobaltieri
authored andcommitted
samples: Bluetooth: BAP: Source: Reverse in/out terminology
In USB "in" refers to data going from device to host, and "out" refers to data going from host to device. From a BT perspective "usb_out" then refers to the data we receive from the host, to be sent over BT, so the "out" terminology still works for that. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 3db5c6f commit dbdf1aa

File tree

1 file changed

+4
-4
lines changed
  • samples/bluetooth/bap_broadcast_source/src

1 file changed

+4
-4
lines changed

samples/bluetooth/bap_broadcast_source/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ K_THREAD_DEFINE(encoder, LC3_ENCODER_STACK_SIZE, init_lc3_thread, NULL, NULL, NU
310310
/* Allocate 3: 1 for USB to receive data to and 2 additional buffers to prevent out of memory
311311
* errors when USB host decides to perform rapid terminal enable/disable cycles.
312312
*/
313-
K_MEM_SLAB_DEFINE_STATIC(usb_in_buf_pool, USB_MAX_STEREO_FRAME_SIZE, 3, UDC_BUF_ALIGN);
313+
K_MEM_SLAB_DEFINE_STATIC(usb_out_buf_pool, USB_MAX_STEREO_FRAME_SIZE, 3, UDC_BUF_ALIGN);
314314
static bool terminal_enabled;
315315

316316
static void terminal_update_cb(const struct device *dev, uint8_t terminal, bool enabled,
@@ -337,7 +337,7 @@ static void *get_recv_buf_cb(const struct device *dev, uint8_t terminal, uint16_
337337
__ASSERT(size <= USB_MAX_STEREO_FRAME_SIZE, "%u was not <= %d", size,
338338
USB_MAX_STEREO_FRAME_SIZE);
339339

340-
ret = k_mem_slab_alloc(&usb_in_buf_pool, &buf, K_NO_WAIT);
340+
ret = k_mem_slab_alloc(&usb_out_buf_pool, &buf, K_NO_WAIT);
341341
if (ret != 0) {
342342
printk("Failed to allocate buffer: %d\n", ret);
343343
}
@@ -354,7 +354,7 @@ static void data_recv_cb(const struct device *dev, uint8_t terminal, void *buf,
354354
int16_t *pcm;
355355

356356
if (!terminal_enabled || buf == NULL || size == 0U) {
357-
k_mem_slab_free(&usb_in_buf_pool, buf);
357+
k_mem_slab_free(&usb_out_buf_pool, buf);
358358
return;
359359
}
360360

@@ -388,7 +388,7 @@ static void data_recv_cb(const struct device *dev, uint8_t terminal, void *buf,
388388
printk("USB Data received (count = %d)\n", count);
389389
}
390390

391-
k_mem_slab_free(&usb_in_buf_pool, buf);
391+
k_mem_slab_free(&usb_out_buf_pool, buf);
392392
}
393393
#endif /* defined(CONFIG_USE_USB_AUDIO_INPUT) */
394394
#endif /* defined(CONFIG_LIBLC3) */

0 commit comments

Comments
 (0)