diff --git a/src/bpm.inc b/src/bpm.inc index e89b801..d49b5f7 100644 --- a/src/bpm.inc +++ b/src/bpm.inc @@ -2,3 +2,23 @@ ldi r20, \target_high ldi r19, \target_low .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