shell: safe print from different threads
Added display text management to shell_fprintf function. Now it can be used from diffrent threads with not risk that displayed lines will overlay. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no> Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
75ad61f7ef
commit
ce6be8600b
8 changed files with 67 additions and 44 deletions
|
@ -91,12 +91,12 @@ static void uart_rx_handle(const struct shell_uart *sh_uart)
|
|||
|
||||
static void uart_tx_handle(const struct shell_uart *sh_uart)
|
||||
{
|
||||
u32_t len;
|
||||
u8_t *data;
|
||||
int err;
|
||||
struct device *dev = sh_uart->ctrl_blk->dev;
|
||||
u32_t len;
|
||||
int err;
|
||||
const u8_t *data;
|
||||
|
||||
len = ring_buf_get_claim(sh_uart->tx_ringbuf, &data,
|
||||
len = ring_buf_get_claim(sh_uart->tx_ringbuf, (u8_t **)&data,
|
||||
sh_uart->tx_ringbuf->size);
|
||||
if (len) {
|
||||
len = uart_fifo_fill(dev, data, len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue