Skip to content

Commit

Permalink
[update] fix finsh bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liukangcc committed Mar 15, 2022
1 parent 75a7cb6 commit 1fdb548
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions components/finsh/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,15 @@ int finsh_getchar(void)
return -1; /* EOF */
}
#else
rt_device_t device;

RT_ASSERT(shell != RT_NULL);

device = shell->device;
if (device == RT_NULL)
if (shell->device == RT_NULL)
{
return -1; /* EOF */
}

while (rt_device_read(device, -1, &ch, 1) != 1)
while (rt_device_read(shell->device, -1, &ch, 1) != 1)
rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);

return ch;
Expand Down

0 comments on commit 1fdb548

Please sign in to comment.