Hello,
/*
* main.cpp
*
* Created on: 26 mars 2014
* Author: daivymerlijs
*/
#include <stdio.h>
#include <sys/mman.h>
#include <xenomai/native/task.h>
#include <xenomai/native/intr.h>
static RT_INTR intr;
int main() {
mlockall(MCL_CURRENT | MCL_FUTURE);
rt_task_shadow(NULL,NULL,90,0);
rt_intr_create(&intr,NULL,60,0); //not the correct value
rt_intr_enable(&intr);
while(1){
printf("Waiting interruption... \n");
rt_intr_wait(&intr,TM_INFINITE);
printf("Interruption OK");
}
return 0;
}
I want to capture the interruption by using a button connected to that GPIO, because BBB can capture 1-0 or 0-1 interruption. So, if everything is alright and I press the button, "rt_intr_wait" will deblock (it's a blocking fonction) and will print "Interruption OK".
The main problem is "rt_intr_create", where I don't know the correct value to use, because the GPIO number is not the correct the value to use, the value I need to know is the value used by the kernel ID that is linked with the GPIO. However, I can't find this information anywhere. At the opposite of some cards, like FOXG20, which tell me what is the ID number depending of the kernel version :
http://www.acmesystems.it/pinout_foxg20
So I think I should find a similar information in the BBB documentation (and the Texas Instruement documentation too) , but I can't find it anywhere. I need a lot of help on this, I hope you guys can help me.
Thanks,
Daivy