From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2670 invoked by alias); 25 Jun 2005 13:10:46 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 2643 invoked by uid 22791); 25 Jun 2005 13:10:38 -0000 Received: from norbert.ecoscentric.com (HELO smtp.ecoscentric.com) (194.153.168.165) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 25 Jun 2005 13:10:38 +0000 Received: by smtp.ecoscentric.com (Postfix, from userid 99) id DB0C465C0B8; Sat, 25 Jun 2005 14:10:36 +0100 (BST) Received: from delenn.bartv.net (localhost [127.0.0.1]) by smtp.ecoscentric.com (Postfix) with ESMTP id A10AB65C0A4; Sat, 25 Jun 2005 14:10:35 +0100 (BST) To: clifford.joseph@clarinox.com Cc: ecos-discuss@ecos.sourceware.org In-reply-to: <2415853226aa4e9ea1789842461c7ae1.clifford.joseph@clarinox.com> From: Bart Veer References: <2415853226aa4e9ea1789842461c7ae1.clifford.joseph@clarinox.com> Message-Id: <20050625131035.A10AB65C0A4@smtp.ecoscentric.com> Date: Sat, 25 Jun 2005 13:10:00 -0000 Subject: Re: [ECOS] i2c bit-banging implementation X-SW-Source: 2005-06/txt/msg00258.txt.bz2 >>>>> " " == writes: > I am trying to implement an i2c transfer by bit-banging > It still returns the same error when I compile > The error is > parse error before ?.? token > Looking at the varios instances where the CYG_HAL_TABLE_ENTRY > has been used in the other files it has been implemented in > this way. Example: > cyg_httpd_table_entry __name CYG_HAL_TABLE_ENTRY( httpd_table ) = > { __pattern, __handler, __arg } > where __pattern, __handler, __arg are the arguments passed on to the httpd_table > Can somebody help me regarding this > Has anybody been successful in implementing a bit-banging using the i2c package > Any idea why there is an error ? > parse error before ?.? Token Yes, there have been successful implementations of the bit-bang code. In fact the first ever I2C driver used bit-banging. There is no significant difference between the cyg_httpd_table_entry macro and the I2C bus one. The latter uses a gcc extension called Designated Initializers, http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Designated-Inits.html#Designated%20Inits The aim is to allow the cyg_i2c_bus structure to be changed in future, including adding new fields at the start or in the middle of the structure, without invalidating existing instances of the CYG_I2C_BUS() macro. Unfortunately it is not possible to tell from the error message exactly what the problem is. To confuse things further I suspect the original email has been garbled somewhere along the way. I suggest you try compiling the source code in two steps. First use gcc -E to just run the preprocessor on the file. Then compile the resulting file normally. This should give you a line number for the parse error, and a matching source file without the potentially confusing macros. Bart -- Bart Veer eCos Configuration Architect http://www.ecoscentric.com/ The eCos and RedBoot experts -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss