uvision 2 v2.40, c51 v7.09, bl51 v5.03 gives: *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?IS_OK_INC_DTARGET_SPD?SPDLIM spdlim.c has bit IS_OK_INC_DTARGET_SPD( void ) which returns a bit. (1) how do I fix this?
Forgot to mention that the a51 file that calls the C file has: EXTRN CODE ( IS_OK_INC_DTARGET_SPD ) If a C file (instead of the A51 file) calls IS_OK_INC_DTARGET_SPD(), there are no warnings or errors. If I change 'code' to 'bit', i.e., EXTRN BIT ( IS_OK_INC_DTARGET_SPD ) there is an a51 A46 CODE-ADDRESS EXPECTED error.
Have you got the naming convention correct? C51 puts various prefixes on the generated name to indicate things like return type & register usage - check the Manual Or, try writing a dummy call in 'C', and see what assembler it generates.
The lst gives: IS_OK_INC_DTARGET_SPD. PUBLIC CODE PROC 0000H ----- and the link map shows CODE 35A8H 0096H INBLOCK ?PR?IS_OK_INC_DTARGET_SPD?SPDLIM for the PRogram part and BIT 0020H.3 0000H.1 UNIT ?BI?IS_OK_INC_DTARGET_SPD?SPDLIM which, I assume, is for the return value. By the way, I read the C manual (Bit Types, p. 98 and Func. Return Values, p. 120) before my original post. I did not see any special note or warning for interfacing C to assy where the return value from a C function is BIT. Am I missing something?
View all questions in Keil forum