Menu_Interface.c 26.3 KB
Newer Older
时昊's avatar
时昊 committed
1

时昊's avatar
时昊 committed
2 3 4 5 6 7
#include "Menu.h"
#include "Components.h"

/*-------------------Logic_Operation Call Back---------------------*/
uint8_t g_u8Cursor_Posittion;
extern _Menu_Data MenuData;
8
void Menu_Logic_Operation_MAIN_ITEM(Menu_Key_en_t enKeyType);   
时昊's avatar
时昊 committed
9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
void Menu_Logic_Operation_Display_Mode(Menu_Key_en_t enKeyType);   			
void Menu_Logic_Operation_Backlight_Setting(Menu_Key_en_t enKeyType);   	
void Menu_Logic_Operation_Bluetooth_Connect(Menu_Key_en_t enKeyType);   	
void Menu_Logic_Operation_Clock_Setting(Menu_Key_en_t enKeyType);  	  		
void Menu_Logic_Operation_Unit_Setting(Menu_Key_en_t enKeyType);	   		
void Menu_Logic_Operation_Language_Setting(Menu_Key_en_t enKeyType);		
void Menu_Logic_Operation_Fault_Information(Menu_Key_en_t enKeyType);		
void Menu_Logic_Operation_Phone_Connect(Menu_Key_en_t enKeyType);  			
void Menu_Logic_Operation_Quit(Menu_Key_en_t enKeyType);  		

void Menu_Logic_Operation_Select_Daytime(Menu_Key_en_t enKeyType);	   		
void Menu_Logic_Operation_Select_Nighttime(Menu_Key_en_t enKeyType);    	
void Menu_Logic_Operation_Select_Auto(Menu_Key_en_t enKeyType);	  

void Menu_Logic_Operation_Backlight_Auto(Menu_Key_en_t enKeyType);	 		
void Menu_Logic_Operation_Backlight_1(Menu_Key_en_t enKeyType);	      		
void Menu_Logic_Operation_Backlight_2(Menu_Key_en_t enKeyType);        		
void Menu_Logic_Operation_Backlight_3(Menu_Key_en_t enKeyType);	   	   		
void Menu_Logic_Operation_Backlight_4(Menu_Key_en_t enKeyType);		   		
void Menu_Logic_Operation_Backlight_5(Menu_Key_en_t enKeyType);	  

void Menu_Logic_Operation_Bluetooth_Open_Close(Menu_Key_en_t enKeyType);    
void Menu_Logic_Operation_Bluetooth_Sync_Contacts(Menu_Key_en_t enKeyType);	
void Menu_Logic_Operation_Bluetooth_Back(Menu_Key_en_t enKeyType);	

void Menu_Logic_Operation_Clock_Back(Menu_Key_en_t enKeyType); 	      		
void Menu_Logic_Operation_Clock_Min_Bit(Menu_Key_en_t enKeyType);	  		
void Menu_Logic_Operation_Clock_Min_Tenb(Menu_Key_en_t enKeyType);	  		
void Menu_Logic_Operation_Clock_Hour_Bit(Menu_Key_en_t enKeyType);			
void Menu_Logic_Operation_Clock_Hour_Tenb(Menu_Key_en_t enKeyType);	   

void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType); 
void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType);	

void Menu_Logic_Operation_Unit_Km(Menu_Key_en_t enKeyType);	   					
void Menu_Logic_Operation_Unit_Mile(Menu_Key_en_t enKeyType);	   

void Menu_Logic_Operation_Language_Chinese(Menu_Key_en_t enKeyType);   			
void Menu_Logic_Operation_Language_English(Menu_Key_en_t enKeyType);

void Menu_Logic_Operation_Phone_Connect_Set(Menu_Key_en_t enKeyType);  			
void Menu_Logic_Operation_Phone_Connect_App(Menu_Key_en_t enKeyType);

void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datMin, uint8_t datStep, uint8_t *dat);
时昊's avatar
时昊 committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82


void Menu_User_Init(void)
{
	Menu_Init_st_t Menu_Init_st;
	Menu_Init_st.enMenuBranchLen = MENU_BRANCH_MAX;
	Menu_Init_st.enMenuInterfaceLen = MENU_INTERFACE_MAX;
	Menu_Init_st.enMenuItemLen = MENU_ITEM_MAX;
	Menu_Init_st.uintMenuConfig = 0x0001;
	Menu_Init_st.uintMenuCursorMemoryDepth = 0;
	Menu_Init((uint8_t *)u8MenuRamData, (Menu_Item_Attribute_st_t *)stMenuItemAttribute, (Menu_Init_st_t *)&Menu_Init_st);
}

void Menu_User_WAKEUP(void)
{
	Menu_Init_st_t Menu_Init_st;
	Menu_Init_st.enMenuBranchLen = MENU_BRANCH_MAX;
	Menu_Init_st.enMenuInterfaceLen = MENU_INTERFACE_MAX;
	Menu_Init_st.enMenuItemLen = MENU_ITEM_MAX;
	Menu_Init_st.uintMenuConfig = 0x0001;
	Menu_Init_st.uintMenuCursorMemoryDepth = 0;
	Menu_Wake_Up_Init((uint8_t *)u8MenuRamData, (Menu_Item_Attribute_st_t *)stMenuItemAttribute, (Menu_Init_st_t *)&Menu_Init_st);
}

