Is Tmp(1) supposed to be Tmp[1]? And it isn't clear about what you are trying to do with that part of the statement. Is there a missing operator? (+ or *)?
Regards,
Charlie H.
Science has proven what cat owners have always known - cats can understand what we say, the just don't care.
It is the error.
Thank you.
I'm learning a little at a time.Thank you again.
Should create a WORD long with two integer variables they read MSB and LSB of the response form for each axis.
Axis = (MSB << 8) | LSB
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is only the float variant atan2f() available; double support is probably not available for pic14. To make user of this library routine, you need to link with libm.lib, e.g., by using
sdcc (options) (file names) -lm
Note that devices with enhanced cores (those that link with libsdcce.lib rather than libsdcc.lib) need to link with libme.lib instead of libm.lib and thus need to use -lme instead of -lm.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks.
to conclude.
how can I send a long value with the sign through a serial port.
in GCBasic was StrPrint function to convert a long value into a string.
thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks. to conclude. how can I send a long value with the sign
through a serial port. in GCBasic was StrPrint function to convert
a long value into a string. thanks in advance.
snprintf() or similar an be used to onvert a long into a string.
Philipp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
I'm sorry to inform you that the C standard library is basically not available for SDCC/pic14 targets. You will have to implement ltoa() or sprintf() yourself (or grab existing code and compile it along with your project).
Regarding the error, the complete error message in my recreated test case is
ltoa.c:9: error 47: indirections to different types assignment
from type 'void fixed'
to type 'char generic* fixed'
which even tells us that _ltoa does return void, which cannot be assigned to char *.
Let me state again that the pic14 backends do not have a libc implementation available. stdio.h and stdlib.h (and _ltoa()) are taken from the default SDCC libc, which is not used/implemented for pic14. You need to provide the conversion routines in your own code. You can try to copy the code from SDCC's _ltoa() (and _ultoa()) implementations by downloading SDCC source archives and looking at device/lib/_ltoa.c.
Raphael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is?
I'm writing a code to communicate with a module HMC5883L(already working with GCBasic).
long EjeX,EjeZ,EjeY;
............................
EjeX=(X_Tmp[0]<<8)|X_Tmp(1);
EjeZ=(Z_Tmp[0]<<8)|Z_Tmp(1);
EjeY=(Y_Tmp[0]<<8)|Y_Tmp(1);
these last three lines in a void i give two error for each lines
error 12: called object is not a function
error 47: indirections to different types assignament
What am I doing wrong??
Alejandro,
Is Tmp(1) supposed to be Tmp[1]? And it isn't clear about what you are trying to do with that part of the statement. Is there a missing operator? (+ or *)?
Regards,
Charlie H.
Science has proven what cat owners have always known - cats can understand what we say, the just don't care.
From: alejandro1957 alejandro1957@users.sf.net
To: [sdcc:discussion] 1865@discussion.sdcc.p.re.sf.net
Sent: Monday, April 28, 2014 3:08 PM
Subject: [sdcc:discussion] error 12 called objet is not a function
What is?
I'm writing a code to communicate with a module HMC5883L(already working with GCBasic).
long EjeX,EjeZ,EjeY;
............................
EjeX=(X_Tmp[0]<<8)|X_Tmp(1);
EjeZ=(Z_Tmp[0]<<8)|Z_Tmp(1);
EjeY=(Y_Tmp[0]<<8)|Y_Tmp(1);
these last three lines in a void i give two error for each lines
error 12: called object is not a function
error 47: indirections to different types assignament
What am I doing wrong??
error 12 called objet is not a function
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/sdcc/discussion/1865/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
It is the error.
Thank you.
I'm learning a little at a time.Thank you again.
Should create a WORD long with two integer variables they read MSB and LSB of the response form for each axis.
Axis = (MSB << 8) | LSB
yet another question.
there is a function Atan2 at SDCC?
There is only the
float
variantatan2f()
available;double
support is probably not available for pic14. To make user of this library routine, you need to link with libm.lib, e.g., by usingsdcc (options) (file names) -lm
Note that devices with enhanced cores (those that link with
libsdcce.lib
rather thanlibsdcc.lib
) need to link withlibme.lib
instead oflibm.lib
and thus need to use-lme
instead of-lm
.thanks.
to conclude.
how can I send a long value with the sign through a serial port.
in GCBasic was StrPrint function to convert a long value into a string.
thanks in advance.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01.05.2014 19:56, alejandro1957 wrote:
snprintf() or similar an be used to onvert a long into a string.
Philipp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iEYEARECAAYFAlNijrQACgkQbtUV+xsoLpo6pgCeJY28/oVCDAbe5l1biS/L1zXI
Zc0An3vndd5kH17I3S7c3MDSaPuGbKyr
=62wa
-----END PGP SIGNATURE-----
okay.
but I have seen the function _ltoa (unsigned long, char *, unsigned char) in the library stdlib.h
I did not understand how to use it.
I wrote two lines to test this function
and gives me this error:
error 47: indirections to different types assignment
where am I wrong?
Last edit: Raphael Neider 2014-05-01
I'm sorry to inform you that the C standard library is basically not available for SDCC/pic14 targets. You will have to implement
ltoa()
orsprintf()
yourself (or grab existing code and compile it along with your project).Regarding the error, the complete error message in my recreated test case is
which even tells us that
_ltoa
does returnvoid
, which cannot be assigned tochar *
.Let me state again that the pic14 backends do not have a libc implementation available.
stdio.h
andstdlib.h
(and_ltoa()
) are taken from the default SDCC libc, which is not used/implemented for pic14. You need to provide the conversion routines in your own code. You can try to copy the code from SDCC's_ltoa()
(and_ultoa()
) implementations by downloading SDCC source archives and looking atdevice/lib/_ltoa.c
.Raphael
ok, thanks