Lagere Macros in eigene Datei aus
This commit is contained in:
16
main.asm
16
main.asm
@@ -16,19 +16,7 @@
|
||||
.org 0x0020
|
||||
rjmp overflow_handler
|
||||
|
||||
;========
|
||||
; Macros
|
||||
;========
|
||||
|
||||
.macro left_to_right
|
||||
in active_led, PORTD
|
||||
rol active_led
|
||||
brcc PC+2
|
||||
ldi active_led, 0b00000001
|
||||
out PORTD, active_led
|
||||
.endmacro
|
||||
|
||||
;========
|
||||
.include "./macros.inc"
|
||||
|
||||
init:
|
||||
;--
|
||||
@@ -65,7 +53,7 @@ overflow_handler:
|
||||
cpi overflows, 246 ; bei ~980 Überläufe/Sekunde entsprechen 245 Überläufe ca. 250ms
|
||||
brne overflow_handler_exit ; early Return wenn Schwellenwert noch nicht erreicht
|
||||
clr overflows ; Überlaufzähler kontrolliert zurücksetzen
|
||||
left_to_right
|
||||
left_to_right active_led
|
||||
overflow_handler_exit:
|
||||
reti
|
||||
|
||||
|
||||
Reference in New Issue
Block a user