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

📄 main.lss

📁 原创ateml avr 单片机遥控器解码程序
💻 LSS
📖 第 1 页 / 共 5 页
字号:
 7fa:	de b7       	in	r29, 0x3e	; 62
	TCNT1 = TCNT1_VAL;
 7fc:	86 ee       	ldi	r24, 0xE6	; 230
 7fe:	9a ef       	ldi	r25, 0xFA	; 250
 800:	90 93 4d 00 	sts	0x004D, r25
 804:	80 93 4c 00 	sts	0x004C, r24
	icrPrevious = TCNT1_VAL;
 808:	86 ee       	ldi	r24, 0xE6	; 230
 80a:	9a ef       	ldi	r25, 0xFA	; 250
 80c:	90 93 66 00 	sts	0x0066, r25
 810:	80 93 65 00 	sts	0x0065, r24
//	if(irState!=0)
//	{
		if(irState >=2)
 814:	80 91 6b 00 	lds	r24, 0x006B
 818:	82 30       	cpi	r24, 0x02	; 2
 81a:	18 f0       	brcs	.+6      	; 0x822 <__vector_9+0x3c>
			irKeyEvent = _IR_KEY_UP;		//按键释放
 81c:	84 e0       	ldi	r24, 0x04	; 4
 81e:	80 93 62 00 	sts	0x0062, r24
 822:	df 91       	pop	r29
 824:	cf 91       	pop	r28
 826:	9f 91       	pop	r25
 828:	8f 91       	pop	r24
 82a:	0f 90       	pop	r0
 82c:	0f be       	out	0x3f, r0	; 63
 82e:	0f 90       	pop	r0
 830:	1f 90       	pop	r1
 832:	18 95       	reti

00000834 <delay_ms>:
#include <remote.c>

