Change ticks to bpm calc to a macro
This commit is contained in:
+5
-8
@@ -3,8 +3,9 @@
|
|||||||
ldi r19, \target_low
|
ldi r19, \target_low
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
ticks_to_bpm:
|
.MACRO TICKS_TO_BPM:
|
||||||
ret
|
reti
|
||||||
|
.endm
|
||||||
|
|
||||||
tap_tempo_isr:
|
tap_tempo_isr:
|
||||||
; Timer not started yet (first button press after expiration)
|
; Timer not started yet (first button press after expiration)
|
||||||
@@ -12,12 +13,8 @@ tap_tempo_isr:
|
|||||||
cp r16, r0
|
cp r16, r0
|
||||||
breq start_timer
|
breq start_timer
|
||||||
|
|
||||||
; Timer started
|
; Timer already started
|
||||||
; wait for next press
|
TICKS_TO_BPM
|
||||||
; better to update at each press, unless expiration
|
|
||||||
rcall ticks_to_bpm
|
|
||||||
|
|
||||||
reti
|
|
||||||
|
|
||||||
start_timer:
|
start_timer:
|
||||||
rcall timer0_start
|
rcall timer0_start
|
||||||
|
|||||||
Reference in New Issue
Block a user