原始版本
This commit is contained in:
75
Menu/src/menu.c
Normal file
75
Menu/src/menu.c
Normal file
@ -0,0 +1,75 @@
|
||||
#include "menu_pack_port.h"
|
||||
|
||||
rt_uint8_t MenuPack_GetKey(void);
|
||||
int MenuPack_WaitKey(int delay_ms)
|
||||
{
|
||||
int key = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < delay_ms; i++)
|
||||
{
|
||||
key = MenuPack_GetKey();
|
||||
if (key != 0)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
rt_thread_mdelay(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MenuPack_GotoLine(int disp_line, int disp_col)
|
||||
{
|
||||
if (disp_line == MENU_TITLE_LINE)
|
||||
{
|
||||
//MenuPack_DisplayStringPos(disp_line, disp_col, DEFAULT_EMPTY_STRING);
|
||||
}
|
||||
else if (disp_line == MENU_PREV_TITLE_LINE)
|
||||
{
|
||||
//MenuPack_DisplayStringPos(disp_line, disp_col, DEFAULT_EMPTY_STRING);
|
||||
}
|
||||
else if (disp_line == MENU_NEXT_TITLE_LINE)
|
||||
{
|
||||
//MenuPack_DisplayStringPos(disp_line, disp_col, DEFAULT_EMPTY_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuPack_DisplayString(const char *str)
|
||||
{
|
||||
MenuPack_DisplayStringPos(MENU_TITLE_LINE, MENU_PACK_TFT_PORT, str);
|
||||
}
|
||||
|
||||
void MenuPack_DisplayStringSelect(const char *str)
|
||||
{
|
||||
MenuPack_DisplayStringPosSelect(MENU_TITLE_LINE, MENU_PACK_TFT_PORT, str);
|
||||
}
|
||||
|
||||
void MenuPack_DisplayTitleString(const char *str)
|
||||
{
|
||||
MenuPack_DisplayStringPos(MENU_TITLE_LINE, MENU_PACK_TFT_PORT, str);
|
||||
}
|
||||
void MenuPack_DisplayPrevTitleString(const char *str)
|
||||
{
|
||||
MenuPack_DisplayStringPos(MENU_PREV_TITLE_LINE, MENU_PACK_TFT_PORT, str);
|
||||
}
|
||||
void MenuPack_DisplayNextTitleString(const char *str)
|
||||
{
|
||||
MenuPack_DisplayStringPos(MENU_NEXT_TITLE_LINE, MENU_PACK_TFT_PORT, str);
|
||||
}
|
||||
|
||||
void MenuPack_DisplayStringPos(int disp_line, int disp_col, const char *str)
|
||||
{
|
||||
MenuPack_GotoLine(disp_line, disp_col);
|
||||
MenuPack_DisplayString(str);
|
||||
}
|
||||
|
||||
void MenuPack_DisplayStringPosSelect(int disp_line, int disp_col, const char *str)
|
||||
{
|
||||
MenuPack_GotoLine(disp_line, disp_col);
|
||||
MenuPack_DisplayStringSelect(str);
|
||||
}
|
||||
|
||||
void MenuPack_DisplayPage(int page)
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user