Hello all,
I think I need a little bit of advice!! At the moment I am working
on an AT-command interpreter. Mostly it does what it has to do (fortunately)
but when I try to do something special (saving the 'phonenumbers' from
source and destination (it's a little bit different from the normal
AT-commands)) it completely messes up!!
I am working with a 80c152, a derivative from the 8051 with some
extra communication hardware, which is currently not in use...
I have:
xdata unsigned char _xdata * source;
xdata unsigned char _xdata * dest;
At init, I do:
source = GetMem(12); // dynamic memory allocation
dest = GetMem(30); // works perfectly
but when using the program, there seem to be very weird things in these
buffers...I get the commands in there and however source and dest are
completely different, they are printed out twice when trying to look at the
contents...
e.g.:
ATB1
OK
ATC? --> give what's in source and dest
SRC : C?
DEST : C?
OK --> but not OK :-(
ATCON1DOA-0. --> put ON1DOA-0 in source
OK
ATC?
SRC : C?
DOA-0
DEST : C?
DOA-0
OK --> absolutely NOT OK
ATDTON0BWP-0. --> put ON0BWP-0. in dest
CONNECT
--> so he goes ONLINE, but when trying to print the contents of both source
and
dest, it gives me:
ON0BWP-0
ON0BWP-0
?????????????????????????????
Who can explain me this.
EXTRA: I have to compile with the --xstack option.
* when I do sdcc --model-large ATCOMMAND.c it gives an *.ihx file of about
13k, but which doesn't do a thing!!!
* when I do sdcc --model-large --xstack ATCOMMAND.c it gives an *.ihx file of
about 18k, much larger but goes wrong when using the pointers...
Greetings,
Jan
Jan Van Belle
E-mail: Jan...@ad...
HAM-mail: on...@on...
|