B b0j3 New Member Oct 26, 2006 #1 Hello! I am trying to program attiny2313 using avr-gcc. The program: #include <avr/io.h> int subfunc(volatile uint8_t *port, uint8_t mask) { *port |= mask; return 0; } int main() { subfunc(&PORTB,0xff); return 0; } I am using avr-gcc (on Ubuntu 6.06 linux) but the program doesn't work. It seems to get stuck in subfunction. Any ideas what I am doing wrong.
Hello! I am trying to program attiny2313 using avr-gcc. The program: #include <avr/io.h> int subfunc(volatile uint8_t *port, uint8_t mask) { *port |= mask; return 0; } int main() { subfunc(&PORTB,0xff); return 0; } I am using avr-gcc (on Ubuntu 6.06 linux) but the program doesn't work. It seems to get stuck in subfunction. Any ideas what I am doing wrong.
J jarph New Member Oct 26, 2006 #2 To mask off a bit don't use a function use a macro. a lot easier. AS far as you code I thing the & in the call is messing you up. try getting ride of it
To mask off a bit don't use a function use a macro. a lot easier. AS far as you code I thing the & in the call is messing you up. try getting ride of it