我现在想使用这两个函数
1 int fputc(int ch, FILE *f)// 发送数据{
/* Place your implementation of fputc here */
/* 实现 fputc函数 */
/* e.g. 写一个字符到USART */
USART_SendData(USART2, (uint8_t) ch);
/* Loop until the end of transmission */
while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET)
{
}
return ch;
}
2 PUTCHAR_PROTOTYPE {
sFONT *cFont = LCD_GetFont();
uint32_t idx;
if(LCD_Lock == DISABLE)
{
if((LCD_ScrollActive == ENABLE)||(LCD_ScrollActive == ENABLE))
{
LCD_CacheBuffer_yptr_bottom = LCD_CacheBuffer_yptr_bottom_bak;
LCD_CacheBuffer_yptr_top = LCD_CacheBuffer_yptr_top_bak;
LCD_ScrollActive = DISABLE;
LCD_Scrolled = DISABLE;
LCD_ScrollBackStep = 0;
}
if(( LCD_CacheBuffer_xptr < LCD_PIXEL_WIDTH /cFont->Width ) && ( ch != '\n'))
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
}
else
{
if(LCD_CacheBuffer_yptr_top >= LCD_CacheBuffer_yptr_bottom)
{
if(LCD_CacheBuffer_yptr_invert == DISABLE)
{
LCD_CacheBuffer_yptr_top++;
if(LCD_CacheBuffer_yptr_top == LCD_CACHE_DEPTH)
{
LCD_CacheBuffer_yptr_top = 0;
}
}
else
{
LCD_CacheBuffer_yptr_invert= DISABLE;
}
}
for(idx = LCD_CacheBuffer_xptr ; idx < LCD_PIXEL_WIDTH /cFont->Width; idx++)
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = ' ';
}
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].color = LCD_LineColor;
LCD_CacheBuffer_xptr = 0;
LCD_LOG_UpdateDisplay ();
LCD_CacheBuffer_yptr_bottom ++;
if (LCD_CacheBuffer_yptr_bottom == LCD_CACHE_DEPTH)
{
LCD_CacheBuffer_yptr_bottom = 0;
LCD_CacheBuffer_yptr_top = 1;
LCD_CacheBuffer_yptr_invert = ENABLE;
}
if( ch != '\n')
{
LCD_CacheBuffer[LCD_CacheBuffer_yptr_bottom].line[LCD_CacheBuffer_xptr++] = (uint16_t)ch;
}
}
}
return ch;
}
错误是.\STM324xG-EVAL\STM324xG-EVAL_HS.axf: Error: L6200E: Symbol fputc multiply defined (by lcd_log.o and main.o).
我看了一下stdio.h,发现这种定义的格式是不允许改变的,但是我想两个函数都使用,怎么办呢???
求大神!!!
|