Change subroutines name
This commit is contained in:
+5
-2
@@ -13,8 +13,8 @@ main:
|
||||
;cbi DDRB, PB5 ; Set EC11 button (555 square wave) on PB4 as input
|
||||
ldi r26, 60 ; Default BPM //TODO: save to eeprom not register, on runtime also ldi on r24 register
|
||||
|
||||
rcall timer0_ld
|
||||
rcall timer1_ld
|
||||
rcall timer0_set
|
||||
rcall timer1_set
|
||||
|
||||
|
||||
; interrupts:
|
||||
@@ -37,6 +37,9 @@ loop:
|
||||
|
||||
;rcall midi_send ; Send MIDI ping
|
||||
|
||||
//FIXME: do this with interrupts. its much more efficient
|
||||
// remove the polling shit and move stop_blink or an ISR
|
||||
// check if need to change internal logic on led.inc
|
||||
; if midi clock then also do: rcall start_blink
|
||||
in r16, TIFR0 ; Read Interrupt Flag Register
|
||||
sbrs r16, OCF0A ; If timer status OCF0A=1 skip jump
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
#define __SFR_OFFSET 0
|
||||
#include <avr/io.h>
|
||||
|
||||
; Timer0 will be static and used for the led
|
||||
; Timer0 is static and used for the led
|
||||
timer0_set:
|
||||
ldi r16, (1 << WGM01) ; Load 00000010 to register (bit 1=CTC)
|
||||
out TCCR0A, r16 ; On T/C Control Register A, enable CTC and COM0A0
|
||||
@@ -9,8 +9,8 @@ timer0_set:
|
||||
ldi r16, 244 ; Load counter target limit value (ticks)
|
||||
out OCR0A, r16 ; Compare target to current counter
|
||||
|
||||
; Timer1 will be dynamically changed in main
|
||||
timer1_ld:
|
||||
; Timer1 will be dynamically changed in main (tempo)
|
||||
timer1_set:
|
||||
; Load 10011011 to register:
|
||||
; CTC1 (Bit 7): Reset timer to 0 when it matches OCR1C
|
||||
; COM1A0 (Bit 4): Toggle OC1A (PB1) when it matches OCR1A
|
||||
@@ -18,7 +18,7 @@ timer1_ld:
|
||||
ldi r16, (1 << CTC1) | (1 << COM1A0) | (1 << CS13) | (1 << CS11) | (1 << CS10)
|
||||
out TCCR1, r16 ; On T/C Control Register 1, enable: CTC1 COM1A0 CS13 CS11 CS10
|
||||
|
||||
timer1_set:
|
||||
timer1_use:
|
||||
ldi r16, 256 ; Load counter total value (ticks)
|
||||
ldi r16, 5 ; Load counter on value (ticks)
|
||||
; //TODO: change r16 on main and then call timer1_dyn to use the value already on r16 (so its dynamic)
|
||||
|
||||
Reference in New Issue
Block a user