刚刚用IAR搭起来ML51的环境,编译sample code时,发现每次编译到printf,就报如下错误:
Error[Pe167]: argument of type "char __code *" is incompatible with parameter of type "char const *"
代码就是Nuvoton提供的参考代码,例如:
#include "ML51_IAR.h"
/******************************************************************************
The main C function. Program execution starts
here after stack initialization.
******************************************************************************/
void main (void)
{
MFP_P31_UART0_TXD; //Setting P31 multi function pin as TXD
P31_PUSHPULL_MODE; //Output mode for TXD
UART_Open(24000000,UART0_Timer3,115200);
ENABLE_UART0_PRINTF;
ADC_INPUT_VBG; //Find in "Function_define.h" - "ADC INIT"
while(1)
{
clr_ADCCON0_ADCF;
set_ADCCON0_ADCS; // Each time ADC start trig signal
while(ADCCON0&0x10 == 0);
printf ("\n Value = 0x%bx",ADCRH);
printf ("\n Value = 0x%bx",ADCRL);
// Timer2_Delay(24000000,128,200,1000);
_nop_();
}
}
哪位老大给指点一下,多谢! |