📄 hd_support.s
字号:
sei
.dbline 215
mov R16,R10
rcall _UARTaddDataToRxBuff
.dbline 215
.dbline -2
L6:
.dbline 0 ; func end
ld R10,y+
ld R0,y+
out 0x3f,R0
ld R31,y+
ld R30,y+
ld R27,y+
ld R26,y+
ld R25,y+
ld R24,y+
ld R19,y+
ld R18,y+
ld R17,y+
ld R16,y+
ld R9,y+
ld R8,y+
ld R7,y+
ld R6,y+
ld R5,y+
ld R4,y+
ld R3,y+
ld R2,y+
ld R1,y+
ld R0,y+
reti
.dbsym r cTempUDR0 10 c
.dbend
.dbfunc e USART0_TX_ISR _USART0_TX_ISR fV
; cTransmitByte -> y+0
.even
_USART0_TX_ISR::
st -y,R0
st -y,R1
st -y,R2
st -y,R3
st -y,R4
st -y,R5
st -y,R6
st -y,R7
st -y,R8
st -y,R9
st -y,R16
st -y,R17
st -y,R18
st -y,R19
st -y,R24
st -y,R25
st -y,R26
st -y,R27
st -y,R30
st -y,R31
in R0,0x3f
st -y,R0
sbiw R28,1
.dbline -1
.dbline 225
; }
;
; /***********************************************************
; * 函数说明:串口发送完成中断处理函数 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数:INSERT_USART0_TX_ISR_CODE *
; ***********************************************************/
; void USART0_TX_ISR(void)
; {
.dbline 226
; INSERT_USART0_TX_ISR_CODE
sei
.dbline 226
.dbline 226
clr R2
std y+0,R2
.dbline 226
movw R16,R28
rcall _UARTgetDataFromTxBuff
tst R16
brne L8
X0:
.dbline 226
.dbline 226
ldi R24,1
sts _g_bIfSerialTransmitCompleted,R24
.dbline 226
rjmp L9
L8:
.dbline 226
.dbline 226
clr R2
sts _g_bIfSerialTransmitCompleted,R2
.dbline 226
ldd R2,y+0
sts 198,R2
.dbline 226
L9:
.dbline 226
.dbline 226
.dbline -2
L7:
.dbline 0 ; func end
adiw R28,1
ld R0,y+
out 0x3f,R0
ld R31,y+
ld R30,y+
ld R27,y+
ld R26,y+
ld R25,y+
ld R24,y+
ld R19,y+
ld R18,y+
ld R17,y+
ld R16,y+
ld R9,y+
ld R8,y+
ld R7,y+
ld R6,y+
ld R5,y+
ld R4,y+
ld R3,y+
ld R2,y+
ld R1,y+
ld R0,y+
reti
.dbsym l cTransmitByte 0 c
.dbend
.dbfunc s SPI_INIT _SPI_INIT fV
.even
_SPI_INIT:
.dbline -1
.dbline 236
; }
;
; /***********************************************************
; * 函数说明: SPI初始化函数 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数: 无 *
; ***********************************************************/
; static void SPI_INIT(void)
; {
.dbline 237
; SPCR = 0xEE; //setup SPI Slave Model
ldi R24,238
out 0x2c,R24
.dbline 238
; SPSR = 0x00; //setup SPI
clr R2
out 0x2d,R2
.dbline -2
L10:
.dbline 0 ; func end
ret
.dbend
.dbfunc e SPI_STC_ISR _SPI_STC_ISR fV
; chTempData0 -> R16
.even
_SPI_STC_ISR::
st -y,R2
st -y,R16
st -y,R24
st -y,R25
st -y,R30
st -y,R31
in R2,0x3f
st -y,R2
.dbline -1
.dbline 248
; }
;
; /***********************************************************
; * 函数说明: SPI通讯完成中断处理函数 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数: INSERT_SPI_STC_ISR_CODE *
; ***********************************************************/
; void SPI_STC_ISR(void)
; {
.dbline 249
; INSERT_SPI_STC_ISR_CODE
.dbline 249
in R16,0x2e
.dbline 249
lds R2,_g_bIfSendCMD
tst R2
breq L12
X1:
lds R2,_g_bIfStartCMD
tst R2
breq L12
X2:
.dbline 249
.dbline 249
ldi R24,<_g_chCMDBuffer
ldi R25,>_g_chCMDBuffer
lds R30,_g_chDataCounter
subi R30,255 ; addi 1
clr R31
add R30,R24
adc R31,R25
ldd R2,z+0
out 0x2e,R2
.dbline 249
L12:
.dbline 249
ldi R24,<_g_chDataBuffer
ldi R25,>_g_chDataBuffer
lds R30,_g_chDataCounter
clr R31
add R30,R24
adc R31,R25
std z+0,R16
.dbline 249
lds R2,_g_chDataCounter
tst R2
breq L14
X3:
mov R24,R2
cpi R24,16
brsh L14
X4:
.dbline 249
.dbline 249
lds R2,_g_chXOR
eor R2,R16
sts _g_chXOR,R2
.dbline 249
L14:
.dbline 249
lds R24,_g_chDataCounter
subi R24,255 ; addi 1
sts _g_chDataCounter,R24
.dbline 249
cpi R24,17
brne L16
X5:
lds R24,_g_bIfSendCMD
cpi R24,1
brne L16
X6:
lds R24,_g_bIfStartCMD
cpi R24,1
brne L16
X7:
.dbline 249
.dbline 249
clr R2
sts _g_bIfSendCMD,R2
.dbline 249
sts _g_bIfStartCMD,R2
.dbline 249
sts _g_bIfSendHead,R2
.dbline 249
L16:
.dbline 249
.dbline -2
L11:
.dbline 0 ; func end
ld R2,y+
out 0x3f,R2
ld R31,y+
ld R30,y+
ld R25,y+
ld R24,y+
ld R16,y+
ld R2,y+
reti
.dbsym r chTempData0 16 c
.dbend
.dbfunc s PCINT_INIT _PCINT_INIT fV
.even
_PCINT_INIT:
.dbline -1
.dbline 259
; }
;
; /***********************************************************
; * 函数说明: 引脚电平变化中断处理程序 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数: 无 *
; ***********************************************************/
; static void PCINT_INIT(void)
; {
.dbline 260
; PCICR |= BIT(PCIE0)|BIT(PCIE1);
lds R24,104
ori R24,3
sts 104,R24
.dbline 261
; PCMSK0 = BIT(PCINT2);
ldi R24,4
sts 107,R24
.dbline 262
; PCMSK1 = BIT(PCINT8);
ldi R24,1
sts 108,R24
.dbline -2
L18:
.dbline 0 ; func end
ret
.dbend
.dbfunc e PCINT0_ISR _PCINT0_ISR fV
.even
_PCINT0_ISR::
st -y,R0
st -y,R1
st -y,R2
st -y,R3
st -y,R4
st -y,R5
st -y,R24
st -y,R30
st -y,R31
in R0,0x3f
st -y,R0
.dbline -1
.dbline 272
; }
;
; /***********************************************************
; * 函数说明: 引脚电平变化中断处理函数 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数: INSERT_PCINT0_ISR_CODE *
; ***********************************************************/
; void PCINT0_ISR(void)
; {
.dbline 273
; INSERT_PCINT0_ISR_CODE
sei
.dbline 273
.dbline 273
sbis 0x3,2
rjmp L20
X8:
.dbline 273
.dbline 273
lds R2,_g_bIfSendCMD
tst R2
breq L22
X9:
.dbline 273
.dbline 273
lds R2,_g_chCMDBuffer
out 0x2e,R2
.dbline 273
ldi R24,1
sts _g_bIfSendHead,R24
.dbline 273
L22:
.dbline 273
lds R2,_g_chXOR
tst R2
brne L24
X10:
.dbline 273
.dbline 273
ldi R30,<_g_chDataBuffer+3
ldi R31,>_g_chDataBuffer+3
ldd R2,z+0
ldd R3,z+1
ldd R4,z+2
ldd R5,z+3
sts _g_fAbsoluteX+1,R3
sts _g_fAbsoluteX,R2
sts _g_fAbsoluteX+2+1,R5
sts _g_fAbsoluteX+2,R4
.dbline 273
ldi R30,<_g_chDataBuffer+7
ldi R31,>_g_chDataBuffer+7
ldd R2,z+0
ldd R3,z+1
ldd R4,z+2
ldd R5,z+3
sts _g_fAbsoluteY+1,R3
sts _g_fAbsoluteY,R2
sts _g_fAbsoluteY+2+1,R5
sts _g_fAbsoluteY+2,R4
.dbline 273
ldi R30,<_g_chDataBuffer+11
ldi R31,>_g_chDataBuffer+11
ldd R2,z+0
ldd R3,z+1
ldd R4,z+2
ldd R5,z+3
sts _g_fAbsoluteAngle+1,R3
sts _g_fAbsoluteAngle,R2
sts _g_fAbsoluteAngle+2+1,R5
sts _g_fAbsoluteAngle+2,R4
.dbline 273
ldi R24,1
sts _ProcPCB+6+2,R24
.dbline 273
L24:
.dbline 273
clr R2
sts _g_chDataCounter,R2
.dbline 273
rjmp L21
L20:
.dbline 273
.dbline 273
clr R2
sts _g_chXOR,R2
.dbline 273
lds R2,_g_bIfSendCMD
tst R2
breq L31
X11:
lds R2,_g_bIfSendHead
tst R2
breq L31
X12:
.dbline 273
.dbline 273
ldi R24,1
sts _g_bIfStartCMD,R24
.dbline 273
L31:
.dbline 273
L21:
.dbline 273
.dbline -2
L19:
.dbline 0 ; func end
ld R0,y+
out 0x3f,R0
ld R31,y+
ld R30,y+
ld R24,y+
ld R5,y+
ld R4,y+
ld R3,y+
ld R2,y+
ld R1,y+
ld R0,y+
reti
.dbend
.dbfunc e PCINT1_ISR _PCINT1_ISR fV
.even
_PCINT1_ISR::
st -y,R1
st -y,R24
st -y,R25
in R1,0x3f
st -y,R1
.dbline -1
.dbline 283
; }
;
; /***********************************************************
; * 函数说明: 引脚电平变化中断处理函数 *
; * 输入: 无 *
; * 输出: 无 *
; * 调用函数: INSERT_PCINT1_ISR_CODE *
; ***********************************************************/
; void PCINT1_ISR(void)
; {
.dbline 284
; INSERT_PCINT1_ISR_CODE
sei
.dbline 284
.dbline 284
in R24,0x6
andi R24,1
in R25,0x6
lsr R25
andi R25,1
cp R25,R24
brne L34
X13:
.dbline 284
.dbline 284
lds R24,_g_wCounter
lds R25,_g_wCounter+1
adiw R24,1
sts _g_wCounter+1,R25
sts _g_wCounter,R24
.dbline 284
rjmp L35
L34:
.dbline 284
.dbline 284
lds R24,_g_wCounter
lds R25,_g_wCounter+1
sbiw R24,1
sts _g_wCounter+1,R25
sts _g_wCounter,R24
.dbline 284
L35:
.dbline 284
lds R24,_g_wCounter
lds R25,_g_wCounter+1
andi R25,3
sts _g_wCounter+1,R25
sts _g_wCounter,R24
.dbline 284
.dbline -2
L33:
.dbline 0 ; func end
ld R1,y+
out 0x3f,R1
ld R25,y+
ld R24,y+
ld R1,y+
reti
.dbend
; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -