We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a7cb6 commit 1fdb548Copy full SHA for 1fdb548
components/finsh/shell.c
@@ -157,17 +157,15 @@ int finsh_getchar(void)
157
return -1; /* EOF */
158
}
159
#else
160
- rt_device_t device;
161
162
RT_ASSERT(shell != RT_NULL);
163
164
- device = shell->device;
165
- if (device == RT_NULL)
+ if (shell->device == RT_NULL)
166
{
167
168
169
170
- while (rt_device_read(device, -1, &ch, 1) != 1)
+ while (rt_device_read(shell->device, -1, &ch, 1) != 1)
171
rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);
172
173
return ch;
0 commit comments