drivers: modem: receiver: replace fifo_fill with poll_out
Repalces send fifo_fill implementation with poll_out, this makes the receiver usefull on most SoC. Signed-off-by: Georgij Cernysiov <g.cernysiov@elco-automation.de>
This commit is contained in:
parent
886ab98fd0
commit
27618404f6
1 changed files with 3 additions and 16 deletions
|
@ -174,26 +174,13 @@ int mdm_receiver_recv(struct mdm_receiver_context *ctx,
|
|||
int mdm_receiver_send(struct mdm_receiver_context *ctx,
|
||||
const u8_t *buf, size_t size)
|
||||
{
|
||||
int written;
|
||||
|
||||
if (!ctx) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
while (size) {
|
||||
written = uart_fifo_fill(ctx->uart_dev,
|
||||
(const u8_t *)buf, size);
|
||||
if (written < 0) {
|
||||
/* error */
|
||||
uart_irq_tx_disable(ctx->uart_dev);
|
||||
return -EIO;
|
||||
} else if (written < size) {
|
||||
k_yield();
|
||||
}
|
||||
|
||||
size -= written;
|
||||
buf += written;
|
||||
}
|
||||
do {
|
||||
uart_poll_out(ctx->uart_dev, *buf++);
|
||||
} while (size--);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue