我的一段51液晶程序如下
/**
* @brief Êý¾Ý½»»»£¬×Ô¶¯Éú³ÉÒº¾§ÐèÒªµÄÊý×飬´Ë³ÌÐò£¬ÐèÒª¸ù¾ÝÒº¾§Í¼Ö½ÐÞ¸Ä
* @param None
* @retval None
*/
const unsigned char LED_Tab[]=
{
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71, //0-15 = 0--f
0x58, //16=c
0x37, //17=N
0x40, //18=-
0x0E, //19=J
0x3E, //20=U
0x76, //21=H
0x30, //22=I
};
unsigned char LCD_RAM_Tab[sizeof(LED_Tab)];
#define LCD_A 0x01
#define LCD_B 0x02
#define LCD_C 0x04
#define LCD_D 0x08
#define LCD_E 0x10
#define LCD_F 0x20
#define LCD_G 0x40
#define LCD_P 0x80
void HT1621_num_init(void)
{
unsigned char num,LCD_data;
for(num=0; num<sizeof(LED_Tab); num++)
{
LCD_data = 0;
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_P)) << 7);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_E)) << 6);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_F)) << 5);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_A)) << 4);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_D)) << 3);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_C)) << 2);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_G)) << 1);
LCD_data = LCD_data | ((unsigned char)((bit)(LED_Tab[num] & LCD_B)) << 0);
LCD_RAM_Tab[num] = LCD_data;
}
}
有关键字bit
移植到PIC单片机里,有错误。
LCD.c:350:43: error: use of undeclared identifier 'bit'
请问高手,我该如何修改程序呢?谢谢!
|