Forum Discussion
Altera_Forum
Honored Contributor
17 years agoHelp with Nios ii
Hi I'm a new user of the Nios II IDE. I'm currently trying to modify the SD card music player that came as one of the demos for my DE board. I'm trying to pause the system with the use of the sle...
Altera_Forum
Honored Contributor
16 years agoFirst button pressing makes count=1. So system will remain in the while-loop because you never check if button is pressed, is buttonpressed changed on interrupt?. Assuming your button pio is called BUTTON and high level idle state:
if (!IORD(BUTTON,0)) //check button pressing
{
//Wait for button release
while (!IORD(BUTTON,0)) ;
//Wait for button pressing again
while (IORD(BUTTON,0)) ;
//Wait for button release again
while (!IORD(BUTTON,0)) ;
}