void BoardKeyDetect(void);
void delay_ms(unsigned int t)
{
 834:	cf 93       	push	r28
 836:	df 93       	push	r29
 838:	cd b7       	in	r28, 0x3d	; 61
 83a:	de b7       	in	r29, 0x3e	; 62
 83c:	2e 97       	sbiw	r28, 0x0e	; 14
 83e:	0f b6       	in	r0, 0x3f	; 63
 840:	f8 94       	cli
 842:	de bf       	out	0x3e, r29	; 62
 844:	0f be       	out	0x3f, r0	; 63
 846:	cd bf       	out	0x3d, r28	; 61
 848:	9a 83       	std	Y+2, r25	; 0x02
 84a:	89 83       	std	Y+1, r24	; 0x01
	while (t)
 84c:	89 81       	ldd	r24, Y+1	; 0x01
 84e:	9a 81       	ldd	r25, Y+2	; 0x02
 850:	00 97       	sbiw	r24, 0x00	; 0
 852:	09 f4       	brne	.+2      	; 0x856 <delay_ms+0x22>
 854:	54 c0       	rjmp	.+168    	; 0x8fe <__stack+0x9f>
   The maximal possible delay is 262.14 ms / F_CPU in MHz.
 */
void
_delay_ms(double __ms)
{
 856:	80 e0       	ldi	r24, 0x00	; 0
 858:	90 e0       	ldi	r25, 0x00	; 0
 85a:	a0 e8       	ldi	r26, 0x80	; 128
 85c:	bf e3       	ldi	r27, 0x3F	; 63
 85e:	8b 83       	std	Y+3, r24	; 0x03
 860:	9c 83       	std	Y+4, r25	; 0x04
 862:	ad 83       	std	Y+5, r26	; 0x05
 864:	be 83       	std	Y+6, r27	; 0x06
	uint16_t __ticks;
	double __tmp = ((F_CPU) / 4e3) * __ms;
 866:	2d ec       	ldi	r18, 0xCD	; 205
 868:	3c ec       	ldi	r19, 0xCC	; 204
 86a:	4c e2       	ldi	r20, 0x2C	; 44
 86c:	55 e4       	ldi	r21, 0x45	; 69
 86e:	6b 81       	ldd	r22, Y+3	; 0x03
 870:	7c 81       	ldd	r23, Y+4	; 0x04
 872:	8d 81       	ldd	r24, Y+5	; 0x05
 874:	9e 81       	ldd	r25, Y+6	; 0x06
 876:	0e 94 67 07 	call	0xece <__mulsf3>
 87a:	dc 01       	movw	r26, r24
 87c:	cb 01       	movw	r24, r22
 87e:	89 87       	std	Y+9, r24	; 0x09
 880:	9a 87       	std	Y+10, r25	; 0x0a
 882:	ab 87       	std	Y+11, r26	; 0x0b
 884:	bc 87       	std	Y+12, r27	; 0x0c
	if (__tmp < 1.0)
 886:	20 e0       	ldi	r18, 0x00	; 0
 888:	30 e0       	ldi	r19, 0x00	; 0
 88a:	40 e8       	ldi	r20, 0x80	; 128
 88c:	5f e3       	ldi	r21, 0x3F	; 63
 88e:	69 85       	ldd	r22, Y+9	; 0x09
 890:	7a 85       	ldd	r23, Y+10	; 0x0a
 892:	8b 85       	ldd	r24, Y+11	; 0x0b
 894:	9c 85       	ldd	r25, Y+12	; 0x0c
 896:	0e 94 17 07 	call	0xe2e <__eqsf2>
 89a:	88 23       	and	r24, r24
 89c:	0c f0       	brlt	.+2      	; 0x8a0 <__stack+0x41>
 89e:	05 c0       	rjmp	.+10     	; 0x8aa <__stack+0x4b>
		__ticks = 1;
 8a0:	81 e0       	ldi	r24, 0x01	; 1
 8a2:	90 e0       	ldi	r25, 0x00	; 0
 8a4:	98 87       	std	Y+8, r25	; 0x08
 8a6:	8f 83       	std	Y+7, r24	; 0x07
 8a8:	1a c0       	rjmp	.+52     	; 0x8de <__stack+0x7f>
	else if (__tmp > 65535)
 8aa:	20 e0       	ldi	r18, 0x00	; 0
 8ac:	3f ef       	ldi	r19, 0xFF	; 255
 8ae:	4f e7       	ldi	r20, 0x7F	; 127
 8b0:	57 e4       	ldi	r21, 0x47	; 71
 8b2:	69 85       	ldd	r22, Y+9	; 0x09
 8b4:	7a 85       	ldd	r23, Y+10	; 0x0a
 8b6:	8b 85       	ldd	r24, Y+11	; 0x0b
 8b8:	9c 85       	ldd	r25, Y+12	; 0x0c
 8ba:	0e 94 1a 07 	call	0xe34 <__gesf2>
 8be:	18 16       	cp	r1, r24
 8c0:	0c f0       	brlt	.+2      	; 0x8c4 <__stack+0x65>
 8c2:	03 c0       	rjmp	.+6      	; 0x8ca <__stack+0x6b>
		__ticks = 0;	/* i.e. 65536 */
 8c4:	18 86       	std	Y+8, r1	; 0x08
 8c6:	1f 82       	std	Y+7, r1	; 0x07
 8c8:	0a c0       	rjmp	.+20     	; 0x8de <__stack+0x7f>
	else
		__ticks = (uint16_t)__tmp;
 8ca:	69 85       	ldd	r22, Y+9	; 0x09
 8cc:	7a 85       	ldd	r23, Y+10	; 0x0a
 8ce:	8b 85       	ldd	r24, Y+11	; 0x0b
 8d0:	9c 85       	ldd	r25, Y+12	; 0x0c
 8d2:	0e 94 fc 06 	call	0xdf8 <__fixsfsi>
 8d6:	dc 01       	movw	r26, r24
 8d8:	cb 01       	movw	r24, r22
 8da:	98 87       	std	Y+8, r25	; 0x08
 8dc:	8f 83       	std	Y+7, r24	; 0x07
 8de:	8f 81       	ldd	r24, Y+7	; 0x07
 8e0:	98 85       	ldd	r25, Y+8	; 0x08
 8e2:	9e 87       	std	Y+14, r25	; 0x0e
 8e4:	8d 87       	std	Y+13, r24	; 0x0d
 8e6:	8d 85       	ldd	r24, Y+13	; 0x0d
 8e8:	9e 85       	ldd	r25, Y+14	; 0x0e
 8ea:	01 97       	sbiw	r24, 0x01	; 1
 8ec:	f1 f7       	brne	.-4      	; 0x8ea <__stack+0x8b>
 8ee:	9e 87       	std	Y+14, r25	; 0x0e
 8f0:	8d 87       	std	Y+13, r24	; 0x0d
	{
		_delay_ms(1);
		t--;
 8f2:	89 81       	ldd	r24, Y+1	; 0x01
 8f4:	9a 81       	ldd	r25, Y+2	; 0x02
 8f6:	01 97       	sbiw	r24, 0x01	; 1
 8f8:	9a 83       	std	Y+2, r25	; 0x02
 8fa:	89 83       	std	Y+1, r24	; 0x01
 8fc:	a7 cf       	rjmp	.-178    	; 0x84c <delay_ms+0x18>
 8fe:	2e 96       	adiw	r28, 0x0e	; 14
 900:	0f b6       	in	r0, 0x3f	; 63
 902:	f8 94       	cli
 904:	de bf       	out	0x3e, r29	; 62
 906:	0f be       	out	0x3f, r0	; 63
 908:	cd bf       	out	0x3d, r28	; 61
 90a:	df 91       	pop	r29
 90c:	cf 91       	pop	r28
 90e:	08 95       	ret

00000910 <test>:
	}
}

void test(void)
{
 910:	cf 93       	push	r28
 912:	df 93       	push	r29
 914:	cd b7       	in	r28, 0x3d	; 61
 916:	de b7       	in	r29, 0x3e	; 62
//	while(1)
	{
		DVDPowOn();
 918:	80 91 3b 00 	lds	r24, 0x003B
 91c:	80 62       	ori	r24, 0x20	; 32
 91e:	80 93 3b 00 	sts	0x003B, r24
 922:	80 e2       	ldi	r24, 0x20	; 32
 924:	80 93 80 00 	sts	0x0080, r24
		delay_ms(1);
 928:	81 e0       	ldi	r24, 0x01	; 1
 92a:	90 e0       	ldi	r25, 0x00	; 0
 92c:	0e 94 1a 04 	call	0x834 <delay_ms>
		DVDPowOff();
 930:	80 91 3b 00 	lds	r24, 0x003B
 934:	8f 7d       	andi	r24, 0xDF	; 223
 936:	80 93 3b 00 	sts	0x003B, r24
 93a:	10 92 80 00 	sts	0x0080, r1
		delay_ms(1);
 93e:	81 e0       	ldi	r24, 0x01	; 1
 940:	90 e0       	ldi	r25, 0x00	; 0
 942:	0e 94 1a 04 	call	0x834 <delay_ms>
 946:	df 91       	pop	r29
 948:	cf 91       	pop	r28
 94a:	08 95       	ret

0000094c <SendIRCode>:
	}
}
void SendIRCode(BYTE irCode)
{
 94c:	cf 93       	push	r28
 94e:	df 93       	push	r29
 950:	cd b7       	in	r28, 0x3d	; 61
 952:	de b7       	in	r29, 0x3e	; 62
 954:	21 97       	sbiw	r28, 0x01	; 1
 956:	0f b6       	in	r0, 0x3f	; 63
 958:	f8 94       	cli
 95a:	de bf       	out	0x3e, r29	; 62
 95c:	0f be       	out	0x3f, r0	; 63
 95e:	cd bf       	out	0x3d, r28	; 61
 960:	89 83       	std	Y+1, r24	; 0x01
	ir_ack_f=ir_ack;
 962:	80 91 30 00 	lds	r24, 0x0030
 966:	80 74       	andi	r24, 0x40	; 64
 968:	80 93 7a 00 	sts	0x007A, r24
//	while(ir_ack_f==ir_ack)
	{					
		SendIRCodeStart(irCode);
 96c:	89 81       	ldd	r24, Y+1	; 0x01
 96e:	0e 94 ac 00 	call	0x158 <SendIRCodeStart>
		delay_ms(TIME300MS);
 972:	8c e2       	ldi	r24, 0x2C	; 44
 974:	91 e0       	ldi	r25, 0x01	; 1
 976:	0e 94 1a 04 	call	0x834 <delay_ms>
 97a:	21 96       	adiw	r28, 0x01	; 1
 97c:	0f b6       	in	r0, 0x3f	; 63
 97e:	f8 94       	cli
 980:	de bf       	out	0x3e, r29	; 62
 982:	0f be       	out	0x3f, r0	; 63
 984:	cd bf       	out	0x3d, r28	; 61
 986:	df 91       	pop	r29
 988:	cf 91       	pop	r28
 98a:	08 95       	ret

0000098c <RemoteInit>:
	}
}
void RemoteInit(void)
{
 98c:	cf 93       	push	r28
 98e:	df 93       	push	r29
 990:	cd b7       	in	r28, 0x3d	; 61
 992:	de b7       	in	r29, 0x3e	; 62
	SetKeyPowInPut();
 994:	80 91 3a 00 	lds	r24, 0x003A
 998:	8d 7f       	andi	r24, 0xFD	; 253
 99a:	80 93 3a 00 	sts	0x003A, r24
	SetKeyEJInPut();
 99e:	80 91 3a 00 	lds	r24, 0x003A
 9a2:	8b 7f       	andi	r24, 0xFB	; 251
 9a4:	80 93 3a 00 	sts	0x003A, r24
	SetDVDPowOutPut();
 9a8:	80 91 3a 00 	lds	r24, 0x003A
 9ac:	80 61       	ori	r24, 0x10	; 16
 9ae:	80 93 3a 00 	sts	0x003A, r24
	Set_EJ_SW_M_InPut();
 9b2:	80 91 3a 00 	lds	r24, 0x003A
 9b6:	8f 7b       	andi	r24, 0xBF	; 191
 9b8:	80 93 3a 00 	sts	0x003A, r24
	Set_LOAD_SW_M_InPut();
 9bc:	9f e7       	ldi	r25, 0x7F	; 127
 9be:	80 91 3a 00 	lds	r24, 0x003A
 9c2:	89 23       	and	r24, r25
 9c4:	80 93 3a 00 	sts	0x003A, r24
	SetIRInPut();
 9c8:	80 91 31 00 	lds	r24, 0x0031
 9cc:	8f 7e       	andi	r24, 0xEF	; 239
 9ce:	80 93 31 00 	sts	0x0031, r24
	SetIRAckInPut();
 9d2:	80 91 31 00 	lds	r24, 0x0031
 9d6:	8f 7b       	andi	r24, 0xBF	; 191
 9d8:	80 93 31 00 	sts	0x0031, r24
	SetIRAckInPut1();
 9dc:	80 91 31 00 	lds	r24, 0x0031
 9e0:	8f 7d       	andi	r24, 0xDF	; 223
 9e2:	80 93 31 00 	sts	0x0031, r24
	TCCR1A=0x00;
 9e6:	10 92 4f 00 	sts	0x004F, r1
//	TCCR1B=0x05;
	TCNT1=TCNT1_VAL;
 9ea:	86 ee       	ldi	r24, 0xE6	; 230
 9ec:	9a ef       	ldi	r25, 0xFA	; 250
 9ee:	90 93 4d 00 	sts	0x004D, r25
 9f2:	80 93 4c 00 	sts	0x004C, r24
	sbi(TIMSK,TICIE1);
 9f6:	80 91 59 00 	lds	r24, 0x0059
 9fa:	80 62       	ori	r24, 0x20	; 32
 9fc:	80 93 59 00 	sts	0x0059, r24
//	sbi(TIMSK,OCIE1A);
//	sbi(TIMSK,OCIE1B);
	sbi(TIMSK,TOIE1);
 a00:	80 91 59 00 	lds	r24, 0x0059
 a04:	84 60       	ori	r24, 0x04	; 4
 a06:	80 93 59 00 	sts	0x0059, r24
//		TCCR1B = 0;						//stop/............................................................
//	TCNT1  = TCNT1_VAL;				//初始化计数器值
	TCCR1B = (1<<ICNC1)|(1<<CS12)|(1<<CS10);	//输入捕捉噪声抑制,下降沿触发,1024分频,普通模式(WGM=0)
 a0a:	85 e8       	ldi	r24, 0x85	; 133
 a0c:	80 93 4e 00 	sts	0x004E, r24
//	sbi(TIFR,ICF1);
//	sbi(TIFR,OCF1A);
//	sbi(TIFR,OCF1B);
//	sbi(TIFR,TOV1);


	DVDPowOff();
 a10:	80 91 3b 00 	lds	r24, 0x003B
 a14:	8f 7d       	andi	r24, 0xDF	; 223
 a16:	80 93 3b 00 	sts	0x003B, r24
 a1a:	10 92 80 00 	sts	0x0080, r1
	irKeyRptTimes=0;
 a1e:	10 92 7f 00 	sts	0x007F, r1
	irKeyRpt_f=0;
 a22:	10 92 7b 00 	sts	0x007B, r1
	irKeyEvent=0;
 a26:	10 92 62 00 	sts	0x0062, r1
	irState=0;
 a2a:	10 92 6b 00 	sts	0x006B, r1
	icrPrevious=TCNT1_VAL;
 a2e:	86 ee       	ldi	r24, 0xE6	; 230
 a30:	9a ef       	ldi	r25, 0xFA	; 250
 a32:	90 93 66 00 	sts	0x0066, r25
 a36:	80 93 65 00 	sts	0x0065, r24
	boardKeyEvent=0;
 a3a:	10 92 7c 00 	sts	0x007C, r1
 a3e:	df 91       	pop	r29
 a40:	cf 91       	pop	r28
 a42:	08 95       	ret

00000a44 <main>:
}

int main(void)
{
 a44:	cf e5       	ldi	r28, 0x5F	; 95
 a46:	d8 e0       	ldi	r29, 0x08	; 8
 a48:	de bf       	out	0x3e, r29	; 62
 a4a:	cd bf       	out	0x3d, r28	; 61
	cli();
 a4c:	f8 94       	cli
	TIMER0Init();
 a4e:	0e 94 47 00 	call	0x8e <TIMER0Init>
	RemoteInit();	
 a52:	0e 94 c6 04 	call	0x98c <RemoteInit>
	sei();
 a56:	78 94       	sei
	for (;;)
	{
		BoardKeyDetect();
 a58:	0e 94 5f 06 	call	0xcbe <BoardKeyDetect>
		if(boardKeyEvent==BOARD_KEY_UP)
 a5c:	80 91 7c 00 	lds	r24, 0x007C
 a60:	82 30       	cpi	r24, 0x02	; 2
 a62:	09 f0       	breq	.+2      	; 0xa66 <main+0x22>
 a64:	51 c0       	rjmp	.+162    	; 0xb08 <main+0xc4>
		{			
			//test();
			boardKeyEvent=0;
 a66:	10 92 7c 00 	sts	0x007C, r1
			if(board_key==BOARD_KEY_POWER)
 a6a:	80 91 7d 00 	lds	r24, 0x007D
 a6e:	81 30       	cpi	r24, 0x01	; 1
 a70:	f1 f4       	brne	.+60     	; 0xaae <main+0x6a>
			{
				if(dvdpower_f==DVD_POWER_OFF)
 a72:	80 91 80 00 	lds	r24, 0x0080
 a76:	88 23       	and	r24, r24
 a78:	49 f4       	brne	.+18     	; 0xa8c <main+0x48>
				{
					DVDPowOn();
 a7a:	80 91 3b 00 	lds	r24, 0x003B
 a7e:	80 62       	ori	r24, 0x20	; 32
 a80:	80 93 3b 00 	sts	0x003B, r24
 a84:	80 e2       	ldi	r24, 0x20	; 32
 a86:	80 93 80 00 	sts	0x0080, r24
 a8a:	3e c0       	rjmp	.+124    	; 0xb08 <main+0xc4>
				}
				else
				{
					SendIRCode(IR_KEY_POWER);
 a8c:	80 ed       	ldi	r24, 0xD0	; 208
 a8e:	0e 94 a6 04 	call	0x94c <SendIRCode>
					SendIRCodeStop();
 a92:	0e 94 cf 00 	call	0x19e <SendIRCodeStop>
					delay_ms(TIME300MS);
 a96:	8c e2       	ldi	r24, 0x2C	; 44
 a98:	91 e0       	ldi	r25, 0x01	; 1
 a9a:	0e 94 1a 04 	call	0x834 <delay_ms>

⌨️ 快捷键说明

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