Create tap tempo ISR branching logic
This commit is contained in:
+20
@@ -2,3 +2,23 @@
|
|||||||
ldi r20, \target_high
|
ldi r20, \target_high
|
||||||
ldi r19, \target_low
|
ldi r19, \target_low
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
ticks_to_bpm:
|
||||||
|
ret
|
||||||
|
|
||||||
|
tap_tempo_isr:
|
||||||
|
; Timer not started yet (first button press after expiration)
|
||||||
|
lds r16, timer0_overflow_count
|
||||||
|
cp r16, r0
|
||||||
|
breq start_timer
|
||||||
|
|
||||||
|
; Timer started
|
||||||
|
; wait for next press
|
||||||
|
; better to update at each press, unless expiration
|
||||||
|
rcall ticks_to_bpm
|
||||||
|
|
||||||
|
reti
|
||||||
|
|
||||||
|
start_timer:
|
||||||
|
rcall timer0_start
|
||||||
|
reti
|
||||||
|
|||||||
Reference in New Issue
Block a user