I am working with an AT32UC3A1512 processor on a custom board. I have #defined a pin with a name. Using that name to setup the pin works, but reading the pin using the name always returns 1. BUT if I replace the #defined name with the actual pin number, it correctly reads the port! Below is the pertinent code:
in an #included .h file
#define XAPIN AVR32_PIN_PA03
in a test section of the program
gpio_enable_gpio_pin(XAPIN); //enable gpio pin
gpio_configure_pin(XAPIN,IN); //make pin input
while (1)
{
a = gpio_get_pin_value(AVR32_PIN_PA03); //returns the correct value in a
a = gpio_get_pin_value(XAPIN); //always returns a 1
}
Any ideas?
Kind regards,
David