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

📄 gps.lss

📁 手持式GPS导航系统-源码
💻 LSS
📖 第 1 页 / 共 5 页
字号:
     976:	9d d2       	rcall	.+1338   	; 0xeb2 <LCD_print12>
				else LCD_print12(0,24," --by bozai");

			#endif
			}

			LCD_print12(0,36,total_statlites_useful);	/*定位用的卫星数目*/
     978:	4e e1       	ldi	r20, 0x1E	; 30
     97a:	51 e0       	ldi	r21, 0x01	; 1
     97c:	64 e2       	ldi	r22, 0x24	; 36
     97e:	70 e0       	ldi	r23, 0x00	; 0
     980:	80 e0       	ldi	r24, 0x00	; 0
     982:	90 e0       	ldi	r25, 0x00	; 0
     984:	96 d2       	rcall	.+1324   	; 0xeb2 <LCD_print12>
			LCD_print12(12,36,"/");
     986:	4c ed       	ldi	r20, 0xDC	; 220
     988:	50 e0       	ldi	r21, 0x00	; 0
     98a:	64 e2       	ldi	r22, 0x24	; 36
     98c:	70 e0       	ldi	r23, 0x00	; 0
     98e:	8c e0       	ldi	r24, 0x0C	; 12
     990:	90 e0       	ldi	r25, 0x00	; 0
     992:	8f d2       	rcall	.+1310   	; 0xeb2 <LCD_print12>
			LCD_print12(18,36,total_statlites_have_signal);	/*有信号的卫星数目*/
     994:	41 e2       	ldi	r20, 0x21	; 33
     996:	51 e0       	ldi	r21, 0x01	; 1
     998:	64 e2       	ldi	r22, 0x24	; 36
     99a:	70 e0       	ldi	r23, 0x00	; 0
     99c:	82 e1       	ldi	r24, 0x12	; 18
     99e:	90 e0       	ldi	r25, 0x00	; 0
     9a0:	88 d2       	rcall	.+1296   	; 0xeb2 <LCD_print12>

			/*北京时间转换及显示*/
			if(need_update1)
     9a2:	77 20       	and	r7, r7
     9a4:	f9 f4       	brne	.+62     	; 0x9e4 <main+0x512>
			{
				need_update1 = 0;
			}
			else
			{
				time_beijing = (time[0]-'0')*10 + (time[1] - '0') + 8;
     9a6:	30 91 4a 01 	lds	r19, 0x014A
     9aa:	38 50       	subi	r19, 0x08	; 8
     9ac:	80 91 49 01 	lds	r24, 0x0149
     9b0:	2a e0       	ldi	r18, 0x0A	; 10
     9b2:	82 9f       	mul	r24, r18
     9b4:	c0 01       	movw	r24, r0
     9b6:	11 24       	eor	r1, r1
     9b8:	38 0f       	add	r19, r24
     9ba:	30 93 48 01 	sts	0x0148, r19
				if(time_beijing > 23)
     9be:	38 31       	cpi	r19, 0x18	; 24
     9c0:	30 f0       	brcs	.+12     	; 0x9ce <main+0x4fc>
				{
					time[0] = '0';
     9c2:	80 e3       	ldi	r24, 0x30	; 48
     9c4:	80 93 49 01 	sts	0x0149, r24
					time[1] = (time_beijing%24) + '0';
     9c8:	83 2f       	mov	r24, r19
     9ca:	68 e1       	ldi	r22, 0x18	; 24
     9cc:	07 c0       	rjmp	.+14     	; 0x9dc <main+0x50a>
				}
				else
				{
					time[0] = time_beijing/10 + '0';
     9ce:	83 2f       	mov	r24, r19
     9d0:	6a e0       	ldi	r22, 0x0A	; 10
     9d2:	7c d5       	rcall	.+2808   	; 0x14cc <__udivmodqi4>
     9d4:	80 5d       	subi	r24, 0xD0	; 208
     9d6:	80 93 49 01 	sts	0x0149, r24
					time[1] = time_beijing%10 + '0';
     9da:	83 2f       	mov	r24, r19
     9dc:	77 d5       	rcall	.+2798   	; 0x14cc <__udivmodqi4>
     9de:	90 5d       	subi	r25, 0xD0	; 208
     9e0:	90 93 4a 01 	sts	0x014A, r25
				}
			}
			LCD_print12(36,36,time);	/*显示时间*/
     9e4:	49 e4       	ldi	r20, 0x49	; 73
     9e6:	51 e0       	ldi	r21, 0x01	; 1
     9e8:	64 e2       	ldi	r22, 0x24	; 36
     9ea:	70 e0       	ldi	r23, 0x00	; 0
     9ec:	84 e2       	ldi	r24, 0x24	; 36
     9ee:	90 e0       	ldi	r25, 0x00	; 0
     9f0:	60 d2       	rcall	.+1216   	; 0xeb2 <LCD_print12>
			
			lcdUpdateDisplay();	/*显示*/	
     9f2:	92 d1       	rcall	.+804    	; 0xd18 <lcdUpdateDisplay>
		}

/*以下为GPS数据解析部分*/
		temp = USART_getchar();
     9f4:	c6 d3       	rcall	.+1932   	; 0x1182 <USART_getchar>
		if(temp == '$')					/*搜寻开头信息*/
     9f6:	84 32       	cpi	r24, 0x24	; 36
     9f8:	09 f0       	breq	.+2      	; 0x9fc <main+0x52a>
     9fa:	99 cd       	rjmp	.-1230   	; 0x52e <main+0x5c>
     9fc:	00 e0       	ldi	r16, 0x00	; 0
		{
			i = 0;
			while(1)					/*截取语句tag*/
			{
				temp = USART_getchar();
     9fe:	c1 d3       	rcall	.+1922   	; 0x1182 <USART_getchar>
     a00:	e0 2f       	mov	r30, r16
     a02:	f0 e0       	ldi	r31, 0x00	; 0
				if(temp != ',')			/*tag结尾的','号*/
     a04:	8c 32       	cpi	r24, 0x2C	; 44
     a06:	29 f0       	breq	.+10     	; 0xa12 <main+0x540>
					data_buffer[i++] = temp;
     a08:	ed 5a       	subi	r30, 0xAD	; 173
     a0a:	fe 4f       	sbci	r31, 0xFE	; 254
     a0c:	80 83       	st	Z, r24
     a0e:	0f 5f       	subi	r16, 0xFF	; 255
     a10:	f6 cf       	rjmp	.-20     	; 0x9fe <main+0x52c>
				else break;
			}
			data_buffer[i] = '\0';		/*添0*/
     a12:	ed 5a       	subi	r30, 0xAD	; 173
     a14:	fe 4f       	sbci	r31, 0xFE	; 254
     a16:	10 82       	st	Z, r1

/***************************** GPGGA 消息 **************************/
			if(strcmp(data_buffer,"GPGGA\0") == 0)
     a18:	6e ed       	ldi	r22, 0xDE	; 222
     a1a:	70 e0       	ldi	r23, 0x00	; 0
     a1c:	83 e5       	ldi	r24, 0x53	; 83
     a1e:	91 e0       	ldi	r25, 0x01	; 1
     a20:	bf d3       	rcall	.+1918   	; 0x11a0 <strcmp>
     a22:	00 97       	sbiw	r24, 0x00	; 0
     a24:	09 f0       	breq	.+2      	; 0xa28 <main+0x556>
     a26:	6e c0       	rjmp	.+220    	; 0xb04 <main+0x632>
			{
				while(USART_getchar() != ',');	/*忽略时间信息,实际显示时间从GPRMC里获得*/
     a28:	ac d3       	rcall	.+1880   	; 0x1182 <USART_getchar>
     a2a:	8c 97       	sbiw	r24, 0x2c	; 44
     a2c:	e9 f7       	brne	.-6      	; 0xa28 <main+0x556>
     a2e:	03 e0       	ldi	r16, 0x03	; 3

				/*获得纬度数据 start*/
				i = 3;				/*前两个数据预留用于显示如 'N:'信息*/
				while(1)
				{
					temp = USART_getchar();
     a30:	a8 d3       	rcall	.+1872   	; 0x1182 <USART_getchar>
					if(temp == ',')	/*结束*/
     a32:	8c 32       	cpi	r24, 0x2C	; 44
     a34:	61 f0       	breq	.+24     	; 0xa4e <main+0x57c>
						break;
					else
					{
						if(i == 5)latitude[i++] = '.';	/*添加'.'*/
     a36:	05 30       	cpi	r16, 0x05	; 5
     a38:	19 f4       	brne	.+6      	; 0xa40 <main+0x56e>
     a3a:	40 92 f8 00 	sts	0x00F8, r4
     a3e:	06 e0       	ldi	r16, 0x06	; 6
						latitude[i++] = temp;
     a40:	e0 2f       	mov	r30, r16
     a42:	f0 e0       	ldi	r31, 0x00	; 0
     a44:	ed 50       	subi	r30, 0x0D	; 13
     a46:	ff 4f       	sbci	r31, 0xFF	; 255
     a48:	80 83       	st	Z, r24
     a4a:	0f 5f       	subi	r16, 0xFF	; 255
     a4c:	f1 cf       	rjmp	.-30     	; 0xa30 <main+0x55e>
					}	
				}
				latitude[i] = '\0';				/*字符串结束*/
     a4e:	e0 2f       	mov	r30, r16
     a50:	f0 e0       	ldi	r31, 0x00	; 0
     a52:	ed 50       	subi	r30, 0x0D	; 13
     a54:	ff 4f       	sbci	r31, 0xFF	; 255
     a56:	10 82       	st	Z, r1

				temp = USART_getchar();
     a58:	94 d3       	rcall	.+1832   	; 0x1182 <USART_getchar>
				if(temp != ',')				/*有效数据*/
     a5a:	8c 32       	cpi	r24, 0x2C	; 44
     a5c:	19 f0       	breq	.+6      	; 0xa64 <main+0x592>
				{
					latitude[0] = temp;	/*获得北纬还是南纬*/
     a5e:	80 93 f3 00 	sts	0x00F3, r24
					//latitude[1] = ':';				/*冒号*/
					temp = USART_getchar();			/*跳过接下来的','号*/
     a62:	8f d3       	rcall	.+1822   	; 0x1182 <USART_getchar>
     a64:	02 e0       	ldi	r16, 0x02	; 2

				/*获得经度数据 start*/
				i = 2;				/*前两个数据预留用于显示如 'E:'信息*/
				while(1)
				{
					temp = USART_getchar();
     a66:	8d d3       	rcall	.+1818   	; 0x1182 <USART_getchar>
					if(temp == ',')	/*结束*/
     a68:	8c 32       	cpi	r24, 0x2C	; 44
     a6a:	61 f0       	breq	.+24     	; 0xa84 <main+0x5b2>
						break;
					else
					{
						if(i == 5)longitude[i++] = '.';	/*添加'.'*/
     a6c:	05 30       	cpi	r16, 0x05	; 5
     a6e:	19 f4       	brne	.+6      	; 0xa76 <main+0x5a4>
     a70:	40 92 06 01 	sts	0x0106, r4
     a74:	06 e0       	ldi	r16, 0x06	; 6
						longitude[i++] = temp;
     a76:	e0 2f       	mov	r30, r16
     a78:	f0 e0       	ldi	r31, 0x00	; 0
     a7a:	ef 5f       	subi	r30, 0xFF	; 255
     a7c:	fe 4f       	sbci	r31, 0xFE	; 254
     a7e:	80 83       	st	Z, r24
     a80:	0f 5f       	subi	r16, 0xFF	; 255
     a82:	f1 cf       	rjmp	.-30     	; 0xa66 <main+0x594>
					}	
				}
				longitude[i] = '\0';				/*字符串结束*/
     a84:	e0 2f       	mov	r30, r16
     a86:	f0 e0       	ldi	r31, 0x00	; 0
     a88:	ef 5f       	subi	r30, 0xFF	; 255
     a8a:	fe 4f       	sbci	r31, 0xFE	; 254
     a8c:	10 82       	st	Z, r1

				temp = USART_getchar();
     a8e:	79 d3       	rcall	.+1778   	; 0x1182 <USART_getchar>
				if(temp != ',')					/*有效数据*/
     a90:	8c 32       	cpi	r24, 0x2C	; 44
     a92:	19 f0       	breq	.+6      	; 0xa9a <main+0x5c8>
				{
					longitude[0] = temp;	/*获得北纬还是南纬*/
     a94:	80 93 01 01 	sts	0x0101, r24
					//longitude[1] = ':';				/*冒号*/
					temp = USART_getchar();			/*跳过接下来的','号*/
     a98:	74 d3       	rcall	.+1768   	; 0x1182 <USART_getchar>
				}
				/*获得经度数据 end*/

				/*获的质量因子 start*/
				temp = USART_getchar();
     a9a:	73 d3       	rcall	.+1766   	; 0x1182 <USART_getchar>
				if(temp != ',')						/*有效数据*/
     a9c:	8c 32       	cpi	r24, 0x2C	; 44
     a9e:	09 f0       	breq	.+2      	; 0xaa2 <main+0x5d0>
				{
					fix_valid = temp-0x30;			/*转ASCII到实际二进制数据*/
					temp = USART_getchar();			/*跳过接下来的','号*/
     aa0:	70 d3       	rcall	.+1760   	; 0x1182 <USART_getchar>
				}
				else fix_valid = 0;
				/*获的质量因子 end*/

				/*获得可使用的卫星数 start*/
				temp = USART_getchar();
     aa2:	6f d3       	rcall	.+1758   	; 0x1182 <USART_getchar>
				if(temp != ',')
     aa4:	8c 32       	cpi	r24, 0x2C	; 44
     aa6:	49 f0       	breq	.+18     	; 0xaba <main+0x5e8>
				{
					total_statlites_useful[0] = temp;
     aa8:	80 93 1e 01 	sts	0x011E, r24
					total_statlites_useful[1] = USART_getchar();
     aac:	6a d3       	rcall	.+1748   	; 0x1182 <USART_getchar>
     aae:	80 93 1f 01 	sts	0x011F, r24
					total_statlites_useful[2] = '\0';
     ab2:	10 92 20 01 	sts	0x0120, r1
					temp = USART_getchar();				/*跳过接下来的','号*/
     ab6:	65 d3       	rcall	.+1738   	; 0x1182 <USART_getchar>
     ab8:	07 c0       	rjmp	.+14     	; 0xac8 <main+0x5f6>
				}
				else
				{
					total_statlites_useful[0] = '0';
     aba:	80 e3       	ldi	r24, 0x30	; 48
     abc:	80 93 1e 01 	sts	0x011E, r24
					total_statlites_useful[1] = '0';
     ac0:	80 93 1f 01 	sts	0x011F, r24
					total_statlites_useful[2] = '\0';
     ac4:	10 92 20 01 	sts	0x0120, r1

				}
				/*获得可使用的卫星数 end*/

				while(USART_getchar() != ',');	/*忽略水平定为精度信息*/
     ac8:	5c d3       	rcall	.+1720   	; 0x1182 <USART_getchar>
     aca:	8c 97       	sbiw	r24, 0x2c	; 44
     acc:	e9 f7       	brne	.-6      	; 0xac8 <main+0x5f6>
     ace:	02 e0       	ldi	r16, 0x02	; 2
				i = 2;
				//altitude[i++] = 'A';
				//altitude[i++] = ':';
				while(1)
				{
					temp = USART_getchar();
     ad0:	58 d3       	rcall	.+1712   	; 0x1182 <USART_getchar>
					if(temp == ',')	/*结束*/
     ad2:	8c 32       	cpi	r24, 0x2C	; 44
     ad4:	39 f0       	breq	.+14     	; 0xae4 <main+0x612>
						break;
					else
						altitude[i++] = temp;
     ad6:	e0 2f       	mov	r30, r16
     ad8:	f0 e0       	ldi	r31, 0x00	; 0
     ada:	e1 5f       	subi	r30, 0xF1	; 241
     adc:	fe 4f       	sbci	r31, 0xFE	; 254
     ade:	80 83       	st	Z, r24
     ae0:	0f 5f       	subi	r16, 0xFF	; 255
     ae2:	f6 cf       	rjmp	.-20     	; 0xad0 <main+0x5fe>
				}

				temp = USART_getchar();
     ae4:	4e d3       	rcall	.+1692   	; 0x1182 <USART_getchar>
				if(temp != ',')					/*有效数据*/
     ae6:	8c 32       	cpi	r24, 0x2C	; 44
     ae8:	39 f0       	breq	.+14     	; 0xaf8 <main+0x626>
				{
					altitude[i++] = temp;	/*获得单位*/
     aea:	e0 2f       	mov	r30, r16
     aec:	f0 e0       	ldi	r31, 0x00	; 0
     aee:	e1 5f       	subi	r30, 0xF1	; 241
     af0:	fe 4f       	sbci	r31, 0xFE	; 254
     af2:	80 83       	st	Z, r24
     af4:	0f 5f       	subi	r16, 0xFF	; 255
					temp = USART_getchar();			/*跳过接下来的','号*/
     af6:	45 d3       	rcall	.+1674   	; 0x1182 <USART_getchar>

⌨️ 快捷键说明

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