From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23782 invoked by alias); 19 Mar 2013 22:37:32 -0000 Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org Received: (qmail 23535 invoked by uid 89); 19 Mar 2013 22:37:24 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_RQ autolearn=ham version=3.3.1 Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 19 Mar 2013 22:37:21 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 058A94680007 for ; Tue, 19 Mar 2013 22:37:19 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7TduV6-BfZax; Tue, 19 Mar 2013 22:37:14 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: ecos-patches@ecos.sourceware.org Subject: [Bug 1001787] GPIO Interrupt Support for Kinetis Date: Tue, 19 Mar 2013 22:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ilijak@siva.com.mk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: ilijak@siva.com.mk X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-03/txt/msg00027.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001787 --- Comment #3 from Ilija Kocho --- Mike (In reply to comment #2) > Ilija, > > I made and tested the following change. I can make a patch later if you > agree with it. This should allow arrays. > > On Interrupt Acknowledge, I wanted an interface that took an int for port i > order to be consistent with the overall API, and with the datasheet, and > with Assertions. However, a user could use the Macro directly like this: > > CYGHWR_HAL_KINETIS_PORT_PCR_ISFR_CLEAR(A, 5); > > This means the user can either choose the slower and safer API, or the Macro > that already exists. I don't know if that is consistent with eCos principles > or not, but this is why I made the choice. My feeling was a newbie would see > the API and use it first. Then if they needed a little more performance, > they would discover and use the MACRO. This is consistent with my design > methodology, which is based on late optimization. However, I do recognize > that embedded community may not operate on that principle as much as large > system architects, which is my background. > > Let me know what you think. I can make more changes if this is not > satisfactory. > I am conservative with introduction of new API functions because once API is released people will start using it and we are stuck with that (Linus Torvalds). I think that the macros do the job and are intuitive enough. True we lack asserts but some errors, such as non existing port are reported by the compiler. I would add functions some time to recheck. One problem is that the port representation is different from macros (i know there's not help there). In meantime we could focus on macros. > Mike > > Changes > ------- > > #define CYGHWR_HAL_KINETIS_PIN_CFG(__port, __bit, __irqc, __mux, __cnf) \ > ((CYGHWR_HAL_KINETIS_PORT##__port << 20) | ((__bit) << 27) \ > | CYGHWR_HAL_KINETIS_PORT_PCR_IRQC(__irqc) \ > | CYGHWR_HAL_KINETIS_PORT_PCR_MUX(__mux) | (__cnf)) > CFG is probably more intuitive than PINCD - OK. However I would put __mux next to __port and __bit and __irqc next to __cnf. Rationale: __port, __bit, __mux triplet represents kind of /addressing parameters/ and __irqc, __cnf are /configuration options/. > #define CYGHWR_HAL_KINETIS_PIN(__port, __bit, __mux, __cnf) \ > CYGHWR_HAL_KINETIS_PIN_CFG(__port, __bit, 0, __mux, __cnf) > Based on your example I expected some code for ISR handling. May, but doesn't have to be. Please check if your patch is complete. Ilija -- You are receiving this mail because: You are on the CC list for the bug.