/*---------------------------------------------------------------------------------------*/
const Menu_Item_Attribute_st_t stMenuItemAttribute[MENU_ITEM_MAX] =
{
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
/*MENU_ITEM_MAIN_ITEM = 0,	    */	{0, MENU_INTF_MAIN_INTF,          	MENU_ITEM_MAX,		 		 	0U,  1U,  1U,  0,     MENU_ITEM_MAX, MENU_DIRECTION_TRANSVERSE,   0XFFU, MENU_INTF_MODE,                	MENU_JUMP_FIRST,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_MAIN_ITEM              },
/*MENU_ITEM_DISPLAY_MODE,  		*/	{0, MENU_INTF_MODE,          		MENU_ITEM_MAIN_ITEM, 		 	0U,  9U,  1U,  1,     MENU_ITEM_MAX, MENU_DIRECTION_TRANSVERSE,   0XFFU, MENU_INTF_DISPLAY_MODE,        	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Display_Mode           },
/*MENU_ITEM_BACKLIGHT_SETTING,	*/	{0, MENU_INTF_MODE,            		MENU_ITEM_MAIN_ITEM, 		 	1U,  9U,  1U,  2,     MENU_ITEM_MAX, MENU_DIRECTION_TRANSVERSE,   0XFFU, MENU_INTF_BACKLIGHT_SETTING,   	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_Setting      },
/*MENU_ITEM_BLUETOOTH_CONNECT,	*/	{0, MENU_INTF_MODE,            		MENU_ITEM_MAIN_ITEM, 		 	2U,  9U,  1U,  3,     MENU_ITEM_MAX, MENU_DIRECTION_TRANSVERSE,   0XFFU, MENU_INTF_BLUETOOTH_CONNECT,   	MENU_JUMP_FIRST,  	    	0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Bluetooth_Connect      },
/*MENU_ITEM_CLOCK_SETTING,  	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	3U,  9U,  1U,  4,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_SETTING,       	MENU_JUMP_FIRST,  	    	0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Setting          },
/*MENU_ITEM_UNIT_SETTING,	   	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	4U,  9U,  1U,  5,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_UNIT_SETTING,        	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Unit_Setting           },
/*MENU_ITEM_LANGUAGE_SETTING,	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	5U,  9U,  1U,  6,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_LANGUAGE_SETTING,    	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Language_Setting       },
/*MENU_ITEM_FAULT_INFORMATION, 	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	6U,  9U,  1U,  7,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_FAULT_INFORMATION,   	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Fault_Information      },
/*MENU_ITEM_PHONE_CONNECT,  	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	7U,  9U,  1U,  8,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_PHONE_CONNECT,       	MENU_JUMP_SELECT,  			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Phone_Connect          },
/*MENU_ITEM_QUIT,  			 	*/	{0, MENU_INTF_MODE,         		MENU_ITEM_MAIN_ITEM, 		 	8U,  9U,  1U,  9,     MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Quit           		},
/*MENU_ITEM_SELECT_DAYTIME,		*/	{0, MENU_INTF_DISPLAY_MODE,         MENU_ITEM_DISPLAY_MODE, 	 	0U,  3U,  1U,  10,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Select_Daytime 		},
/*MENU_ITEM_SELECT_NIGHTTIME,   */	{0, MENU_INTF_DISPLAY_MODE,         MENU_ITEM_DISPLAY_MODE, 	 	1U,  3U,  1U,  11,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Select_Nighttime       },
/*MENU_ITEM_SELECT_AUTO,	    */	{0, MENU_INTF_DISPLAY_MODE,         MENU_ITEM_DISPLAY_MODE, 	 	2U,  3U,  1U,  12,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Select_Auto            },
/*MENU_ITEM_BACKLIGHT_5,	    */	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	0U,  6U,  1U,  13,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_5 	        },
/*MENU_ITEM_BACKLIGHT_4,		*/	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	1U,  6U,  1U,  14,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_4            },
/*MENU_ITEM_BACKLIGHT_3,	 	*/	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	2U,  6U,  1U,  15,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_3            },
/*MENU_ITEM_BACKLIGHT_2,     	*/	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	3U,  6U,  1U,  16,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_2            },
/*MENU_ITEM_BACKLIGHT_1,	 	*/	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	4U,  6U,  1U,  17,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_1            },
/*MENU_ITEM_BACKLIGHT_AUTO, 	*/	{0, MENU_INTF_BACKLIGHT_SETTING,    MENU_ITEM_BACKLIGHT_SETTING, 	5U,  6U,  1U,  18,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Backlight_Auto         },
/*MENU_ITEM_BLUETOOTH_OPEN_CLOSE*/	{0, MENU_INTF_BLUETOOTH_CONNECT,    MENU_ITEM_BLUETOOTH_CONNECT, 	0U,  3U,  1U,  19,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_BLUETOOTH_CONNECT,   	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Bluetooth_Open_Close   },
/*MENU_ITEM_BLUETOOTH_SYNC,		*/	{0, MENU_INTF_BLUETOOTH_CONNECT,    MENU_ITEM_BLUETOOTH_CONNECT, 	1U,  3U,  1U,  20,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_BLUETOOTH_CONNECT,   	MENU_JUMP_LAST_POSITION,	0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Bluetooth_Sync_Contacts},
/*MENU_ITEM_BLUETOOTH_BACK,		*/	{0, MENU_INTF_BLUETOOTH_CONNECT,    MENU_ITEM_BLUETOOTH_CONNECT, 	2U,  3U,  1U,  21,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MODE,                	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Bluetooth_Back         },
/*MENU_ITEM_CLOCK_HOUR_TENB,	*/	{0, MENU_INTF_CLOCK_SETTING,        MENU_ITEM_CLOCK_SETTING,     	0U,  5U,  1U,  22,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_HOUR_TENB_SET,     MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Hour_Tenb        },
/*MENU_ITEM_CLOCK_HOUR_BIT,	    */	{0, MENU_INTF_CLOCK_SETTING,        MENU_ITEM_CLOCK_SETTING,     	1U,  5U,  1U,  23,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_HOUR_BIT_SET,      MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Hour_Bit         },
/*MENU_ITEM_CLOCK_MIN_TENB,	    */	{0, MENU_INTF_CLOCK_SETTING,        MENU_ITEM_CLOCK_SETTING,     	2U,  5U,  1U,  24,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_MIN_TENB_SET,      MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Min_Tenb         },
/*MENU_ITEM_CLOCK_MIN_BIT,	    */	{0, MENU_INTF_CLOCK_SETTING,        MENU_ITEM_CLOCK_SETTING,     	3U,  5U,  1U,  25,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_MIN_BIT_SET,       MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Min_Bit          },
/*MENU_ITEM_CLOCK_BACK, 	  	*/	{0, MENU_INTF_CLOCK_SETTING,        MENU_ITEM_CLOCK_SETTING,     	4U,  5U,  1U,  26,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MODE,       		 		MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Back             },
/*MENU_ITEM_CLOCK_HOUR_TENB_SET,*/	{0, MENU_INTF_CLOCK_HOUR_TENB_SET,  MENU_ITEM_CLOCK_HOUR_TENB_SET,  0U,  1U,  1U,  27,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_SETTING,       	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Hour_Tenb_Set    },
/*MENU_ITEM_CLOCK_HOUR_BIT_SET,	 */	{0, MENU_INTF_CLOCK_HOUR_BIT_SET,   MENU_ITEM_CLOCK_HOUR_BIT_SET,   0U,  1U,  1U,  28,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_SETTING,       	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Hour_Bit_Set     },
/*MENU_ITEM_CLOCK_MIN_TENB_SET,	 */	{0, MENU_INTF_CLOCK_MIN_TENB_SET,   MENU_ITEM_CLOCK_MIN_TENB,       0U,  1U,  1U,  29,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_SETTING,       	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Min_Tenb_Set     },
/*MENU_ITEM_CLOCK_MIN_BIT_SET,	 */	{0, MENU_INTF_CLOCK_MIN_BIT_SET,    MENU_ITEM_CLOCK_MIN_BIT,        0U,  1U,  1U,  30,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_CLOCK_SETTING,       	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Clock_Min_Bit_Set      },
/*MENU_ITEM_UNIT_KM,		    */	{0, MENU_INTF_UNIT_SETTING,         MENU_ITEM_UNIT_SETTING,         0U,  2U,  1U,  31,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Unit_Km                },
/*MENU_ITEM_UNIT_MILE,	        */	{0, MENU_INTF_UNIT_SETTING, 		MENU_ITEM_UNIT_SETTING,         1U,  2U,  1U,  32,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Unit_Mile              },
/*MENU_ITEM_LANGUAGE_CHINESE, 	*/	{0, MENU_INTF_LANGUAGE_SETTING, 	MENU_ITEM_LANGUAGE_SETTING,     0U,  2U,  1U,  33,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Language_Chinese       },
/*MENU_ITEM_LANGUAGE_ENGLISH,	*/	{0, MENU_INTF_LANGUAGE_SETTING, 	MENU_ITEM_LANGUAGE_SETTING,     1U,  2U,  1U,  34,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_SELECT, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Language_English       },
/*MENU_ITEM_PHONE_CONNECT_SET	*/	{0, MENU_INTF_PHONE_CONNECT, 		MENU_ITEM_PHONE_CONNECT,        0U,  1U,  1U,  35,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_PHONE_CONNECT_SET,       MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		MENU_INTF_MAIN_INTF,  MENU_JUMP_FIRST,  Menu_Logic_Operation_Phone_Connect_Set      },
/*MENU_ITEM_PHONE_CONNECT_APP	*/	{0, MENU_INTF_PHONE_CONNECT_SET, 	MENU_ITEM_PHONE_CONNECT_SET,    0U,  1U,  1U,  36,    MENU_ITEM_MAX, MENU_DIRECTION_LONGITUDINAL, 0XFFU, MENU_INTF_MAIN_INTF,           	MENU_JUMP_FIRST, 			0XFFU,  MENU_JUMP_FIRST, 		0XFFU,                MENU_JUMP_FIRST,  Menu_Logic_Operation_Phone_Connect_App      },
时昊's avatar
时昊 committed
120 121 122 123 124 125 126 127 128 129 130 131 132
};

/*-------------------------------------------------------------------------------------------------*/

/*--------------------------The following usage is recommended, but not required--------------------------------*/
/*--------------------------The following usage is recommended, but not required--------------------------------*/
/*--------------------------The following usage is recommended, but not required--------------------------------*/

//static void Menu_Cursor_Preprocess(Menu_Key_en_t enMenuKey);
//static void Menu_Cursor_Postprocess(Menu_Key_en_t enMenuKey);
void Menu_Service(Menu_Key_en_t enMenuKey);

/*传入按键动作执行之前需要预先处理的动作*/
郑萍's avatar
郑萍 committed
133 134
// static void Menu_Cursor_Preprocess(Menu_Key_en_t enMenuKey)
// {
时昊's avatar
时昊 committed
135

郑萍's avatar
郑萍 committed
136 137 138
// 	/*预处理中执行过本次按键了,后续不必执行时调用一次*/
// 	/*u8MenuKeyExecute = 0U;*/
// }
时昊's avatar
时昊 committed
139
/*传入按键动作执行之后需要后置处理的动作*/
郑萍's avatar
郑萍 committed
140 141 142
// static void Menu_Cursor_Postprocess(Menu_Key_en_t enMenuKey)
// {
// }
时昊's avatar
时昊 committed
143

时昊's avatar
时昊 committed
144 145 146 147 148 149 150 151
/*------------传入按键类型-----------------------*/
void Menu_Service(Menu_Key_en_t enMenuKey)
{
	/*功能回调函数的调用*/
	Menu_Logic_Process(enMenuKey);
	/*--------------------------------------------------*/
	/*按键动作对光标的处理*/
	//Menu_Cursor_Preprocess(enMenuKey);
152
	Menu_Cursor_Process(enMenuKey);
时昊's avatar
时昊 committed
153 154 155
	//Menu_Cursor_Postprocess(enMenuKey);
	/*--------------------------------------------------*/
}
时昊's avatar
时昊 committed
156

