主题 : 可以这样在一个应用程序里打开两个驱动吗? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 9815
精华: 0
发帖: 5
金钱: 50 两
威望: 22 点
综合积分: 10 分
注册时间: 2009-10-14
最后登录: 2009-12-22
楼主  发表于: 2009-11-10 10:30

 可以这样在一个应用程序里打开两个驱动吗?

各位大哥大姐,我是新手,很多问题不懂,在嵌入式学习中遇到这个问题,我想在应用程序里同时用AD与DA,各位请问这样可以吗?万分感谢

int fd = open("/dev/dactl",O_RDWR);  // open the DA driveir

if (fd < 0)
{
  printf("Can't open the DA driver  [ERROR]");
  return 0;
}

int fd = open("/dev/adc", 0);// open the AD driveir
    if (fd < 0)
{
perror("open ADC device:");
return 1;
}
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-11-10 10:45
可以
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."