[En-Nut-Discussion] Where are pm_cksel and pm_wait_for_pll0_locked

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu Oct 11 21:02:21 CEST 2012

>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:

    Harald> Hi Uwe, On 11.10.2012 19:16, Uwe Bonnes wrote:
    >> Harald,
    >> did you test AT91 recently? We now have include/dev/gpio_at91.h and
    >> that should fix the build.

    Harald> To me it still looks wrong. See

    Harald> http://lists.egnite.de/pipermail/en-nut-discussion/2012-October/013996.html

    Harald> On the AT91 "bank" is defined as PIO_ID, PIOA_ID etc. set to 0,
    Harald> 1 and so on. While gpio_at91.h defines

    Harald> #define GpioPinSetLow(bank, bit) outr((bank) + PIO_CODR_OFF,
    Harald> _BV(bit))

    Harald> Finally GpioPinSetLow(PIOA_ID, 2) is translated to

    Harald> outr(1 + PIO_CODR_OFF, _BV(2))

    Harald> instead of

    Harald> outr(PIOA_BASE + PIO_CODR_OFF, _BV(2))

The NutGpio Api is thought  to use NutGPIO_PORTX for the bank to
use. NUTGPIO_PORTX is e.g. translated to PIO_BASEX in

So we have a name clash at some places as GpioPxx() functions for some
architectures use PIO_IDs and not NUTGPIO_PORTX

I tried to experiment with instrumenting include/dev/gpio_at91.h like
#define GpioPinGet(bank, bit) (__builtin_constant_p(bank) && (bank) <100)?xxx():(inr((bank) + PIO_PDSR_OFF) & _BV(bit) ? 1 : 0)

but compilation always fails in dev/keys.c
arm-none-eabi-gcc -c -I../.././at91sam7x-ek/include  -I../../../nut/include  -DAT91SAM7X_EK  -MD -MP -mcpu=arm7tdmi -mthumb-interwork -Os -Wall -Wstrict-prototypes -Werror -Wa,-a=keys.lst  -o keys.o ../../../nut/dev/keys.c
../../../nut/dev/keys.c: In function 'sys_key':
../../../nut/dev/keys.c:200:17: error: implicit declaration of function 'xxx' [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors

I expect (bank) = "key->bank"
   200                 key->newState |= (GpioPinGet( key->bank, key->pin))?KEY_NOT_PRESSED:KEY_IS_DOWN;
 not to ne know at compile time and so the xxx() path not top be taken.

Leaving with a smoking head now 

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list