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

📄 mc_user_interface.ls

📁 STM8S105 BLDC源代码
💻 LS
📖 第 1 页 / 共 3 页
字号:
1105                     ; 129 {
1106                     	switch	.text
1107  00dd               _UserInterface_ResetFocus:
1109  00dd 88            	push	a
1110       00000001      OFST:	set	1
1113                     ; 131 	for (i = 0; i < g_pUserInterface->pSelTab->bFieldsNumber; i++)
1115  00de 0f01          	clr	(OFST+0,sp)
1117  00e0 2024          	jra	L315
1118  00e2               L705:
1119                     ; 133 		if (g_pUserInterface->pSelTab->pField[i].Type == EDIT)
1121  00e2 7b01          	ld	a,(OFST+0,sp)
1122  00e4 97            	ld	xl,a
1123  00e5 a609          	ld	a,#9
1124  00e7 90be05        	ldw	y,_g_pUserInterface
1125  00ea 90ee02        	ldw	y,(2,y)
1126  00ed 42            	mul	x,a
1127  00ee 90ee01        	ldw	y,(1,y)
1128  00f1 90bf00        	ldw	c_x,y
1129  00f4 72bb0000      	addw	x,c_x
1130  00f8 e603          	ld	a,(3,x)
1131  00fa 2608          	jrne	L715
1132                     ; 135 			g_pUserInterface->bField_Focus_Selection = i;
1134  00fc be05          	ldw	x,_g_pUserInterface
1135  00fe 7b01          	ld	a,(OFST+0,sp)
1136  0100 e704          	ld	(4,x),a
1137                     ; 136 			return;
1140  0102 84            	pop	a
1141  0103 81            	ret	
1142  0104               L715:
1143                     ; 131 	for (i = 0; i < g_pUserInterface->pSelTab->bFieldsNumber; i++)
1145  0104 0c01          	inc	(OFST+0,sp)
1146  0106               L315:
1149  0106 be05          	ldw	x,_g_pUserInterface
1150  0108 ee02          	ldw	x,(2,x)
1151  010a f6            	ld	a,(x)
1152  010b 1101          	cp	a,(OFST+0,sp)
1153  010d 22d3          	jrugt	L705
1154                     ; 139 	g_pUserInterface->bField_Focus_Selection = g_pUserInterface->pSelTab->bFieldsNumber;
1156  010f be05          	ldw	x,_g_pUserInterface
1157  0111 ee02          	ldw	x,(2,x)
1158  0113 f6            	ld	a,(x)
1159  0114 be05          	ldw	x,_g_pUserInterface
1160  0116 e704          	ld	(4,x),a
1161                     ; 140 }
1164  0118 84            	pop	a
1165  0119 81            	ret	
1210                     ; 142 u8 UserInterface_UpField(u8 StartingSel)
1210                     ; 143 {
1211                     	switch	.text
1212  011a               _UserInterface_UpField:
1214  011a 88            	push	a
1215  011b 88            	push	a
1216       00000001      OFST:	set	1
1219                     ; 144 	u8 Sel = StartingSel;
1221  011c               L345:
1222                     ; 148 		Sel += g_pUserInterface->pSelTab->bFieldsNumber;
1224  011c be05          	ldw	x,_g_pUserInterface
1225  011e ee02          	ldw	x,(2,x)
1226  0120 fb            	add	a,(x)
1227  0121 4a            	dec	a
1228  0122 6b01          	ld	(OFST+0,sp),a
1229                     ; 149 		Sel --;
1231                     ; 150 		Sel %= g_pUserInterface->pSelTab->bFieldsNumber;
1233  0124 be05          	ldw	x,_g_pUserInterface
1234  0126 ee02          	ldw	x,(2,x)
1235  0128 f6            	ld	a,(x)
1236  0129 5f            	clrw	x
1237  012a 97            	ld	xl,a
1238  012b 7b01          	ld	a,(OFST+0,sp)
1239  012d 9093          	ldw	y,x
1240  012f 5f            	clrw	x
1241  0130 97            	ld	xl,a
1242  0131 65            	divw	x,y
1243  0132 909f          	ld	a,yl
1244  0134 6b01          	ld	(OFST+0,sp),a
1245                     ; 151 		if (g_pUserInterface->pSelTab->pField[Sel].Type == EDIT)
1247  0136 97            	ld	xl,a
1248  0137 a609          	ld	a,#9
1249  0139 90be05        	ldw	y,_g_pUserInterface
1250  013c 90ee02        	ldw	y,(2,y)
1251  013f 42            	mul	x,a
1252  0140 90ee01        	ldw	y,(1,y)
1253  0143 90bf00        	ldw	c_x,y
1254  0146 72bb0000      	addw	x,c_x
1255  014a e603          	ld	a,(3,x)
1256  014c 260a          	jrne	L545
1257                     ; 153 			g_pUserInterface->bField_Focus_Selection = Sel;
1259  014e be05          	ldw	x,_g_pUserInterface
1260  0150 7b01          	ld	a,(OFST+0,sp)
1261  0152 e704          	ld	(4,x),a
1262                     ; 154 			return TRUE;
1264  0154 a601          	ld	a,#1
1266  0156 2007          	jra	L62
1267  0158               L545:
1268                     ; 157 	while (Sel == StartingSel);
1270  0158 7b01          	ld	a,(OFST+0,sp)
1271  015a 1102          	cp	a,(OFST+1,sp)
1272  015c 27be          	jreq	L345
1273                     ; 158 	return FALSE;
1275  015e 4f            	clr	a
1277  015f               L62:
1279  015f 85            	popw	x
1280  0160 81            	ret	
1325                     ; 161 u8 UserInterface_DownField(u8 StartingSel)
1325                     ; 162 {
1326                     	switch	.text
1327  0161               _UserInterface_DownField:
1329  0161 88            	push	a
1330  0162 88            	push	a
1331       00000001      OFST:	set	1
1334                     ; 163 	u8 Sel = StartingSel;
1336  0163 6b01          	ld	(OFST+0,sp),a
1337  0165               L575:
1338                     ; 167 		Sel ++;
1340  0165 0c01          	inc	(OFST+0,sp)
1341                     ; 168 		Sel %= g_pUserInterface->pSelTab->bFieldsNumber;
1343  0167 be05          	ldw	x,_g_pUserInterface
1344  0169 ee02          	ldw	x,(2,x)
1345  016b f6            	ld	a,(x)
1346  016c 5f            	clrw	x
1347  016d 97            	ld	xl,a
1348  016e 7b01          	ld	a,(OFST+0,sp)
1349  0170 9093          	ldw	y,x
1350  0172 5f            	clrw	x
1351  0173 97            	ld	xl,a
1352  0174 65            	divw	x,y
1353  0175 909f          	ld	a,yl
1354  0177 6b01          	ld	(OFST+0,sp),a
1355                     ; 169 		if (g_pUserInterface->pSelTab->pField[Sel].Type == EDIT)
1357  0179 97            	ld	xl,a
1358  017a a609          	ld	a,#9
1359  017c 90be05        	ldw	y,_g_pUserInterface
1360  017f 90ee02        	ldw	y,(2,y)
1361  0182 42            	mul	x,a
1362  0183 90ee01        	ldw	y,(1,y)
1363  0186 90bf00        	ldw	c_x,y
1364  0189 72bb0000      	addw	x,c_x
1365  018d e603          	ld	a,(3,x)
1366  018f 260a          	jrne	L775
1367                     ; 171 			g_pUserInterface->bField_Focus_Selection = Sel;
1369  0191 be05          	ldw	x,_g_pUserInterface
1370  0193 7b01          	ld	a,(OFST+0,sp)
1371  0195 e704          	ld	(4,x),a
1372                     ; 172 			return TRUE;
1374  0197 a601          	ld	a,#1
1376  0199 2007          	jra	L23
1377  019b               L775:
1378                     ; 175 	while (Sel == StartingSel);
1380  019b 7b01          	ld	a,(OFST+0,sp)
1381  019d 1102          	cp	a,(OFST+1,sp)
1382  019f 27c4          	jreq	L575
1383                     ; 176 	return FALSE;
1385  01a1 4f            	clr	a
1387  01a2               L23:
1389  01a2 85            	popw	x
1390  01a3 81            	ret	
1459                     ; 179 u8 UserInterface_UpDownKey(u8 StartingSel,EditAction_t act)
1459                     ; 180 {
1460                     	switch	.text
1461  01a4               _UserInterface_UpDownKey:
1463  01a4 89            	pushw	x
1464       00000000      OFST:	set	0
1467                     ; 181 	if (g_pUserInterface->bStatus == UI_LOCKED)
1469  01a5 be05          	ldw	x,_g_pUserInterface
1470  01a7 f6            	ld	a,(x)
1471  01a8 4a            	dec	a
1472                     ; 182 		return FALSE;
1475  01a9 2710          	jreq	L44
1476                     ; 184 	if (g_pUserInterface->bField_Edit == g_pUserInterface->pSelTab->bFieldsNumber)
1478  01ab e605          	ld	a,(5,x)
1479  01ad ee02          	ldw	x,(2,x)
1480  01af f1            	cp	a,(x)
1481  01b0 2611          	jrne	L146
1482                     ; 186 		if (act == INC_SEL)
1484  01b2 7b02          	ld	a,(OFST+2,sp)
1485  01b4 2607          	jrne	L346
1486                     ; 188 			return UserInterface_UpField(StartingSel);
1488  01b6 7b01          	ld	a,(OFST+1,sp)
1489  01b8 cd011a        	call	_UserInterface_UpField
1492  01bb               L44:
1494  01bb 85            	popw	x
1495  01bc 81            	ret	
1496  01bd               L346:
1497                     ; 192 			return UserInterface_DownField(StartingSel);
1499  01bd 7b01          	ld	a,(OFST+1,sp)
1500  01bf ada0          	call	_UserInterface_DownField
1503  01c1 20f8          	jra	L44
1504  01c3               L146:
1505                     ; 197 		return UserInterface_IncField(act);
1507  01c3 7b02          	ld	a,(OFST+2,sp)
1508  01c5 cd029f        	call	_UserInterface_IncField
1511  01c8 20f1          	jra	L44
1548                     ; 201 u8 UserInterface_ChangeToTab(u8 bSel)
1548                     ; 202 {
1549                     	switch	.text
1550  01ca               _UserInterface_ChangeToTab:
1552  01ca 88            	push	a
1553       00000000      OFST:	set	0
1556                     ; 203 	if (g_pUserInterface->bStatus == UI_LOCKED)
1558  01cb 92c605        	ld	a,[_g_pUserInterface.w]
1559  01ce 4a            	dec	a
1560  01cf 2603          	jrne	L766
1561                     ; 204 		return FALSE;
1565  01d1 5b01          	addw	sp,#1
1566  01d3 81            	ret	
1567  01d4               L766:
1568                     ; 206 	g_pUserInterface->bSelected_Tab = bSel; 
1570  01d4 be05          	ldw	x,_g_pUserInterface
1571  01d6 7b01          	ld	a,(OFST+1,sp)
1572  01d8 e701          	ld	(1,x),a
1573                     ; 207 	g_pUserInterface->pSelTab = &(g_pUserInterface->pTab[bSel]); 
1575  01da 97            	ld	xl,a
1576  01db a603          	ld	a,#3
1577  01dd 90be05        	ldw	y,_g_pUserInterface
1578  01e0 42            	mul	x,a
1579  01e1 90ee07        	ldw	y,(7,y)
1580  01e4 90bf00        	ldw	c_x,y
1581  01e7 90be05        	ldw	y,_g_pUserInterface
1582  01ea 72bb0000      	addw	x,c_x
1583  01ee 90ef02        	ldw	(2,y),x
1584                     ; 209 	g_pUserInterface->bField_Edit = g_pUserInterface->pSelTab->bFieldsNumber; // No field is in edit mode
1586  01f1 be05          	ldw	x,_g_pUserInterface
1587  01f3 ee02          	ldw	x,(2,x)
1588  01f5 f6            	ld	a,(x)
1589  01f6 be05          	ldw	x,_g_pUserInterface
1590  01f8 e705          	ld	(5,x),a
1591                     ; 210 	UserInterface_ResetFocus();
1593  01fa cd00dd        	call	_UserInterface_ResetFocus
1595                     ; 212 	return TRUE;
1597  01fd a601          	ld	a,#1
1600  01ff 5b01          	addw	sp,#1
1601  0201 81            	ret	
1640                     ; 215 u8 UserInterface_ChangeTab(EditAction_t act)
1640                     ; 216 {
1641                     	switch	.text
1642  0202               _UserInterface_ChangeTab:
1644  0202 88            	push	a
1645       00000000      OFST:	set	0
1648                     ; 217 	if (g_pUserInterface->bStatus == UI_LOCKED)
1650  0203 92c605        	ld	a,[_g_pUserInterface.w]
1651  0206 4a            	dec	a
1652  0207 2603          	jrne	L707
1653                     ; 218 		return FALSE;
1657  0209 5b01          	addw	sp,#1
1658  020b 81            	ret	
1659  020c               L707:
1660                     ; 219 	if (g_pUserInterface->bField_Edit != g_pUserInterface->pSelTab->bFieldsNumber)
1662  020c be05          	ldw	x,_g_pUserInterface
1663  020e e605          	ld	a,(5,x)
1664  0210 ee02          	ldw	x,(2,x)
1665  0212 f1            	cp	a,(x)
1666  0213 2709          	jreq	L117
1667                     ; 221 		g_pUserInterface->bField_Edit = g_pUserInterface->pSelTab->bFieldsNumber;
1669  0215 be05          	ldw	x,_g_pUserInterface
1670  0217 ee02          	ldw	x,(2,x)
1671  0219 f6            	ld	a,(x)
1672  021a be05          	ldw	x,_g_pUserInterface
1673  021c e705          	ld	(5,x),a
1674  021e               L117:
1675                     ; 225 	if (act == INC_SEL)
1677  021e 7b01          	ld	a,(OFST+1,sp)
1678  0220 2629          	jrne	L317
1679                     ; 227 		g_pUserInterface->bSelected_Tab++;
1681  0222 be05          	ldw	x,_g_pUserInterface
1682                     ; 228 		g_pUserInterface->bSelected_Tab %= g_pUserInterface->bTabsNumber;
1684  0224 6c01          	inc	(1,x)
1685  0226 9093          	ldw	y,x
1686  0228 90e606        	ld	a,(6,y)
1687  022b 905f          	clrw	y
1688  022d 9097          	ld	yl,a
1689  022f e601          	ld	a,(1,x)
1690  0231 89            	pushw	x
1691  0232 5f            	clrw	x
1692  0233 97            	ld	xl,a
1693  0234 65            	divw	x,y
1694  0235 85            	popw	x
1695  0236 909f          	ld	a,yl
1696  0238 e701          	ld	(1,x),a
1697                     ; 229 		g_pUserInterface->pSelTab = UserInterface_GetSelTab();
1699  023a cd0000        	call	_UserInterface_GetSelTab
1701  023d 90be05        	ldw	y,_g_pUserInterface
1702  0240 90ef02        	ldw	(2,y),x
1703                     ; 230 		UserInterface_ResetFocus();
1705  0243 cd00dd        	call	_UserInterface_ResetFocus
1707                     ; 231 		return TRUE;
1709  0246 a601          	ld	a,#1
1712  0248 5b01          	addw	sp,#1
1713  024a 81            	ret	
1714  024b               L317:
1715                     ; 235 		g_pUserInterface->bSelected_Tab += g_pUserInterface->bTabsNumber;
1717  024b be05          	ldw	x,_g_pUserInterface

⌨️ 快捷键说明

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