From 43c3848d2af638b58c467eeb8303e02e6ee7d0cc Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 12 May 2022 04:46:38 +0200 Subject: [PATCH] Activate serial receive interrupt. --- src/inverter.c | 30 +++++++++++++----------------- src/timer.c | 2 +- src/uart.c | 8 ++++++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/inverter.c b/src/inverter.c index a870b67..849fbf9 100644 --- a/src/inverter.c +++ b/src/inverter.c @@ -4,10 +4,7 @@ #include "include/uart.h" #include "include/timer.h" - - -uint8_t sec = 0; -uint16_t cnt = 0; +#include "include/commands.h" int main() { @@ -22,19 +19,10 @@ int main() sei(); while (1) { - - if ((PORTB & (1 << PB2)) > 1) - { - _delay_ms(1); - PORTB &= ~(1 << PB2); - } - - if (cnt == 65500) { - printf("%u\n\r", TCNT0); - cnt = 0; + if ((PORTB & (1<1) { + _delay_us(10); + PORTB &= ~(1<>8); UBRR1L = (unsigned char)baud; @@ -15,6 +15,9 @@ void uart_init(unsigned int baud) /* Enable receiver and transmitter */ UCSR1B = (1<