diff --git a/pw_channel/public/pw_channel/rp2_stdio_channel.h b/pw_channel/public/pw_channel/rp2_stdio_channel.h index 520e58148..d3ce82b63 100644 --- a/pw_channel/public/pw_channel/rp2_stdio_channel.h +++ b/pw_channel/public/pw_channel/rp2_stdio_channel.h @@ -29,22 +29,15 @@ namespace pw::channel { /// Initializes and returns a reference to a channel that speaks over rp2's /// stdio. /// +/// The read and write allocators should be different to avoid deadlocks due to +/// the read or write side of the API attempting to acquire more memory while +/// the other holds it. +/// /// ***This must only be called at-most once.*** ByteReaderWriter& Rp2StdioChannelInit( pw::multibuf::MultiBufAllocator& read_allocator, pw::multibuf::MultiBufAllocator& write_allocator); -/// DEPRECATED: prefer the two-allocator version of this API to avoid -/// deadlocks due to the read or write side of the API attempting to acquire -/// more memory while the other holds it. -/// -/// Initializes and returns a reference to a channel that speaks over rp2's -/// stdio. -/// -/// ***This must only be called at-most once.*** -[[deprecated]] ByteReaderWriter& Rp2StdioChannelInit( - pw::multibuf::MultiBufAllocator& allocator); - /// @} } // namespace pw::channel diff --git a/pw_channel/rp2_stdio_channel.cc b/pw_channel/rp2_stdio_channel.cc index 59e144864..cd2792cf1 100644 --- a/pw_channel/rp2_stdio_channel.cc +++ b/pw_channel/rp2_stdio_channel.cc @@ -187,8 +187,4 @@ ByteReaderWriter& Rp2StdioChannelInit(MultiBufAllocator& read_allocator, return channel.channel(); } -ByteReaderWriter& Rp2StdioChannelInit(MultiBufAllocator& allocator) { - return Rp2StdioChannelInit(allocator, allocator); -} - } // namespace pw::channel diff --git a/targets/rp2040/system_async_example.cc b/targets/rp2040/system_async_example.cc index 24e2da091..298aa66e2 100644 --- a/targets/rp2040/system_async_example.cc +++ b/targets/rp2040/system_async_example.cc @@ -27,6 +27,6 @@ int main() { stdio_usb_init(); static pw::multibuf::test::SimpleAllocatorForTest<4096, 4096> mb_alloc; - pw::SystemStart(pw::channel::Rp2StdioChannelInit(mb_alloc)); + pw::SystemStart(pw::channel::Rp2StdioChannelInit(mb_alloc, mb_alloc)); PW_UNREACHABLE; }