Today, I try to save the array to flash, read it again, and modify it on the original 5110 project. Can you tell where I changed it?
Uint8 chinese_font [] [25] progmem =
{
/* -- Text: Wu --*/
/* -- 9 9; the dot matrix corresponding to this font is: width x Height = 12x12 --*/
/* -- The height is not a multiple of 8, and is adjusted to: width x Height = 12x16 --*/
{
0 x, 0 x, 0x48, 0xde, 0xfe, 0xf4, 0xfe, 0 x, 0x24, 0 x, 0 x, 0 x, 0 X,
0x01,0x03,0x03,0x02,0x02,0x02,0x03,0x00
},
// Omit other definitions
Two files to be modified:
/*************************************** ********************
** Name: void LCD _write_char (uint8 C)
** Power: Write a character
** Entry parameter: the character to be written by C.
** Exit parameter: None
** Usage instructions: None
**************************************** ******************/
Void LCD _write_char (uint8 C)
{
Uint8 line = 0;
C-= 32;
For (line = 0; line <6; line ++)
{
LCD _write_byte (pgm_read_byte (& assic_font [C] [line]), 1 );
}
}
/*************************************** ********************
** Name: void LCD _write_chinese_string (uint8 X, uint8 y, uint8 ch_with,
** Uint8 num, uint8 s [] [], uint8 line, uint8 row)
** Function: write Chinese sentences to specified coordinates
** Entry parameters: Coordinates set by X and Y
** Ch_with the width of Chinese Characters
** Number of num Chinese Characters
** S Array
** Line starts from the first line
** The width between the row and the word
** Exit parameter: None
** Usage instructions: None
**************************************** ******************/
Void LCD _write_chinese_string (uint8 X, uint8 y, uint8 ch_with,
Uint8 num, uint8 s [] [], uint8 line, uint8 row)
{
Uint8 I = 0;
Uint8 n = 0;
Uint8 (* Catch) [25] = s;
LCD _set_xy (x, y );
/* Write a string */
For (I = 0; I <num ;)
{
For (n = 0; n <ch_with * 2; n ++)
{
If (n = ch_with)
{
If (I = 0)
{
LCD _set_xy (X, Y + 1 );
}
Else
{
LCD _set_xy (x + (ch_with + row) * I), Y + 1 );
}
}
// Read data from flash
LCD _write_byte (pgm_read_byte (& catch [LINE + I] [N]), 1 );
}
I ++;
LCD _set_xy (x + (ch_with + row) * I), y );
}
}