Forum Discussion
Altera_Forum
Honored Contributor
15 years agoPush Buttons Adujusting Speed
So I'm using a DE2 board with NIOS and Quartus 9.1 and I'm trying to make a function to adjust the speed of packets sent over Ethernet as a modification of the DE2_NET sample. the problem is that whe...
Altera_Forum
Honored Contributor
15 years agoI think this is a problem:
volatile int* button; *button = IORD_ALTERA_AVALON_PIO_DATA(BUTTON_PIO_BASE); You are using an uninitialized pointer which will corrupt memory somewhere. The correct code is the one you commented out (but you need to define alt_u8 button, not alt_u8 *button). Moreover, IMHO it was correct to test button switching edge instead of button status. Now you always have delay=delayAmount=0 and whenever you press a button the function will keep on retriggering until you release it.