subsys/console: Yield on char availability.
If this is not done, there is common pattern that on big input block (e.g. from a clipboard paste), IRQ routine is called in a tight loop, leading to circular buffer overflow. Change-Id: I69a7aa78081b8d74652406f3b3a577ddaf4c5f6f Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
d7a189d2ec
commit
4e2eaec268
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,10 @@ static int console_irq_input_hook(uint8_t c)
|
|||
uart_ringbuf[i_put] = c;
|
||||
i_put = i_next;
|
||||
k_sem_give(&uart_sem);
|
||||
/** Allow waiting threads to pick up a char ASAP, or there can be
|
||||
* buffer overflow.
|
||||
*/
|
||||
k_yield();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue