This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bugfix for hal/arm/at91/at91sam7sek/current/src/at91sam7sek_misc.c error in bitmask offset


Hi,

I found a bug in

hal/arm/at91/at91sam7sek/current/src/at91sam7sek_misc.c
in the function hal_at91_led().
By mistake the pins are not addressed correctly, the bitmask for the
diodes should start at PA0 instead of PA1.

I am not sure whether it has been corrected in the current cvs version.

The original is:
 // Set the bits. The logic is inverted
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA1, !(val & 1));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA2, !(val & 2));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA3, !(val & 4));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA4, !(val & 8));


here is the fix:

 // Set the bits. The logic is inverted
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA0, !(val & 1));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA1, !(val & 2));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA2, !(val & 4));
  HAL_ARM_AT91_GPIO_PUT(AT91_GPIO_PA3, !(val & 8));


Could someone please insert it such that others might benefit.

Regards
Rasmus Stougaard

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]