From: zamek <za...@vi...> - 2010-11-02 07:48:30
|
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...@vi... ---------------------------------- |