Hi All,

I would like to set some macros in my include file:

#define SYSCLK 10000000L
...
#define UART0_BAUD_RATE 115200L
...
#define UART0_TH1 (32L*(SYSCLK)/(UART0_BAUD_RATE))

When I use UART0_TH1 it contains 32L, if I change order of element, it 
contains only the first element. For example:

#define UART0_TH1 ((SYSCLK)/(UART0_BAUD_RATE))
UART0_TH1 contains 10000000L
and
#define UART0_TH1 ((UART0_BAUD_RATE)/(SYSCLK))
UART0_TH1 contains 115200L

With cpp of gnu gcc  gives the correct (32L*(10000000L)/(115200L)) result.

My sdcc version is
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 
#5859 (Jun 25 2010) (Linux)

and I try to download sdcc 3.0 from sdcc-src-20101101-6037.tar.bz2, 
install it, but the error is remaining :(


What do I mistake?


-- 
  thx,
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: za...@vili.pmmf.hu
----------------------------------
       


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to