Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于操作系统的移植 #174

Open
upupsky opened this issue Dec 1, 2023 · 1 comment
Open

关于操作系统的移植 #174

upupsky opened this issue Dec 1, 2023 · 1 comment

Comments

@upupsky
Copy link

upupsky commented Dec 1, 2023

/**

*/
void shellTask(void *param)
{
Shell *shell = (Shell *)param;
char data;
#if SHELL_TASK_WHILE == 1
while(1)
{
#endif
if (shell->read && shell->read(&data, 1) == 1)
{
shellHandler(shell, data);
}
#if SHELL_TASK_WHILE == 1
}
#endif
}
你这个线程里面没有延时也没有等待吗?该线程是会把CPU吃干净哟?

@NevermindZZT
Copy link
Owner

实现的 read 接口要做阻塞和线程调度,可以看下 demo 里面 stm32 freertos 的例程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants