101 lines
2.1 KiB
C
101 lines
2.1 KiB
C
#include "zf_common_headfile.h"
|
|
#include "page_ui_widget.h"
|
|
#include "page.h"
|
|
|
|
#define LINE_HEAD 1
|
|
#define LINE_END 7
|
|
|
|
static char Text[] = "Reset";
|
|
|
|
static int8_t Curser = LINE_HEAD; // 定义光标位置
|
|
static int8_t Curser_Last = LINE_HEAD; // 定义光标位置
|
|
static void Print_Menu_p(void);
|
|
/***************************************************************************************
|
|
*
|
|
* 以下为页面模板函数
|
|
*
|
|
***************************************************************************************/
|
|
|
|
/**
|
|
* @brief 页面初始化事件
|
|
* @param 无
|
|
* @retval 无
|
|
*/
|
|
static void Setup()
|
|
{
|
|
ips200_clear();
|
|
Print_Menu_p();
|
|
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
|
}
|
|
|
|
/**
|
|
* @brief 页面退出事件
|
|
* @param 无
|
|
* @retval 无
|
|
*/
|
|
static void Exit()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @brief 页面循环执行的内容
|
|
* @param 无
|
|
* @retval 无
|
|
*/
|
|
static void Loop()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @brief 页面事件
|
|
* @param btn:发出事件的按键
|
|
* @param event:事件编号
|
|
* @retval 无
|
|
*/
|
|
static void Event(page_event event)
|
|
{
|
|
Curser_Last = Curser;
|
|
|
|
if (page_event_press_long == event) {
|
|
NVIC_SystemReset();
|
|
}else{
|
|
Page_Shift(page_menu);
|
|
}
|
|
|
|
if (Curser < LINE_HEAD) {
|
|
Curser = LINE_END;
|
|
} else if (Curser > LINE_END) {
|
|
Curser = LINE_HEAD;
|
|
}
|
|
|
|
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
|
}
|
|
|
|
/**
|
|
* @brief 页面注册函数
|
|
*
|
|
* @param pageID
|
|
*/
|
|
void PageRegister_page_reset(unsigned char pageID)
|
|
{
|
|
Page_Register(pageID, Setup, Loop, Exit, Event);
|
|
}
|
|
|
|
/***************************************************************************************
|
|
*
|
|
* 以下为页面自定义功能函数
|
|
*
|
|
***************************************************************************************/
|
|
|
|
/**
|
|
* @brief 打印菜单项
|
|
*
|
|
*/
|
|
static void Print_Menu_p(void)
|
|
{
|
|
ips200_show_string(0, 0, Text);
|
|
ips200_show_string(20, 20, "-> Long Press to Reset");
|
|
ips200_show_string(20, 60, "* Press other keys to");
|
|
ips200_show_string(20, 80, "return main menu");
|
|
}
|