描述:
我用pc104做一个ad采集卡,ad完成后中断,读取数据。可是现在进不了中断
程序如下:(大致)
/**********************************************/
#include <bios.h>
#include <CONIO.H>
#include <STDIO.h>
#include <STDLIB.h>
#include <math.h>
#include <DOS.h>
#include <string.h>
#include <bios.h>
/*--------------------------------------------------------------------*/
#define INTR 0x73H /*IRQ11对应中断向量存储地址73H*/
void Interrupt_Enable(void);
void Interrupt_Disable(void);
void interrupt(*oldvect)(); /*设置原中断向量保存指针*/
void interrupt ser_program();
FILE *OutputFile;
int c />
void main()
{
Interrupt_Enable();
if((OutputFile=fopen("d:\\AD_ch8_4000.txt","w"))==NULL)
{
printf("Cannot open the out Uatestfile!\n");
exit(0);
}
do
{
if (c />
{
outport(0x240,0x00); /*该语句执行后一段时间产生INT,接IRQ11 */
c />
}
}while(1);
Interrupt_Disable();
fclose(OutputFile);
}
void Interrupt_Enable(void)
{
disable();
oldvect = getvect(INTR); /*保存原中断向量*/
setvect(INTR,ser_program); /*装入中断服务程序入口地址*/
enable();
}
void Interrupt_Disable(void)
{
disable();
setvect(INTR, oldvect); /*恢复原中断向量*/
enable();
}
void interrupt ser_program()
{
c />
/* {....} 其他代码 */
}
有什么问题呢?高手指点!
PS:放在C语言区,达达说要放这里~