Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > PSOC3 using C51 lib

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



PSOC3 using C51 lib
Moderator:
RKRM

Post Reply
Follow this topic



PSOC3 using C51 lib

Schurtz posted on 30 Nov 2011 5:42 PM PST
Top Contributor
23 Forum Posts

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.




Re: PSOC3 using C51 lib

H L posted on 30 Nov 2011 07:55 PM PST
Top Contributor
679 Forum Posts

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.

 

 

 

 



Re: PSOC3 using C51 lib

U2 posted on 30 Nov 2011 09:17 PM PST
Cypress Employee
589 Forum Posts

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



Re: PSOC3 using C51 lib

Schurtz posted on 01 Dec 2011 06:07 PM PST
Top Contributor
23 Forum Posts

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.

 



Re: PSOC3 using C51 lib

Schurtz posted on 01 Dec 2011 06:20 PM PST
Top Contributor
23 Forum Posts

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






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20