Skip to content

Commit 552c940

Browse files
committed
Replace deprecated mailbox.get() with mailbox.try_get_for(forever)
1 parent 5fde088 commit 552c940

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

ThreadsafeIO/src/spi/SpiDispatcher.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,9 @@ void SpiDispatcher::threadFunc()
104104
/* Wait blocking for the next IO transaction
105105
* request to be posted to the mailbox.
106106
*/
107-
osEvent evt = _spi_io_transaction_mailbox.get();
108-
if (evt.status == osEventMail)
107+
SpiIoTransaction * spi_io_transaction = _spi_io_transaction_mailbox.try_get_for(rtos::Kernel::wait_for_u32_forever);
108+
if (spi_io_transaction)
109109
{
110-
/* Fetch the IO transaction request and
111-
* process it.
112-
*/
113-
SpiIoTransaction * spi_io_transaction = reinterpret_cast<SpiIoTransaction *>(evt.value.p);
114110
processSpiIoRequest(spi_io_transaction);
115111
/* Free the allocated memory (memory allocated
116112
* during dispatch(...)

ThreadsafeIO/src/wire/WireDispatcher.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,9 @@ void WireDispatcher::threadFunc()
104104
/* Wait blocking for the next IO transaction
105105
* request to be posted to the mailbox.
106106
*/
107-
osEvent evt = _wire_io_transaction_mailbox.get();
108-
if (evt.status == osEventMail)
107+
WireIoTransaction * wire_io_transaction = _wire_io_transaction_mailbox.try_get_for(rtos::Kernel::wait_for_u32_forever);
108+
if (wire_io_transaction)
109109
{
110-
/* Fetch the IO transaction request and
111-
* process it.
112-
*/
113-
WireIoTransaction * wire_io_transaction = reinterpret_cast<WireIoTransaction *>(evt.value.p);
114110
processWireIoRequest(wire_io_transaction);
115111
/* Free the allocated memory (memory allocated
116112
* during dispatch(...)

0 commit comments

Comments
 (0)