Page 1 of 1

Adding an interrupt

Posted: Mon 2018-06-18 0:28
by Sourabh1986
Hi,
I want to add a small change in the attached code but couldn't get my head around it, i want to add an interrupt so that when GPIO0_0 is pressed it will override the playing file on GPIO0_1.
I will really appreciate any feedback or suggestion as this is only part we have to resolve before going into mass production.

Thank you
Sourabh Bansal

Re: Adding an interrupt

Posted: Mon 2018-06-18 0:29
by Sourabh1986
Here's the code.

Re: Adding an interrupt

Posted: Mon 2018-06-18 17:11
by pasi
in gpioctrl.c change line 166 to #if 0 like below:

Code: Select all

        	/* If different file (or no file) is playing,
        	   cancel play and start playing the new one. */
        	if (
#if 0 //def GPIO_RISING_EDGE
        	    (player.currentFile == -1) /* does not override */
#else
        	    player.currentFile != mask - 1
#endif
        	    ) {
So that GPIO0 going high is allowed to override play started by GPIO1.

Re: Adding an interrupt

Posted: Tue 2018-06-19 4:55
by Sourabh1986
Thanx heaps Pasi,
Yup that solved the issue.
:D :D