PSOC3 using C51 lib

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi:

   

Using C51 Lib in Creator 1.0, printf() works as putchar() re-defined in main file.

   

But when re-define getchar() to implement scanf(), error happened:

   


*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
    SYMBOL:  GETCHAR
    MODULE:  C:\PROGRAM FILES\CYPRESS\PSOC CREATOR\1.0\PSOC CREATOR\IMPORT\KEIL\PK51\8.16\C51\LIB\C51L.LIB (GETCHAR)
    DEFINED:  E:\1_WaveDAC8_SimpleSine.cydsn\DP8051_Keil_816\Debug\main.OBJ (MAIN)

   

   Any idea about that ?

   

  Thanks very much.

0 Likes
4 Replies
Anonymous
Not applicable

Any reason why need to change name of libray function?

   

I don't think it is a good thing to rename library function. If I need to, I will do something like

   

 

   

char myPutChar(char ip)

   

{

   

    return putchar(ip);

   

}

   

then call myPutchar() later on.

0 Likes
Anonymous
Not applicable

Could you tell us why you are trying to do this ?

0 Likes
Anonymous
Not applicable

Thanks very much for your reply. 

   

Sure, it can be done by retargeting to a function named differently.  What puzzled me is the difference for retartgeting functions in Creator. In KEIL, both functions can be redefined directly.

   

Thanks.

0 Likes
Anonymous
Not applicable

For your question about my senario: getchar() can't be redefined in creator. So I can't use scanf() directly in Creator now.

0 Likes