mgmt: mcumgr: smp_shell: Change the way shell uart device is fetched
SMP shell was looking into internal shell uart structures to get uart device. This structures are now internal to the shell and cannot be used. Using device tree chosen instead. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
d6a3fd7cf0
commit
6d2e3b59a5
|
@ -213,13 +213,11 @@ static uint16_t smp_shell_get_mtu(const struct net_buf *nb)
|
|||
|
||||
static int smp_shell_tx_raw(const void *data, int len)
|
||||
{
|
||||
const struct shell *const sh = shell_backend_uart_get_ptr();
|
||||
const struct shell_uart *const su = sh->iface->ctx;
|
||||
const struct shell_uart_ctrl_blk *const scb = su->ctrl_blk;
|
||||
static const struct device *const sh_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart));
|
||||
const uint8_t *out = data;
|
||||
|
||||
while ((out != NULL) && (len != 0)) {
|
||||
uart_poll_out(scb->dev, *out);
|
||||
uart_poll_out(sh_dev, *out);
|
||||
++out;
|
||||
--len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue