diff --git a/vendor/lockzhiner/rk2206/samples/b4_lcd/include/lcd_font.h b/vendor/lockzhiner/rk2206/samples/b4_lcd/include/lcd_font.h index f9a9c8355d214cbc65e359385ddcc4e1084f39fd..5b94aeb5ca71c60db21e6537fbe79b437fba15ed 100755 --- a/vendor/lockzhiner/rk2206/samples/b4_lcd/include/lcd_font.h +++ b/vendor/lockzhiner/rk2206/samples/b4_lcd/include/lcd_font.h @@ -25,7 +25,8 @@ static inline uint32_t chinese_utf8_to_ascii(uint8_t *src, uint32_t src_len, uin { dst[offset] = src[i]; dst[offset + 1] = src[i+1]; - offset += 2; + dst[offset + 2] = src[i+2]; + offset += 3; } *dst_len = offset; @@ -439,7 +440,7 @@ const unsigned char ascii_3216[][64] = /* 定义中文字符 12*12 */ typedef struct { - unsigned char Index[2]; + unsigned char Index[3]; unsigned char Msk[24]; } typFNT_GB12; @@ -459,7 +460,7 @@ const typFNT_GB12 tfont12[] = /* 定义中文字符 16*16 */ typedef struct { - unsigned char Index[2]; + unsigned char Index[3]; unsigned char Msk[32]; } typFNT_GB16; @@ -480,7 +481,7 @@ const typFNT_GB16 tfont16[] = /* 定义中文字符 24*24 */ typedef struct { - unsigned char Index[2]; + unsigned char Index[3]; unsigned char Msk[72]; } typFNT_GB24; @@ -510,7 +511,7 @@ const typFNT_GB24 tfont24[] = /* 定义中文字符 32*32 */ typedef struct { - unsigned char Index[2]; + unsigned char Index[3]; unsigned char Msk[128]; } typFNT_GB32; diff --git a/vendor/lockzhiner/rk2206/samples/b4_lcd/src/lcd.c b/vendor/lockzhiner/rk2206/samples/b4_lcd/src/lcd.c index 383524a65b00fc399d1b0ebacfd8ea2f51ea5374..7a4df0b168fdbd193a5a3fda522d409c9a737a4d 100755 --- a/vendor/lockzhiner/rk2206/samples/b4_lcd/src/lcd.c +++ b/vendor/lockzhiner/rk2206/samples/b4_lcd/src/lcd.c @@ -160,7 +160,7 @@ static void lcd_show_chinese_12x12(uint16_t x, uint16_t y, uint8_t *s, uint16_t for (k = 0; k < HZnum; k++) { - if ((tfont12[k].Index[0] == *(s)) && (tfont12[k].Index[1] == *(s+1))) + if ((tfont12[k].Index[0] == *(s)) && (tfont12[k].Index[1] == *(s+1)) && (tfont12[k].Index[1] == *(s+2))) { lcd_address_set(x, y, x+sizey-1, y+sizey-1); for (i = 0; i < TypefaceNum; i++) @@ -236,7 +236,7 @@ static void lcd_show_chinese_16x16(uint16_t x, uint16_t y, uint8_t *s, uint16_t for (k = 0; k < HZnum; k++) { - if ((tfont16[k].Index[0] == *(s)) && (tfont16[k].Index[1] == *(s+1))) + if ((tfont16[k].Index[0] == *(s)) && (tfont16[k].Index[1] == *(s+1)) && (tfont16[k].Index[1] == *(s+2))) { lcd_address_set(x, y, x+sizey-1, y+sizey-1); for (i = 0; i < TypefaceNum; i++) @@ -313,7 +313,7 @@ static void lcd_show_chinese_24x24(uint16_t x, uint16_t y, uint8_t *s, uint16_t for (k = 0; k < HZnum; k++) { - if ((tfont24[k].Index[0] == *(s)) && (tfont24[k].Index[1] == *(s+1))) + if ((tfont24[k].Index[0] == *(s)) && (tfont24[k].Index[1] == *(s+1)) && (tfont24[k].Index[1] == *(s+2))) { lcd_address_set(x, y, x+sizey-1, y+sizey-1); for (i = 0; i < TypefaceNum; i++) @@ -390,7 +390,7 @@ static void lcd_show_chinese_32x32(uint16_t x, uint16_t y, uint8_t *s, uint16_t for (k = 0; k < HZnum; k++) { - if ((tfont32[k].Index[0] == *(s)) && (tfont32[k].Index[1] == *(s+1))) + if ((tfont32[k].Index[0] == *(s)) && (tfont32[k].Index[1] == *(s+1)) && (tfont32[k].Index[1] == *(s+2))) { lcd_address_set(x, y, x+sizey-1, y+sizey-1); for (i = 0; i < TypefaceNum; i++)