Example #1
0
/**************************************************************************************************
作用    向指定行写入一串字符串
参数1   line。范围1~8
参数2   pText。待显示的字符串
 **************************************************************************************************/
void HalLcd_HW_WriteLine(uint8 line, const char *pText)
{
  uint8 count;
  uint8 totalLength = (uint8)osal_strlen( (char *)pText );
  /* Write the content first */
  for (count=0; count<totalLength; count++)
  {
    HalLcd_HW_WriteChar(line, count, (*(pText++)));
  }

  /* Write blank spaces to rest of the line */
  for(count=totalLength; count<LCD_MAX_LINE_LENGTH;count++)
  {
    HalLcd_HW_WriteChar(line, count, 0x00);
  }
}
Example #2
0
/*********************************************************************
 * 函数名称:HalLcd_HW_WriteLine
 * 功    能:LCD显示一行字符串
 * 入口参数:line  要显示的字符的行位置
 *           pText 要显示的字符串
 * 出口参数:无
 * 返 回 值:无
 ********************************************************************/
void HalLcd_HW_WriteLine(unsigned char line, const char *pText)
{
  unsigned char count;
  unsigned char totalLength = (unsigned char)strlen((char *)pText);

  /* 首先写入字符 */
  for (count=0; count<totalLength; count++)
  {
    HalLcd_HW_WriteChar(line, count, (*(pText++)));
  }

  /* 在尾部写入空白 */
  for(count=totalLength; count<LCD_MAX_LINE_LENGTH;count++)
  {
    HalLcd_HW_WriteChar(line, count, ' ');
  }
}