时昊's avatar
时昊 committed
157 158 159 160 161 162 163 164 165 166 167 168 169
/*------------请放在休眠,唤醒之后不会被清除的RAM区域中-------------------------*/
/*------------请放在休眠,唤醒之后不会被清除的RAM区域中-------------------------*/
/*------------请放在休眠,唤醒之后不会被清除的RAM区域中-------------------------*/
//#pragma ghs section bss = ".myNonInitArea"
Menu_uint8_t u8MenuRamData[MENU_RAM_DATA_LEN];
//#pragma ghs section bss = default
/*---------------------------------------*/
/*---------------------------------------*/
/*---------------------------------------*/


void Menu_Logic_Operation_MAIN_ITEM(Menu_Key_en_t enKeyType)
{
170
	if(enKeyType == MENU_KEY_FUNCTION_1_SHORT)//大小计切换
时昊's avatar
时昊 committed
171
	{
172
		if(Get_Dis_OdoAndTrip() == 0)
时昊's avatar
时昊 committed
173
		{
174
			MenuData.OdoAndTrip = 1;
时昊's avatar
时昊 committed
175 176 177
		}
		else
		{
178
			MenuData.OdoAndTrip = 0;
时昊's avatar
时昊 committed
179 180 181 182 183
		}
	}
}

void Menu_Logic_Operation_Display_Mode(Menu_Key_en_t enKeyType)
184 185 186 187 188
{

} 	

void Menu_Logic_Operation_Select_Daytime(Menu_Key_en_t enKeyType)
时昊's avatar
时昊 committed
189 190 191
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
192 193 194
		Menu_Item_Select_Set(MENU_ITEM_SELECT_DAYTIME, 1);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_NIGHTTIME, 0);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_AUTO, 0);
时昊's avatar
时昊 committed
195
	}
196 197 198 199 200
}

void Menu_Logic_Operation_Select_Nighttime(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
时昊's avatar
时昊 committed
201
	{
202 203 204
		Menu_Item_Select_Set(MENU_ITEM_SELECT_DAYTIME, 0);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_NIGHTTIME, 1);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_AUTO, 0);
时昊's avatar
时昊 committed
205
	}
206
}
时昊's avatar
时昊 committed
207

208
void Menu_Logic_Operation_Select_Auto(Menu_Key_en_t enKeyType)
时昊's avatar
时昊 committed
209 210 211
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
212 213 214
		Menu_Item_Select_Set(MENU_ITEM_SELECT_DAYTIME, 0);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_NIGHTTIME, 0);
		Menu_Item_Select_Set(MENU_ITEM_SELECT_AUTO, 1);
时昊's avatar
时昊 committed
215
	}
216 217 218 219 220
}

void Menu_Logic_Operation_Backlight_5(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
时昊's avatar
时昊 committed
221
	{
222 223 224 225 226 227
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 1);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 0);
时昊's avatar
时昊 committed
228 229 230
	}
}

231 232 233 234 235 236 237 238 239 240 241 242 243 244
void Menu_Logic_Operation_Backlight_4(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 1);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 0);
	}
}

void Menu_Logic_Operation_Backlight_3(Menu_Key_en_t enKeyType)
时昊's avatar
时昊 committed
245 246 247
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
248 249 250 251 252 253
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 1);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 0);
时昊's avatar
时昊 committed
254
	}
255 256 257 258 259
}

void Menu_Logic_Operation_Backlight_2(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
时昊's avatar
时昊 committed
260
	{
261 262 263 264 265 266
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 1);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 0);
时昊's avatar
时昊 committed
267 268 269
	}
}

270
void Menu_Logic_Operation_Backlight_1(Menu_Key_en_t enKeyType)
时昊's avatar
时昊 committed
271 272 273
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
274 275 276 277 278 279
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 1);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 0);
时昊's avatar
时昊 committed
280
	}
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
}

void Menu_Logic_Operation_Backlight_Auto(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_5, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_4, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_3, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_2, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_1, 0);
		Menu_Item_Select_Set(MENU_ITEM_BACKLIGHT_AUTO, 1);
	}
}

void Menu_Logic_Operation_Bluetooth_Open_Close(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
时昊's avatar
时昊 committed
299
	{
300 301 302 303 304
		Menu_Item_Select_Set(MENU_ITEM_BLUETOOTH_OPEN_CLOSE, 1);
		Menu_Item_Select_Set(MENU_ITEM_BLUETOOTH_SYNC, 0);
		Menu_Item_Select_Set(MENU_ITEM_BLUETOOTH_BACK, 0);

		if(Get_Dis_Bluetooth_Open_Close() == 0)
时昊's avatar
时昊 committed
305
		{
306
			MenuData.Bluetooth_Open_Close = 1;
时昊's avatar
时昊 committed
307 308 309
		}
		else
		{
310
			MenuData.Bluetooth_Open_Close = 0;
时昊's avatar
时昊 committed
311 312 313 314
		}
	}
}

315 316
void Menu_Logic_Operation_Bluetooth_Sync_Contacts(Menu_Key_en_t enKeyType)
{
时昊's avatar
时昊 committed
317

318
}
时昊's avatar
时昊 committed
319

320 321
void Menu_Logic_Operation_Bluetooth_Back(Menu_Key_en_t enKeyType)
{
时昊's avatar
时昊 committed
322

323
}
时昊's avatar
时昊 committed
324

325 326
void Menu_Logic_Operation_Clock_Hour_Tenb(Menu_Key_en_t enKeyType) 
{
时昊's avatar
时昊 committed
327

328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
}

void Menu_Logic_Operation_Clock_Hour_Bit(Menu_Key_en_t enKeyType)
{

}

void Menu_Logic_Operation_Clock_Min_Tenb(Menu_Key_en_t enKeyType)
{

}

void Menu_Logic_Operation_Clock_Min_Bit(Menu_Key_en_t enKeyType)	
{

} 

void Menu_Logic_Operation_Clock_Back(Menu_Key_en_t enKeyType)  
{

}  

void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType) 
时昊's avatar
时昊 committed
351
{
352 353 354 355
	uint8_t updataDir = 0u;
	uint8_t datmax = 0u;
	uint8_t datmin = 0u;	
	if(enKeyType == MENU_KEY_DOWN_SHORT)
时昊's avatar
时昊 committed
356
	{
357 358 359 360
		updataDir = 1;
		datmax = 2u;
    	datmin = 0u; 
		Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Tenb));
时昊's avatar
时昊 committed
361
	}
362 363 364 365 366 367 368
}
void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType)
{
	uint8_t updataDir = 0u;
	uint8_t datmax = 0u;
	uint8_t datmin = 0u;	
	if(enKeyType == MENU_KEY_DOWN_SHORT)
时昊's avatar
时昊 committed
369
	{
370 371 372 373
		updataDir = 1;
		datmax = 9u;
    	datmin = 0u; 
		Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Bit));
时昊's avatar
时昊 committed
374
	}
375
}
时昊's avatar
时昊 committed
376

377
void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType)
时昊's avatar
时昊 committed
378
{
379 380 381 382
	uint8_t updataDir = 0u;
	uint8_t datmax = 0u;
	uint8_t datmin = 0u;	
	if(enKeyType == MENU_KEY_DOWN_SHORT)
时昊's avatar
时昊 committed
383
	{
384 385 386 387
		updataDir = 1;
		datmax = 5u;
    	datmin = 0u; 
		Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Tenb));
时昊's avatar
时昊 committed
388
	}
389 390 391 392 393 394 395 396
}

