今天尝试移植原子的USMART到STM8上,但是移植到最后一步,函数名列表初始化的时候,IAR编译报错了,报错如下:
Error[Pa128]: truncating cast in constant expression
出错代码是在usmart_config.c里,如下:
[mw_shl_code=c,true]struct _m_usmart_nametab usmart_nametab[]=
{
#if USMART_USE_WRFUNS==1 //如果使能了读写操作
#endif
(void*)Set_Charge_Current,"void Set_Charge_Current(u16 curr)",
(void*)Charge_Enable,"void Charge_Enable(u8 STATUS);",
(void*)LDO_Enable,"void LDO_Enable(u8 STATUS);",
(void*)OTG_Enable,"void OTG_Enable(u8 STATUS)",
}; [/mw_shl_code]
这几个函数都放在了main.c里,在main.h中做了声明,usmart_config.c也include了main.h
请问,问题可能出现在哪里呢?
|