base.s
来自「AVR 门锁的程序 包含与模块通讯 密码按键」· S 代码 · 共 63 行
S
63 行
#include <avr/io.h>
//11.0592M Clock 延时均为近似
.global Delay1uS
Delay1uS:
//NOP
NOP
RET
.global DelayNuS
DelayNuS:
LoopuS:
SUBI R24,0x01//R24-1
CALL Delay1uS
BRNE LoopuS
RET
.global Delay1mS
Delay1mS:
PUSH R24
//Delay 250uS
LDI R24,250
LoopuST1:
SUBI R24,0x01//R24-1
CALL Delay1uS
BRNE LoopuST1
//Delay 250uS
LDI R24,250
LoopuST2:
SUBI R24,0x01//R24-1
CALL Delay1uS
BRNE LoopuST2
//Delay 250uS
LDI R24,250
LoopuST3:
SUBI R24,0x01//R24-1
CALL Delay1uS
BRNE LoopuST3
//Delay 250uS
LDI R24,250
LoopuST4:
SUBI R24,0x01//R24-1
CALL Delay1uS
BRNE LoopuST4
POP R24
RET
.global DelayNmS
DelayNmS:
LoopmS:
SUBI R24,0x01//R24-1
LDS R25,SREG
CALL Delay1mS
STS SREG,R25
BRNE LoopmS
RET
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?