⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menufunc.s

📁 Atmega64单片机程序(完整工程)
💻 S
字号:
	.module MenuFunc.C
	.area text(rom, con, rel)
	.even
_DispMenuFuncInit::
	sbiw R28,1
; /*这份代码经源码格式软件格式化过
;      yang_hx@neusoft.com      */
; /******************************************************************************
;  * MenuFunc.C - "功能"菜单 条项动态生成代码
;  ******************************************************************************/
; #include "SYS_Config.h" 
; #include "GUI_Config.h" 
; #include "GUI.H" 
; #include "Menu.H" 
; #include "KeyScan.H" 
; 
; 
; //功能
; //Bar型菜单
; void DispMenuFuncInit()
; {
;     //--------------------
;     GUI_Clear();
	xcall _GUI_Clear
;     //--------------------
;     BarMenu=&MenuFunc[language];
	lds R2,_language
	ldi R24,5
	mul R24,R2
	movw R2,R0
	ldi R24,<_MenuFunc
	ldi R25,>_MenuFunc
	add R2,R24
	adc R3,R25
	sts _BarMenu+1,R3
	sts _BarMenu,R2
;     ItemNum=(*BarMenu).TextNum ;
	movw R30,R2
	adiw R30,2
	lpm R30,Z
	sts _ItemNum,R30
;     DispItem=(*BarMenu).Text ;
	movw R30,R2
	lpm R0,Z+
	lpm R1,Z
	movw R30,R0
	sts _DispItem+1,R31
	sts _DispItem,R30
;     
;     //显示按键对应的文字提示,1-->"选择"
;     GUI_DispStringAt(*(Tip[language].Text+1),1,LCD_YSIZE-14);
	ldi R24,54
	std y+0,R24
	ldi R18,1
	lds R2,_language
	ldi R24,5
	mul R24,R2
	movw R30,R0
	ldi R24,<_Tip
	ldi R25,>_Tip
	add R30,R24
	adc R31,R25
	lpm R0,Z+
	lpm R1,Z
	movw R30,R0
	ldd R16,z+2
	ldd R17,z+3
	xcall _GUI_DispStringAt
;     //显示按键对应的文字提示,0-->"退出"
; 	GUI_DispStringAt(*(Tip[language].Text+4),LCD_XSIZE-24,LCD_YSIZE-14);
	ldi R24,54
	std y+0,R24
	ldi R18,73
	lds R2,_language
	ldi R24,5
	mul R24,R2
	movw R30,R0
	ldi R24,<_Tip
	ldi R25,>_Tip
	add R30,R24
	adc R31,R25
	lpm R0,Z+
	lpm R1,Z
	movw R30,R0
	ldd R16,z+8
	ldd R17,z+9
	xcall _GUI_DispStringAt
;     
; 	//用户定义的初始化代码请放在这里
;     BarMenuInit();
	xcall _BarMenuInit
L1:
	adiw R28,1
	.dbline 0 ; func end
	ret
	.even
_DispMenuFuncUp::
	xcall push_gset1
;     //调用公共初始化的代码
; }
; 
; void DispMenuFuncUp()
; {
;     
;     switch(Item)
	lds R20,_Item
	clr R21
	cpi R20,0
	cpc R20,R21
	breq L6
X0:
	cpi R20,1
	ldi R30,0
	cpc R21,R30
	breq L8
	xjmp L3
X1:
;     {
L6:
;         case 0 :
;         {
;             #ifdef DynamicBar 
;                 Jump2Menu(MenuDataIndex,FlashMode_AutoInit);
;             #else 
;                 Jump2Menu(SelfMenuIndex,FlashMode_NoAction);
	clr R18
	ldi R24,<_FatherIndex-1
	ldi R25,>_FatherIndex-1
	lds R30,_Layer
	clr R31
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _Jump2Menu
;             #endif 
;             
;             break ;
	xjmp L4
L8:
;         }
;         case 1 :
;         {
;             Jump2Menu(SelfMenuIndex,FlashMode_NoAction);
	clr R18
	ldi R24,<_FatherIndex-1
	ldi R25,>_FatherIndex-1
	lds R30,_Layer
	clr R31
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _Jump2Menu
;             break ;
	xjmp L4
L3:
;         }
;         default :
;         {
;             Jump2Menu(SelfMenuIndex,FlashMode_NoAction);
	clr R18
	ldi R24,<_FatherIndex-1
	ldi R25,>_FatherIndex-1
	lds R30,_Layer
	clr R31
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	xcall _Jump2Menu
;             break ;
L4:
L2:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.even
_DispMenuFuncDown::
;         }
;     }
;     
; }
; void DispMenuFuncDown()
; {
;     POP();
	xcall _POP
L11:
	.dbline 0 ; func end
	ret
	.even
_DispMenuFuncLeft::
; }
; 
; void DispMenuFuncLeft()
; {
;     BarMenuLeft();
	xcall _BarMenuLeft
L12:
	.dbline 0 ; func end
	ret
	.even
_DispMenuFuncRight::
; }
; void DispMenuFuncRight()
; {
;     BarMenuRight();
	xcall _BarMenuRight
L13:
	.dbline 0 ; func end
	ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -