0
에 대한 am3352x IRQ 번호 97에 실패합니다.InterruptAttach 내가 <em>GPIO 은행 0</em> 즉 <code>0B irq no 97</code>에 <em>IRQ 핸들러</em>를 첨부하려고 은행 0B
현재로서는 -1
으로 구현됩니다. 내가 도대체 뭘 잘못하고있는 겁니까? 구현하는 것은 매우 간단한 문제입니다.
#include <stdio.h>
#include <unistd.h>
#include "gpio.h"
#include <sys/neutrino.h>
#include "interrupt.h"
volatile unsigned int gpio0_irq_count;
static const struct sigevent * gpio0_irq_handler (void *gpio, int id){
gpio0_irq_count++;
return NULL;
}
int main(){
int ret;
unsigned long count=0;
ret = InterruptAttach(97, gpio0_irq_handler, NULL,0,_NTO_INTR_FLAGS_TRK_MSK);
printf("%s: Registering handler for irq %d result = %d\n",__func__ , 97, ret);
if (ret)
return -1;
while(1){
printf("%s:[%lu] : gpio0_irq_count = %d\n", __func__, count++, gpio0_irq_count);
sleep(2);
}
}
에러가 발생한 출력된다 :
main: Registering handler for irq 97 result = -1