> int get_pin_state(int gpio_pin)
> {
>   int value;
>   // Enable the clock to the GPIO (enable input sampling)
>   HAL_WRITE_UINT32(AT91_PMC + AT91_PMC_PCER, AT91_PMC_PCER_PIOA);

You only need to enable the clock once. You could move this outside of
the read function.

Maybe i should add a macro to var_io.h to enable/disable the clock?

      Andrew

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

Reply via email to