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

📄 enoronhand.lss

📁 在AVR 平台下的控制代码,通过CAN控制
💻 LSS
📖 第 1 页 / 共 5 页
字号:
     82a:	bc 01       	movw	r22, r24
     82c:	cd 01       	movw	r24, r26
     82e:	20 eb       	ldi	r18, 0xB0	; 176
     830:	34 e0       	ldi	r19, 0x04	; 4
     832:	40 e0       	ldi	r20, 0x00	; 0
     834:	50 e0       	ldi	r21, 0x00	; 0
     836:	0e 94 09 08 	call	0x1012
     83a:	6b 01       	movw	r12, r22
     83c:	7c 01       	movw	r14, r24
     83e:	8e ef       	ldi	r24, 0xFE	; 254
     840:	97 e0       	ldi	r25, 0x07	; 7
     842:	80 1b       	sub	r24, r16
     844:	91 0b       	sbc	r25, r17
     846:	9c 01       	movw	r18, r24
     848:	44 27       	eor	r20, r20
     84a:	55 27       	eor	r21, r21
     84c:	c7 01       	movw	r24, r14
     84e:	b6 01       	movw	r22, r12
     850:	0e 94 28 08 	call	0x1050
	for (uc = 0; uc<_PT1KLEVEL_NUM_-1; uc++)
     854:	40 e0       	ldi	r20, 0x00	; 0
     856:	e0 e6       	ldi	r30, 0x60	; 96
     858:	f0 e0       	ldi	r31, 0x00	; 0
     85a:	a8 e6       	ldi	r26, 0x68	; 104
     85c:	b0 e0       	ldi	r27, 0x00	; 0
	{
		if (dwSensorValue<c_PT1KLine[uc])
     85e:	8d 91       	ld	r24, X+
     860:	9d 91       	ld	r25, X+
     862:	28 17       	cp	r18, r24
     864:	39 07       	cpc	r19, r25
     866:	48 f4       	brcc	.+18     	; 0x87a
		{
			cRoomTemp = c_RoomTempLine[uc]+(dwSensorValue-c_PT1KLine[uc])/4;
     868:	28 1b       	sub	r18, r24
     86a:	39 0b       	sbc	r19, r25
     86c:	36 95       	lsr	r19
     86e:	27 95       	ror	r18
     870:	36 95       	lsr	r19
     872:	27 95       	ror	r18
     874:	80 81       	ld	r24, Z
     876:	82 0f       	add	r24, r18
     878:	0c c0       	rjmp	.+24     	; 0x892
     87a:	4f 5f       	subi	r20, 0xFF	; 255
     87c:	31 96       	adiw	r30, 0x01	; 1
     87e:	47 30       	cpi	r20, 0x07	; 7
     880:	74 f3       	brlt	.-36     	; 0x85e
			return cRoomTemp;
		}	
	}
	cRoomTemp = c_RoomTempLine[_PT1KLEVEL_NUM_-1]+(dwSensorValue-c_PT1KLine[_PT1KLEVEL_NUM_-1])/4;
     882:	24 56       	subi	r18, 0x64	; 100
     884:	34 40       	sbci	r19, 0x04	; 4
     886:	36 95       	lsr	r19
     888:	27 95       	ror	r18
     88a:	36 95       	lsr	r19
     88c:	27 95       	ror	r18
     88e:	82 2f       	mov	r24, r18
     890:	80 5e       	subi	r24, 0xE0	; 224
	return cRoomTemp;
     892:	99 27       	eor	r25, r25
     894:	1f 91       	pop	r17
     896:	0f 91       	pop	r16
     898:	ff 90       	pop	r15
     89a:	ef 90       	pop	r14
     89c:	df 90       	pop	r13
     89e:	cf 90       	pop	r12
     8a0:	08 95       	ret

000008a2 <tdEnableEEPROMI2C>:
 
static Void tdEnableEEPROMI2C(Void)
{
    // disable WP here      
    tdI2COpen1();   
     8a2:	0e 94 e3 05 	call	0xbc6
     8a6:	08 95       	ret

000008a8 <tdDisableEEPROMI2C>:
}

static Void tdDisableEEPROMI2C(Void)
{
    // enable WP here
    tdI2CClose1();
     8a8:	0e 94 e8 05 	call	0xbd0
     8ac:	08 95       	ret

000008ae <tdSendEEPROMStart>:
}

