In order to work correctly, the macros defined in PinNames.h as:
GD_PORT_GET(X) (((uint32_t)(X) >> 4) & 0xF)
and
GD_PIN_GET(X) (((uint32_t)(X) & 0xF))
expect the port and the ports' pin numbers to be encoded as above. However, this isn't happening in the code where we do something like eg:
PORTA_15 = PORTA + 0x0F,
PORTB_0 = PORTB + 0x10,
When the macros expect something like:
PORTA_15 = (PORTA << 4) + 0x0F,
PORTB_0 = (PORTB << 4) + 0x00,
Note the pin number starts at zero for each new port. This is required for the encoding to work.
This will mean changes need to happen with the ADC_TEMP and ADC_VREF pins to prevent overlap.
We also have code that appears to expect the GPIOx port to be returned where the PORTx is instead. I'm not sure if the mapping is happening elsewhere, but for me it seems to not be happening.
In order to work correctly, the macros defined in PinNames.h as: GD_PORT_GET(X) (((uint32_t)(X) >> 4) & 0xF) and GD_PIN_GET(X) (((uint32_t)(X) & 0xF)) expect the port and the ports' pin numbers to be encoded as above. However, this isn't happening in the code where we do something like eg: PORTA_15 = PORTA + 0x0F, PORTB_0 = PORTB + 0x10,
When the macros expect something like: PORTA_15 = (PORTA << 4) + 0x0F, PORTB_0 = (PORTB << 4) + 0x00,
Note the pin number starts at zero for each new port. This is required for the encoding to work. This will mean changes need to happen with the ADC_TEMP and ADC_VREF pins to prevent overlap.
We also have code that appears to expect the GPIOx port to be returned where the PORTx is instead. I'm not sure if the mapping is happening elsewhere, but for me it seems to not be happening.