Page 1 of 1

Bug in pal_lld.c

Posted: Sun Oct 12, 2014 12:58 am
by lilvinz
Hi,

the initial pin output state is not set correctly.
The problem is, that a write to PIO_ODSR does not work before PIO_OWER has been set.
This can be fixed easily by writing to the PIO_SODR and PIO_CODR registers which works even when PIO_OWER is not set.

Code: Select all

  AT91C_BASE_PIOA->PIO_SODR = config->P0Data.odsr;      /* Data as specified.*/
  AT91C_BASE_PIOA->PIO_CODR = ~config->P0Data.odsr;


Code: Select all

  AT91C_BASE_PIOB->PIO_SODR = config->P1Data.odsr;      /* Data as specified.*/
  AT91C_BASE_PIOB->PIO_CODR = ~config->P1Data.odsr;


Cheers,

Vinz