public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: Re: [ECOS] i2c bit-banging implementation
@ 2005-07-01  5:10 clifford.joseph
  2005-07-01  7:13 ` Andrew Lunn
  2005-07-02 16:10 ` Bart Veer
  0 siblings, 2 replies; 3+ messages in thread
From: clifford.joseph @ 2005-07-01  5:10 UTC (permalink / raw)
  To: Bart Veer; +Cc: ecos-discuss

Thank you for the reply

I am sending you the exact information printed after compiling

L2CapDataClientMain.cpp is where main() is

i have compiled the code with g++ -E -g 

this is the message i get 


arm-elf-g++ -L/opt/ecos/gnutools/arm-elf/arm-elf/lib -L../../../Lib -L/opt/ecos/
work/ram_debug/ram_debug_install/lib -Ttarget.ld -nostdlib -mcpu=arm7tdmi -mno-s
hort-load-words -nostartfiles -Wl,-static -Wl,-Map,map_file -Wl,--gc-sections -O
1 -E -g  -o L2capDataClient L2capDataClient.o L2capDataClientMain.o BoardSpecifi
c.o  -lprofiles -lapi -lsofttools -lstack -ltransport -lportability -lcommon

arm-elf-g++: -static: linker input file unused because linking not done
arm-elf-g++: -Map: linker input file unused because linking not done
arm-elf-g++: map_file: linker input file unused because linking not done
arm-elf-g++: --gc-sections: linker input file unused because linking not done
arm-elf-g++: L2capDataClient.o: linker input file unused because linking not don
e
.........(for all files)

Does this mean that there are no errors after compilation of preprocessors?


i have compiled the code with g++ -g  (as our usual compilation)

arm-elf-g++ -c -o L2capDataClientMain.o -I/opt/ecos/work/ram_debug/ram_debug_ins
tall/include -I. -I/opt/ecos/gnutools/arm-elf/arm-elf/include -I. -I/opt/ecos/gn
utools/arm-elf/arm-elf/include/arm-elf -fno-exceptions -Wall -Wno-deprecated -Wi
mplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wparentheses -Wpointer-arith
-Wmissing-prototypes -mstructure-size-boundary=8 -mcpu=arm7tdmi -mno-short-load-
words -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ffunction-secti
ons -fdata-sections -fno-rtti -finit-priority -O1 -g  -I. -I../../../System/Audi
o -I../../../System/Api -I../../../System/Common -I../../../System/Profiles -I..
/../../System/SoftTools -I../../../System/Stack -I../../../System/Transport -I..
/../../System/Portability L2capDataClientMain.cpp
L2capDataClientMain.cpp: In function `int main(int, char**)':
L2capDataClientMain.cpp:56: parse error before `.' token
L2capDataClientMain.cpp:56: warning: unused variable `cyg_i2c_device
   cyg_i2c_eeprom'
L2capDataClientMain.cpp: At global scope:
L2capDataClientMain.cpp:113: conflicting types for `
   cyg_i2c_bus&hal_alaia_i2c_bus'
L2capDataClientMain.cpp:45: previous declaration as `cyg_i2c_bus
   hal_alaia_i2c_bus'
L2capDataClientMain.cpp:113: parse error before `.' token
L2capDataClientMain.cpp:113: ISO C++ forbids use of initializer list to
   initialize reference `hal_alaia_i2c_bus'
L2capDataClientMain.cpp:74: warning: `cyg_bool
   hal_alaia_i2c_bitbang(cyg_i2c_bus*, cyg_i2c_bitbang_op)' defined but not
   used
make: *** [L2capDataClientMain.o] Error 1



I am not sure of what this error is referring to 

L2capDataClientMain.cpp:113: ISO C++ forbids use of initializer list to
   initialize reference `hal_alaia_i2c_bus'

the code at this line is

   CYG_I2C_BITBANG_BUS( &hal_alaia_i2c_bus, &hal_alaia_i2c_bitbang);

Thank you

Clifford



----- Original Message -----
From: Bart Veer [mailto:bartv@ecoscentric.com]
Sent: 6/25/2005 11:10:35 PM
To: clifford.joseph@clarinox.com
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] i2c bit-banging implementation

> >>>>> " " ==   <clifford.joseph@clarinox.com> writes:

> 

>      > I am trying to implement an i2c transfer by bit-banging

>      <snip>

> 

>      > It still returns the same error when I compile

>      > The error is

>      > parse error before ?.? token

> 

>      <snip>

> 

>      > 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

> 

> 


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [ECOS] i2c bit-banging implementation
  2005-07-01  5:10 Re: [ECOS] i2c bit-banging implementation clifford.joseph
@ 2005-07-01  7:13 ` Andrew Lunn
  2005-07-02 16:10 ` Bart Veer
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2005-07-01  7:13 UTC (permalink / raw)
  To: clifford.joseph; +Cc: Bart Veer, ecos-discuss

On Fri, Jul 01, 2005 at 03:09:38PM +1000, clifford.joseph@clarinox.com wrote:
> Thank you for the reply
> 
> I am sending you the exact information printed after compiling
> 
> L2CapDataClientMain.cpp is where main() is
> 
> i have compiled the code with g++ -E -g 

I suggest you read the documentation for -E. You might then understand
why Bart suggested you use it.

        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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] i2c bit-banging implementation
  2005-07-01  5:10 Re: [ECOS] i2c bit-banging implementation clifford.joseph
  2005-07-01  7:13 ` Andrew Lunn
@ 2005-07-02 16:10 ` Bart Veer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Veer @ 2005-07-02 16:10 UTC (permalink / raw)
  To: clifford.joseph; +Cc: ecos-discuss

>>>>> "Clifford" ==   <clifford.joseph@clarinox.com> writes:

    Clifford> Thank you for the reply
    Clifford> I am sending you the exact information printed after
    Clifford> compiling

    Clifford> L2CapDataClientMain=2Ecpp is where main() is

    Clifford> i have compiled the code with g++ -E -g

    Clifford> this is the message i get

    <snip>

As Andrew has already said, this is not exactly what I had in mind.

However I think I have now figured out what the problem is. The I2C
macros use the gcc designated inits language extension, and it turns
out that g++ does not implement this extension, This is a rather
unfortunate discrepancy, but may be inevitable because of the
differences in language syntax. If I try to instantiate an I2C bus or
device in C++ code I get errors like:

  i2c.cxx:154: error: expected primary-expression before '.' token

Not quite the error message you are seeing, but we may be using
different versions of the compiler.

The solution for now is to instantiate the I2C bus and devices in C
code instead of C++.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-02 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-01  5:10 Re: [ECOS] i2c bit-banging implementation clifford.joseph
2005-07-01  7:13 ` Andrew Lunn
2005-07-02 16:10 ` Bart Veer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).