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运行起来以后,可以运行该打开串口程序,并可以读写串口。请教大家为什么?我该如何让程序在系统启动时,应用程序自启动?谢谢您!
uclinux下rc脚本下自启动打开串口程序出错!就是在应用程序中打开串口出错,也就是fd<0;但是等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);
}