diff --git a/src/bpm.inc b/src/bpm.inc new file mode 100644 index 0000000..e89b801 --- /dev/null +++ b/src/bpm.inc @@ -0,0 +1,4 @@ +.MACRO SET_BPM target_high, target_low + ldi r20, \target_high + ldi r19, \target_low +.endm diff --git a/src/clockinator.S b/src/clockinator.S index 0758838..7008fc5 100644 --- a/src/clockinator.S +++ b/src/clockinator.S @@ -27,7 +27,7 @@ timer0_overflow_count: #include #include "timer.inc" -#include "tap-tempo.inc" +#include "bpm.inc" ;#include "midi.inc" main: diff --git a/src/tap-tempo.inc b/src/tap-tempo.inc deleted file mode 100644 index e7a051e..0000000 --- a/src/tap-tempo.inc +++ /dev/null @@ -1,18 +0,0 @@ -; Registers: -; r16: timer0 start and stop operations - -.MACRO START_TAPTEMPO_COUNTER - ldi r16, (1 << OCF0A) ; Load Output Compare Flag 0 A to 1 - out TIFR, r16 ; Clear Timer0 interrupt flag register - - clr r16 ; Cleanup register - out TCNT0, r16 ; Reset Counter to 0 - - ldi r16, (1 << CS02) | (1 << CS00) ; Load prescaler value (00000101 = prescaler 1024) - out TCCR0B, r16 ; Enable clock source -.endm - -.MACRO SET_BPM target_high, target_low - ldi r20, \target_high - ldi r19, \target_low -.endm