void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)	
{
	uint8_t updataDir = 0u;
	uint8_t datmax = 0u;
	uint8_t datmin = 0u;	
	if(enKeyType == MENU_KEY_DOWN_SHORT)
时昊's avatar
时昊 committed
397
	{
398 399 400 401
		updataDir = 1;
		datmax = 9u;
    	datmin = 0u; 
		Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Bit));
时昊's avatar
时昊 committed
402
	}
403 404 405 406 407 408 409 410 411 412
} 

void Menu_Logic_Operation_Backlight_Setting(Menu_Key_en_t enKeyType)
{
	
} 	

void Menu_Logic_Operation_Bluetooth_Connect(Menu_Key_en_t enKeyType)
{
 
时昊's avatar
时昊 committed
413 414 415 416
} 	

void Menu_Logic_Operation_Clock_Setting(Menu_Key_en_t enKeyType)
{
417

时昊's avatar
时昊 committed
418 419 420 421
} 	

void Menu_Logic_Operation_Unit_Setting(Menu_Key_en_t enKeyType)
{
422

时昊's avatar
时昊 committed
423 424 425 426
} 	

void Menu_Logic_Operation_Language_Setting(Menu_Key_en_t enKeyType)
{
427

时昊's avatar
时昊 committed
428 429 430 431
} 	

void Menu_Logic_Operation_Fault_Information(Menu_Key_en_t enKeyType)
{
432

时昊's avatar
时昊 committed
433 434 435 436
} 

void Menu_Logic_Operation_Phone_Connect(Menu_Key_en_t enKeyType)
{
437

时昊's avatar
时昊 committed
438 439 440 441 442
} 

void Menu_Logic_Operation_Quit(Menu_Key_en_t enKeyType)
{

443
}	
时昊's avatar
时昊 committed
444 445 446 447 448

void Menu_Logic_Operation_Unit_Km(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
449 450 451
		Menu_Item_Select_Set(MENU_ITEM_UNIT_KM, 1);
		Menu_Item_Select_Set(MENU_ITEM_UNIT_MILE, 0);
		MenuData.Unit = 0;
时昊's avatar
时昊 committed
452 453 454 455 456 457 458
	}
}

void Menu_Logic_Operation_Unit_Mile(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
459 460 461
		Menu_Item_Select_Set(MENU_ITEM_UNIT_KM, 0);
		Menu_Item_Select_Set(MENU_ITEM_UNIT_MILE, 1);
		MenuData.Unit = 1;
时昊's avatar
时昊 committed
462 463 464 465 466 467 468
	}
}

void Menu_Logic_Operation_Language_Chinese(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
469 470 471
		Menu_Item_Select_Set(MENU_ITEM_LANGUAGE_CHINESE, 1);
		Menu_Item_Select_Set(MENU_ITEM_LANGUAGE_ENGLISH, 0);
		MenuData.Language = 0;
时昊's avatar
时昊 committed
472 473 474 475 476 477 478
	}
}

void Menu_Logic_Operation_Language_English(Menu_Key_en_t enKeyType)
{
	if(enKeyType == MENU_KEY_CONFIRM_SHORT)
	{
479 480 481
		Menu_Item_Select_Set(MENU_ITEM_LANGUAGE_CHINESE, 0);
		Menu_Item_Select_Set(MENU_ITEM_LANGUAGE_ENGLISH, 1);
		MenuData.Language = 1;
时昊's avatar
时昊 committed
482 483
	}
}
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537

void Menu_Logic_Operation_Phone_Connect_Set(Menu_Key_en_t enKeyType)
{

}

void Menu_Logic_Operation_Phone_Connect_App(Menu_Key_en_t enKeyType)
{

}

void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datMin, uint8_t datStep, uint8_t *dat)
{
	uint8_t temp = *dat;
    if(datMax > datMin)
    {
        if(updateDir == 1u)
        {
            if(temp < datMax)
            {
                if((temp) <= (255u-datStep))
                {
                    temp += datStep;
                }
            } 
            else
            {
                temp = datMin;
            }        
        }
        else if(updateDir == 2u)
        {
            if(temp > datMin)
            {
                if(temp >= datStep)
                {
                    temp -= datStep;
                }
            } 
            else
            {
                temp = datMax;
            }
        }
        else
        {
        }
    }
    else
    {
    }

	*dat = temp;
}
时昊's avatar
时昊 committed
538