#define x2 1
#define baud 19200
#define xtal 22118400
#if (x2 == 1)
CLKREG = 0x01;
CLKREG = 0x00;
Now I need the power function ( … 2^x2 … 2**x2 …. potenz(2;x2) ….. ????)
Is there a way to solve this problem for the following calculation?
BRL = 256-(xtal/baud/192) * 2^x2 ; <- thats wrong
(It's for a AT89S8253)
Thanks for ideas, help & answers
There is no power of operator in C. There is a pow function but that won't help here.
But I guess x2 can have only two values so I'm sure you can think of a different formula.
Thanks for the answer, Maarten.
Yes, this example is simple.
Okay, I can write the function twice.
But a pow equivalent could be a fine function ;-)