static Byte tdSendEEPROMStart(Word wSubAddress)
{
     8ae:	cf 93       	push	r28
     8b0:	df 93       	push	r29
     8b2:	ec 01       	movw	r28, r24
    Byte Loop = 0;
    tdStart();
     8b4:	0e 94 49 06 	call	0xc92
    while (!tdI2CSendByte((Byte)(s_ucSlaveAddr & 0xfe)))
     8b8:	01 c0       	rjmp	.+2      	; 0x8bc
    {
        Byte Loop2;
        Loop++;
        if (Loop == 0xFF) return _FALSE_;
        for (Loop2 = 0; Loop2 < 0xFF; Loop2++)
     8ba:	ff cf       	rjmp	.-2      	; 0x8ba
        {
            Loop2--; Loop2++;
        }
        tdStart();
     8bc:	80 91 9b 00 	lds	r24, 0x009B
     8c0:	8e 7f       	andi	r24, 0xFE	; 254
     8c2:	0e 94 f7 05 	call	0xbee
     8c6:	88 23       	and	r24, r24
     8c8:	c1 f3       	breq	.-16     	; 0x8ba
    }
    if (tdI2CSendByte((Byte)(wSubAddress >> 8)) && tdI2CSendByte((Byte)wSubAddress))
     8ca:	8d 2f       	mov	r24, r29
     8cc:	99 27       	eor	r25, r25
     8ce:	0e 94 f7 05 	call	0xbee
     8d2:	88 23       	and	r24, r24
     8d4:	41 f0       	breq	.+16     	; 0x8e6
     8d6:	8c 2f       	mov	r24, r28
     8d8:	0e 94 f7 05 	call	0xbee
     8dc:	88 23       	and	r24, r24
     8de:	19 f0       	breq	.+6      	; 0x8e6
        return _TRUE_;
     8e0:	81 e0       	ldi	r24, 0x01	; 1
     8e2:	90 e0       	ldi	r25, 0x00	; 0
     8e4:	02 c0       	rjmp	.+4      	; 0x8ea
    return _FALSE_;
     8e6:	80 e0       	ldi	r24, 0x00	; 0
     8e8:	90 e0       	ldi	r25, 0x00	; 0
     8ea:	df 91       	pop	r29
     8ec:	cf 91       	pop	r28
     8ee:	08 95       	ret

000008f0 <tdEEPROMWrite>:
}

