[FPGA] quartus 10.0定时器中断问题,请高手帮忙,谢谢! 5
不知道怎么回事,在niosii一编译就报错,请大侠帮忙。注册中断的时候,就报错,貌似找不到这个函数,可我已经包含#include"sys/alt_irq.h"头文件了啊。...
不知道怎么回事,在nios ii一编译就报错,请大侠帮忙。注册中断的时候,就报错,貌似找不到这个函数,可我已经包含#include "sys/alt_irq.h"头文件了啊。alt_ic_isr_register(TIMER_0_IRQ_INTERRUPT_CONTROLLER_ID, TIMER_0_IRQ, ISR_timer, isr_context_ptr, 0);函数如下:#include <stdlib.h>#include <stdio.h>#include "string.h"#include <unistd.h>#include "../inc/IO.h"#include "../inc/usb.h"#include "altera_avalon_dma_regs.h"#include "altera_avalon_spi_regs.h"#include "altera_avalon_pio_regs.h"#include "altera_avalon_timer_regs.h"#include "sys/alt_irq.h"#include "alt_types.h"#include "system.h"//unsigned short usbDataBuf[USB_BUF_MAX_SIZE]; int SPI_READ_DATA(void);void init(void);void ISR_timer(void *isr_context);unsigned int timer_isr_context;int main(){ init(); while(1) { }; return 0;}void init(void){ void* isr_context_ptr = (void*) &timer_isr_context; alt_ic_isr_register(TIMER_0_IRQ_INTERRUPT_CONTROLLER_ID, TIMER_0_IRQ, ISR_timer, isr_context_ptr, 0); IOWR_ALTERA_AVALON_TIMER_CONTROL(TIMER_0_BASE, ALTERA_AVALON_TIMER_CONTROL_START_MSK |// START = 1 ALTERA_AVALON_TIMER_CONTROL_CONT_MSK |// CONT = 1 ALTERA_AVALON_TIMER_CONTROL_ITO_MSK); // ITO = 1}void ISR_timer(void* timer_isr_context){ IOWR_ALTERA_AVALON_TIMER_STATUS(TIMER_0_BASE, ~ ALTERA_AVALON_TIMER_STATUS_TO_MSK); // TO = 0}
上面的图片是nios提示的错误。 展开
上面的图片是nios提示的错误。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询