const unsigned char Menu[2][6][9] =
{
{"0.00 BAR", "0.25 BAR", "0.50 BAR", "0.75 BAR", "1.00 BAR", " EXIT "}
,
{"0.00 BAR", "0.50 BAR", "1.00 BAR", "1.50 BAR", "2.00 BAR", " EXIT "}
};
Nota: same texte width in the menu !
// --- Copie le texte depuis FLASH ROM vers RAM
void strConstRamCpy(unsigned char *dest, const code char *source)
{
while (*source)*dest++ = *source++ ;
*dest = 0 ; // terminateur
}
void main()
{
....init Hardware & UART1
UART1_Write_CText("Menu 1 :\r\n");
for (i=0;i<6;i++)
{
strConstRamCpy(txt,Menu[0][i]) ; // --- Copie le texte depuis FLASH ROM vers RAM
UART1_Write_Text(txt) ;
CRLF1();
}
CRLF1();
UART1_Write_CText("Menu 2 :\r\n");
for (i=0;i<6;i++)
{
strConstRamCpy(txt,Menu[1][i]) ;
UART1_Write_Text(txt) ;
CRLF1();
}
while(1);
}