Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9881 Discussions

MCU api - gpio interrupt mode falling AND rising edge ?



From the doc found at MCU API | Intel® Software :

int gpio_register_interrupt(int gpio, int mode, irq_handler_t isr);

where mode: 0 = falling edge interrupt, 1 = rising edge interrupt

I just wonder if i can make interrupt for both falling and rising edge .

i try to call :

gpio_register_interrupt(my_pin, 0, my_isr);


gpio_register_interrupt(my_pin, 1, my_isr);

which give me error when debuggin /dev/ttymcu1;

but when i try :

gpio_register_interrupt(my_pin, 2, my_isr);

no error raised...

just to be sure if there was not some mistake in the api documentation because it seems that mcu_snprintf

is bad documented:

from the doc, we can see that the declaration tell us that there is NO RETURN ( cause the void) and later, 'return value, number of chars ....' , in the 'mcu_api.h' header file this return an interger :


A simplified version of snprintf.

void mcu_snprintf(char *buf, unsigned int size, const char *fmt, ...)


buf: the buffer point to contain the datasize: size of bufferfmt: format stringreturn value: the number of characters that have been written



just found this thread

which answer to my first question...

so whats about the doc ?

1 Reply
Community Manager

Hi toukytrip,

Thank you for contacting us and letting us know you found the solution to your fiest question. In regards to your second question, I looked at the mcu_snprintf function on the document you posted and at the mcu_api.h file. It appears that both documents say different things, as you pointed out. In , mcu_snprintf is declared as a void and in mcu_api.h, it is declared as an int, as you can see here:



So, it appears that there's a mismatch in the documentation. We'll report this to the appropriate team so that the document can be modified.

Let us know if there's anything else we can assist you with.