gribas
Joined: 21 Feb 2008 Posts: 21
|
|
Posted: Wed Aug 13, 2008 7:48 am |
|
|
I don't think that's possible. The compiler expects a constant for the first parameter of fprintf();
this works, but it's kinda useless:
Code: |
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=SERIAL)
void main() {
const int stream = SERIAL;
fprintf(stream,"test");
}
|
What about defining a debug stream? Like this:
Code: |
#device PASS_STRINGS=IN_RAM
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=SERIAL)
#define DEBUG_STREAM SERIAL
void debug(char* msg) {
fprintf(DEBUG_STREAM,"%s",msg);
}
void main() {
debug("test");
}
|
|
|