Forum Discussion
Altera_Forum
Honored Contributor
19 years agoHi Banx,
Thanks for the suggestions. I don't think they helped, but I have got it going now, without understand it properly. I still think it's something to do with pointers. I have referenced my interrupt as follows: alt_irq_register( UART_0_IRQ, Flags, UART_RxD_Int); Flags is declared as a global: volatile char Flags; This now completely works, but I get a warning on the above line: warning: passing arg 2 of `alt_irq_register' makes pointer from integer without a cast I've tried modifying the line to: alt_irq_register( UART_0_IRQ, (volatile char)Flags, UART_RxD_Int); Which helps not one jot! Also, what I find completely bizarre is, in the serial interrupt my variable ByteRec, which is used as following... ByteRec = IORD(UART_0_BASE, ALTERA_AVALON_UART_RXDATA_REG); ...Is just fine and works without complaining. That's just declared a s a global: char ByteRec; So why does Flags need to be put in the alt_irq_register, and once that's done ByteRec work just fine? Also, even though it works, why does it throw up that warning? This void* business in the protoype for alt_irq_register totally mystifies me. I have to confess I find pointers in C very hard to understand in general and I find that other friends who are C programmers completely fail to explain them to me which makes me supect they don't understand either! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif DIB.