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

📄 mc_keys.ls

📁 STM8S105 BLDC源代码
💻 LS
字号:
   1                     ; C Compiler for STM8 (COSMIC Software)
   2                     ; Parser V4.9.10 - 10 Feb 2011
   3                     ; Generator (Limited) V4.3.6 - 15 Feb 2011
   4                     ; Optimizer V4.3.5 - 15 Feb 2011
  19                     	bsct
  20  0000               L3_g_pUserInterface:
  21  0000 0000          	dc.w	0
  22  0002               L5_g_pdevice:
  23  0002 0000          	dc.w	0
  24  0004               _bEditMode:
  25  0004 00            	dc.b	0
 643                     ; 51 void keysInit(pvdev_device_t pdevice, PUserInterface_t pUserInterface)
 643                     ; 52 {
 645                     	switch	.text
 646  0000               _keysInit:
 648       00000000      OFST:	set	0
 651                     ; 53 	g_pdevice = pdevice;
 653  0000 bf02          	ldw	L5_g_pdevice,x
 654  0002 89            	pushw	x
 655                     ; 54 	g_pUserInterface = pUserInterface;
 657  0003 1e05          	ldw	x,(OFST+5,sp)
 658  0005 bf00          	ldw	L3_g_pUserInterface,x
 659                     ; 55 }
 662  0007 85            	popw	x
 663  0008 81            	ret	
 666                     	switch	.ubsct
 667  0000               L104_user_input:
 668  0000 00            	ds.b	1
 702                     ; 64 u8 keysRead (void)
 702                     ; 65 {
 703                     	switch	.text
 704  0009               _keysRead:
 708                     ; 67 	g_pdevice->ios.inp8(VDEV_INP8_USER_INPUT,&user_input);
 710  0009 ae0000        	ldw	x,#L104_user_input
 711  000c 89            	pushw	x
 712  000d ae0001        	ldw	x,#1
 713  0010 89            	pushw	x
 714  0011 5f            	clrw	x
 715  0012 89            	pushw	x
 716  0013 be02          	ldw	x,L5_g_pdevice
 717  0015 ee15          	ldw	x,(21,x)
 718  0017 fd            	call	(x)
 720  0018 5b06          	addw	sp,#6
 721                     ; 124 		if(((user_input & (1 << USER_INPUT_KEY)) != 0))
 723  001a 720100000e    	btjf	L104_user_input,#0,L124
 724                     ; 127 			if (bPrevious_key == USER_SEL) 
 726  001f b601          	ld	a,L7_bPrevious_key
 727  0021 a107          	cp	a,#7
 728  0023 2603          	jrne	L324
 729                     ; 129 				return KEY_HOLD;
 731  0025 a606          	ld	a,#6
 734  0027 81            	ret	
 735  0028               L324:
 736                     ; 133 				bPrevious_key = USER_SEL;
 738  0028 a607          	ld	a,#7
 739  002a b701          	ld	L7_bPrevious_key,a
 740                     ; 134 				return USER_SEL;
 744  002c 81            	ret	
 745  002d               L124:
 746                     ; 188 	bPrevious_key = NOKEY;
 748  002d 3f01          	clr	L7_bPrevious_key
 749                     ; 189 	return NOKEY;
 751  002f 4f            	clr	a
 754  0030 81            	ret	
 791                     ; 201 u8 keysProcess(void)
 791                     ; 202 {
 792                     	switch	.text
 793  0031               _keysProcess:
 795  0031 88            	push	a
 796       00000001      OFST:	set	1
 799                     ; 207 		bKey = keysRead();    // read key pushed (if any...)
 801  0032 add5          	call	_keysRead
 803  0034 6b01          	ld	(OFST+0,sp),a
 804                     ; 209 		switch(bKey)
 806  0036 a107          	cp	a,#7
 807  0038 2609          	jrne	L354
 810                     ; 235 			case USER_SEL:
 810                     ; 236 			// The user interface should be updated if the state is Idle
 810                     ; 237 			// Switch to tab 1 to see the speed
 810                     ; 238 				UserInterface_ChangeToTab(g_pUserInterface->bDefaultTab);
 812  003a be00          	ldw	x,L3_g_pUserInterface
 813  003c e609          	ld	a,(9,x)
 814  003e cd0000        	call	_UserInterface_ChangeToTab
 816                     ; 239 			break;
 818                     ; 241 		default:
 818                     ; 242 		break;
 820  0041 7b01          	ld	a,(OFST+0,sp)
 821  0043               L354:
 822                     ; 244 		return bKey;
 826  0043 5b01          	addw	sp,#1
 827  0045 81            	ret	
 884                     	switch	.ubsct
 885  0001               L7_bPrevious_key:
 886  0001 00            	ds.b	1
 887                     	xdef	_keysRead
 888                     	xdef	_keysProcess
 889                     	xdef	_keysInit
 890                     	xdef	_bEditMode
 891                     	xref	_UserInterface_ChangeToTab
 911                     	end

⌨️ 快捷键说明

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