Add support for buzzer

This commit is contained in:
2020-11-23 19:37:23 +01:00
parent 8a13a13a7c
commit 8ea908b8fd
13 changed files with 3996 additions and 2601 deletions

View File

@@ -3,10 +3,12 @@
#include "ptimer.h"
volatile uint16_t tim_debounce;
volatile uint8_t tim_buz;
void ptimer_init(void)
{
tim_debounce = 0;
tim_buz = 0;
TCCR2 |= (1<<WGM21);
TCCR2 |= (1<<CS22) | (1<<CS21) | (1<<CS20);
@@ -18,4 +20,5 @@ void ptimer_init(void)
ISR(TIMER2_COMP_vect)
{
if(tim_debounce) --tim_debounce;
if(tim_buz) --tim_buz;
}