diff --git a/src/clockinator.S b/src/clockinator.S index f9def00..fdd4c35 100644 --- a/src/clockinator.S +++ b/src/clockinator.S @@ -41,16 +41,21 @@ main: ldi r16, hi8(RAMEND) out SPH, r0 ; Setup stack pointer HIGH - sei ; Global interrupt flag + ; PB0 is also second button to use as start stop continue with int0 interrupt + ; when playing one press is pause, another press is continue, a long press is always stop + + cbi DDRB, PB1 ; Set EC11 clockwise on PB5 as input + cbi DDRB, PB5 ; Set EC11 counter-clockwise on PB3 as input + cbi DDRB, PB2 ; Set EC11 button (555 square wave) on PB2 as input + sbi PORTB, PB2 ; Enable pull-up on PB2 - ;cbi DDRB, PB1 ; Set EC11 clockwise on PB5 as input - ;cbi DDRB, PB2 ; Set EC11 counter-clockwise on PB3 as input - ;cbi DDRB, PB5 ; Set EC11 button (555 square wave) on PB4 as input - sbi DDRB, PB0 ; Set led on PB0 as output ;ldi r26, 60 ; Default BPM //TODO: save to eeprom not register, on runtime also ldi on r24 register + clr r0 + ldi r1, 1 + rcall timer0_set - ;rcall timer1_set + rcall timer1_set ; loop: calculate tempo (high priority!) and save, led blinking, segment led writing