找回密码
 注册
查看: 1065|回复: 1

uclinux下rc脚本下自启动打开串口程序出错!

[复制链接]
发表于 2006-6-6 14:45:33 | 显示全部楼层 |阅读模式
uclinux下rc脚本下自启动打开串口程序出错!应用程序的打开串口语句为: fd=open("/dev/uart0",O_RDWR|O_NDELAY|O_NOCTTY);
if (fd>0)
{
printf("串口%d打开..............fd is %d\n",i,fd);
}
else
{
printf("Can't Open Serial Port!\n");
exit(0);
}
而uclinux运行起来以后,可以运行该打开串口程序,并可以读写串口。请教大家为什么?我该如何让程序在系统启动时,应用程序自启动?谢谢您!
发表于 2006-6-6 22:48:47 | 显示全部楼层
Yes... Add your auto-open in the rc, which will be sourced when the os is booting.
An easy way is to format your work into an small application, which will be run when booting.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-5-17 15:59 , Processed in 0.019528 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表