Bug in pal_lld.c

ChibiOS public support forum for topics related to the Atmel AT91SAM7x family of micro-controllers.

Moderator: inmarket

User avatar
lilvinz
Posts: 124
Joined: Sat Dec 21, 2013 2:56 pm
Has thanked: 1 time
Been thanked: 4 times

Bug in pal_lld.c

Postby lilvinz » Sun Oct 12, 2014 12:58 am

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

Return to “AT91SAM7x Support”

Who is online

Users browsing this forum: No registered users and 1 guest