This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Return error on app_uart_put() when app_fifo_get() fails

Is there any reason why no error is returned when app_fifo_get() fails in app_uart_put() (SDK 12.0.0). Couldn't the lines below:

             if (app_fifo_get(&m_tx_fifo, tx_buffer) == NRF_SUCCESS)
             {
                 err_code = nrf_drv_uart_tx(&app_uart_inst, tx_buffer, 1);
             }
         }
     }
     return err_code;

be replaced with

             if ((err_code = app_fifo_get(&m_tx_fifo, tx_buffer)) == NRF_SUCCESS)
             {
                 err_code = nrf_drv_uart_tx(&app_uart_inst, tx_buffer, 1);
             }
         }
     }
     return err_code;
 }

so the error code in app_fifo_get() is returned?

Related