From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13173 invoked by alias); 2 Oct 2007 11:47:31 -0000 Received: (qmail 13165 invoked by uid 22791); 2 Oct 2007 11:47:31 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 11:47:27 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1IcgDi-00066j-00; Tue, 02 Oct 2007 13:47:22 +0200 Date: Tue, 02 Oct 2007 11:47:00 -0000 From: Andrew Lunn To: Rasmus Stougaard Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20071002114722.GA30037@lunn.ch> Mail-Followup-To: Rasmus Stougaard , ecos-discuss@ecos.sourceware.org References: <20071001142828.GA22379@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Problem reading buttons on AT91sam7s-ek X-SW-Source: 2007-10/txt/msg00022.txt.bz2 > 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