Void tdEEPROMWrite(Word wSubAddress, Byte * rpBuf, Word wLength)
{
     8f0:	6f 92       	push	r6
     8f2:	7f 92       	push	r7
     8f4:	8f 92       	push	r8
     8f6:	9f 92       	push	r9
     8f8:	af 92       	push	r10
     8fa:	bf 92       	push	r11
     8fc:	cf 92       	push	r12
     8fe:	df 92       	push	r13
     900:	ef 92       	push	r14
     902:	ff 92       	push	r15
     904:	0f 93       	push	r16
     906:	1f 93       	push	r17
     908:	cf 93       	push	r28
     90a:	df 93       	push	r29
     90c:	6c 01       	movw	r12, r24
    Word wLength2      = wLength;
     90e:	4a 01       	movw	r8, r20
    Byte * rpBuf2 = rpBuf;
     910:	3b 01       	movw	r6, r22
    Byte ucTryTimes    = _TRY_TIMES_;
    Byte ucPageOffset;
     tdEnableEEPROMI2C();
     912:	0e 94 51 04 	call	0x8a2
    
    while (ucTryTimes--)
    {
        wLength  = wLength2;
        rpBuf    = rpBuf2;
        
        ucPageOffset = wSubAddress % 32;
        if(ucPageOffset != 0 && (ucPageOffset +  wLength > 32)) /* Across bonduary. Should write page twice */
        {
            if (tdSendEEPROMStart(wSubAddress))
            {
                while (ucPageOffset++ < 32)
                    if(!tdI2CSendByte(*rpBuf++)) goto quit;
                ucPageOffset = 32 - wSubAddress % 32;
                wSubAddress += ucPageOffset;
                wLength     -= ucPageOffset;
                tdStop();
            } else
                goto quit;
        }
        if (wLength > 32)
        {    
            while (wLength > 32)
            {
                Byte ucLen = 32;
                if (tdSendEEPROMStart(wSubAddress))
                {
                    while (ucLen--)
                        if(!tdI2CSendByte(*rpBuf++)) goto quit;
                    wLength     -= 32;
                    wSubAddress += 32;
                    tdStop();
                } else
                    goto quit;
            }
        }
        if (tdSendEEPROMStart(wSubAddress))
            while (wLength--)
                if(!tdI2CSendByte(*rpBuf++)) goto quit;
                
quit:
        tdStop();
        if (wLength == 0xFFFF)
            break;
     916:	94 e0       	ldi	r25, 0x04	; 4
     918:	a9 2e       	mov	r10, r25
     91a:	e4 01       	movw	r28, r8
     91c:	73 01       	movw	r14, r6
     91e:	86 01       	movw	r16, r12
     920:	0f 71       	andi	r16, 0x1F	; 31
     922:	10 70       	andi	r17, 0x00	; 0
     924:	b0 2e       	mov	r11, r16
     926:	00 23       	and	r16, r16
     928:	61 f1       	breq	.+88     	; 0x982
     92a:	80 2f       	mov	r24, r16
     92c:	99 27       	eor	r25, r25
     92e:	87 fd       	sbrc	r24, 7
     930:	90 95       	com	r25
     932:	88 0d       	add	r24, r8
     934:	99 1d       	adc	r25, r9
     936:	81 97       	sbiw	r24, 0x21	; 33
     938:	20 f1       	brcs	.+72     	; 0x982
     93a:	c6 01       	movw	r24, r12
     93c:	0e 94 57 04 	call	0x8ae
     940:	88 23       	and	r24, r24
     942:	09 f4       	brne	.+2      	; 0x946
     944:	4c c0       	rjmp	.+152    	; 0x9de
     946:	80 2f       	mov	r24, r16
     948:	b3 94       	inc	r11
     94a:	80 32       	cpi	r24, 0x20	; 32
     94c:	54 f4       	brge	.+20     	; 0x962
     94e:	f7 01       	movw	r30, r14
     950:	81 91       	ld	r24, Z+
     952:	7f 01       	movw	r14, r30
     954:	0e 94 f7 05 	call	0xbee
     958:	88 23       	and	r24, r24
     95a:	09 f4       	brne	.+2      	; 0x95e
     95c:	40 c0       	rjmp	.+128    	; 0x9de
     95e:	8b 2d       	mov	r24, r11
     960:	f3 cf       	rjmp	.-26     	; 0x948
     962:	c6 01       	movw	r24, r12
     964:	8f 71       	andi	r24, 0x1F	; 31
     966:	90 70       	andi	r25, 0x00	; 0
     968:	20 e2       	ldi	r18, 0x20	; 32
     96a:	28 1b       	sub	r18, r24
     96c:	82 2f       	mov	r24, r18
     96e:	99 27       	eor	r25, r25
     970:	87 fd       	sbrc	r24, 7
     972:	90 95       	com	r25
     974:	c8 0e       	add	r12, r24
     976:	d9 1e       	adc	r13, r25
     978:	e4 01       	movw	r28, r8
     97a:	c8 1b       	sub	r28, r24
     97c:	d9 0b       	sbc	r29, r25
     97e:	0e 94 5e 06 	call	0xcbc
     982:	c1 32       	cpi	r28, 0x21	; 33
     984:	d1 05       	cpc	r29, r1
     986:	a8 f0       	brcs	.+42     	; 0x9b2
     988:	c6 01       	movw	r24, r12
     98a:	0e 94 57 04 	call	0x8ae
     98e:	88 23       	and	r24, r24
     990:	31 f1       	breq	.+76     	; 0x9de
     992:	1f e1       	ldi	r17, 0x1F	; 31
     994:	f7 01       	movw	r30, r14
     996:	81 91       	ld	r24, Z+
     998:	7f 01       	movw	r14, r30
     99a:	0e 94 f7 05 	call	0xbee
     99e:	88 23       	and	r24, r24
     9a0:	f1 f0       	breq	.+60     	; 0x9de
     9a2:	11 50       	subi	r17, 0x01	; 1
     9a4:	b8 f7       	brcc	.-18     	; 0x994
     9a6:	a0 97       	sbiw	r28, 0x20	; 32
     9a8:	80 e2       	ldi	r24, 0x20	; 32
     9aa:	90 e0       	ldi	r25, 0x00	; 0
     9ac:	c8 0e       	add	r12, r24
     9ae:	d9 1e       	adc	r13, r25
     9b0:	e6 cf       	rjmp	.-52     	; 0x97e
     9b2:	c6 01       	movw	r24, r12
     9b4:	0e 94 57 04 	call	0x8ae
     9b8:	88 23       	and	r24, r24
     9ba:	89 f0       	breq	.+34     	; 0x9de
     9bc:	21 97       	sbiw	r28, 0x01	; 1
     9be:	9f ef       	ldi	r25, 0xFF	; 255
     9c0:	cf 3f       	cpi	r28, 0xFF	; 255
     9c2:	d9 07       	cpc	r29, r25
     9c4:	61 f0       	breq	.+24     	; 0x9de
     9c6:	f7 01       	movw	r30, r14
     9c8:	81 91       	ld	r24, Z+
     9ca:	7f 01       	movw	r14, r30
     9cc:	0e 94 f7 05 	call	0xbee
     9d0:	88 23       	and	r24, r24
     9d2:	29 f0       	breq	.+10     	; 0x9de
     9d4:	21 97       	sbiw	r28, 0x01	; 1
     9d6:	ff ef       	ldi	r31, 0xFF	; 255
     9d8:	cf 3f       	cpi	r28, 0xFF	; 255
     9da:	df 07       	cpc	r29, r31
     9dc:	a1 f7       	brne	.-24     	; 0x9c6
     9de:	0e 94 5e 06 	call	0xcbc
     9e2:	cf 5f       	subi	r28, 0xFF	; 255
     9e4:	df 4f       	sbci	r29, 0xFF	; 255
     9e6:	29 f0       	breq	.+10     	; 0x9f2
     9e8:	aa 94       	dec	r10
     9ea:	9f ef       	ldi	r25, 0xFF	; 255
     9ec:	a9 16       	cp	r10, r25
     9ee:	09 f0       	breq	.+2      	; 0x9f2
     9f0:	94 cf       	rjmp	.-216    	; 0x91a
    }
    
    tdDisableEEPROMI2C();
     9f2:	0e 94 54 04 	call	0x8a8
     9f6:	df 91       	pop	r29
     9f8:	cf 91       	pop	r28
     9fa:	1f 91       	pop	r17
     9fc:	0f 91       	pop	r16
     9fe:	ff 90       	pop	r15
     a00:	ef 90       	pop	r14
     a02:	df 90       	pop	r13
     a04:	cf 90       	pop	r12
     a06:	bf 90       	pop	r11
     a08:	af 90       	pop	r10
     a0a:	9f 90       	pop	r9
     a0c:	8f 90       	pop	r8
     a0e:	7f 90       	pop	r7
     a10:	6f 90       	pop	r6
     a12:	08 95       	ret

00000a14 <tdEEPROMRead>:
}

