//显示器件的信息,需要LCD的支持,主要使显示了器件的IEEE地址<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
zmain_dev_info();
static ZSEG void zmain_dev_info ( void )
{
#ifdef LCD_SUPPORTED
uint8 i;
uint8 ch;
uint8 *xad;
unsigned char lcd_buf[18];
//显示扩展地址
xad = (uint8*)&aExtendedAddress + Z_EXTADDR_LEN - 1;
for ( i = 0; i < Z_EXTADDR_LEN*2; xad-- ) {
ch = (*xad >> 4) & 0x<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0F;
lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');
ch = *xad & 0x0F;
lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');
}
lcd_buf[Z_EXTADDR_LEN*2] = '\0';
HalLcdWriteString( "IEEE Address:", HAL_LCD_LINE_1 );
HalLcdWriteString( (char*)lcd_buf, HAL_LCD_LINE_2 );
#endif // LCD
}
文章评论(0条评论)
登录后参与讨论