mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-06-14 01:17:14 +08:00
45 lines
1.2 KiB
HTML
45 lines
1.2 KiB
HTML
<h1>标准库函数 - noidle</h1>
|
|
|
|
|
|
<p>原型:extern void noidle(void);</p>
|
|
|
|
<p>用法:#include <system.h></p>
|
|
|
|
<p>功能:调用系统例程</p>
|
|
|
|
<p>说明:文曲星是单任务系统,为防止应用程序占用过多的系统时间而影响系统程序的执行</p>
|
|
<pre><code class="language-c">
|
|
|
|
同时也为了防止个别程序崩溃而造成系统无法启动,文曲星内核在中断到来时会检
|
|
测应用程序所执行的时间,如果在4秒内系统程序没有得到运行,则中断程序将强迫
|
|
文曲星进入睡眠状态,即所谓的死机。
|
|
因此,当程序运算时间过长(一般为循环过程)时,请调用noidle来防止系统关机。
|
|
</code></pre>
|
|
|
|
举例:<pre><code class="language-c">
|
|
|
|
// noidle.c
|
|
|
|
#include <system.h>
|
|
|
|
main()
|
|
{
|
|
int i,j;
|
|
clrscr();
|
|
printf("Waiting...\n");
|
|
|
|
for(i=0;i<10;i++)
|
|
for(j=0;j<32767;j++)
|
|
{
|
|
noidle();
|
|
}
|
|
|
|
printf("System Shutdown?");
|
|
|
|
getchar();
|
|
return 0;
|
|
}
|
|
|
|
</code></pre>相关函数:无
|
|
|