gnupic: Thread: CVS GPASM Preprocessor problem


[<<] [<] Page 1 of 1 [>] [>>]
Subject: CVS GPASM Preprocessor problem
From: "James A. Cleland" ####@####.####
Date: 3 Sep 2007 23:31:49 +0100
Message-Id: <030601c7ee7a$32e2be90$1e01a8c0@jamescleland.com>

Hi,
 
I'm having trouble with unpredictable output from the following preprocessor
macro, which is designed to calculate an 8 or 16-bit BRG value:
 
#define __CALCBAUD   ((_FOSC/(.4*_SER_HIGHM*_SER_16BITM)*_SER_BAUD)-.1)
 
_FOSC = .8000000
_SER_HIGHM = .4
_SER_16BITM = .1
 
When _SER_BAUD is .38400, I'm expecting the result to be _ 
 
HIGH __CALCBAUD evaluates to .191
LOW __CALCBAUD evaluates to .255
 
Is this macro too complicated for gpasm? Am I doing something wrong here?
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.