Void tdEEPROMRead(Word wSubAddress, Byte * gpBuf, Word wLength)
{
     a14:	8f 92       	push	r8
     a16:	9f 92       	push	r9
     a18:	af 92       	push	r10
     a1a:	bf 92       	push	r11
     a1c:	cf 92       	push	r12
     a1e:	df 92       	push	r13
     a20:	ff 92       	push	r15
     a22:	0f 93       	push	r16
     a24:	1f 93       	push	r17
     a26:	cf 93       	push	r28
     a28:	df 93       	push	r29
     a2a:	4c 01       	movw	r8, r24
    Word wLength2     = wLength;
     a2c:	5a 01       	movw	r10, r20
    Byte * gpBuf2 = gpBuf;
     a2e:	6b 01       	movw	r12, r22
    Byte ucTryTimes    = _TRY_TIMES_;
 
    tdEnableEEPROMI2C();
     a30:	0e 94 51 04 	call	0x8a2

    while (ucTryTimes--)
    {
        wLength  = wLength2;
        gpBuf    = gpBuf2;
        if (tdSendEEPROMStart(wSubAddress))
        {
            tdStart();
            if(tdI2CSendByte((Byte)(s_ucSlaveAddr | 0x01)))
            {
                while (wLength)
                {
                    *gpBuf++ = tdI2CReceiveByte();
                    /*send ACK*/
                    if(--wLength)
                        tdACK();
                }
                /*send No ACK*/
                tdNOACK();
                tdStop();
                break;
            } 
        }
        
        tdStop();
     a34:	24 e0       	ldi	r18, 0x04	; 4
     a36:	f2 2e       	mov	r15, r18
     a38:	e5 01       	movw	r28, r10
     a3a:	86 01       	movw	r16, r12
     a3c:	c4 01       	movw	r24, r8
     a3e:	0e 94 57 04 	call	0x8ae
     a42:	88 23       	and	r24, r24
     a44:	d1 f0       	breq	.+52     	; 0xa7a
     a46:	0e 94 49 06 	call	0xc92
     a4a:	80 91 9b 00 	lds	r24, 0x009B
     a4e:	81 60       	ori	r24, 0x01	; 1
     a50:	0e 94 f7 05 	call	0xbee
     a54:	88 23       	and	r24, r24
     a56:	89 f0       	breq	.+34     	; 0xa7a
     a58:	20 97       	sbiw	r28, 0x00	; 0
     a5a:	51 f0       	breq	.+20     	; 0xa70
     a5c:	0e 94 2a 06 	call	0xc54
     a60:	f8 01       	movw	r30, r16
     a62:	81 93       	st	Z+, r24
     a64:	8f 01       	movw	r16, r30
     a66:	21 97       	sbiw	r28, 0x01	; 1
     a68:	b9 f3       	breq	.-18     	; 0xa58
     a6a:	0e 94 6c 06 	call	0xcd8
     a6e:	f4 cf       	rjmp	.-24     	; 0xa58
     a70:	0e 94 7c 06 	c

⌨️ 快捷键说明

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