This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Bugfix for hal/arm/at91/at91sam7sek/current/src/at91sam7sek_misc.c error in bitmask offset
- From: "Rasmus Stougaard" <rasmus dot stougaard at gmail dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 16 Oct 2007 10:06:35 +0200
- Subject: [ECOS] Bugfix for hal/arm/at91/at91sam7sek/current/src/at91sam7sek_misc.c error in bitmask offset
- References: <6a6383bc0710110558u930502bu8db73970cc1dbacb@mail.gmail.com>
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