From ebd763cbe7acccc9a9cb069e4057588e270b18f5 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 31 May 2022 00:11:44 +0200 Subject: [PATCH] Invoke pwm module in main() --- src/inverter.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/inverter.c b/src/inverter.c index e07df02..48ceaa3 100644 --- a/src/inverter.c +++ b/src/inverter.c @@ -1,11 +1,13 @@ #include #include #include +#include #include "uart.h" #include "timer.h" #include "commands.h" #include "pins.h" +#include "pwm.h" int main() { @@ -14,12 +16,22 @@ int main() /* With this MCU frequency (8MHz), 12 is a baudrate of 38.4k baud */ uart_init(12); - initPwmTimer1(); + pwm_init(); + + timer_initT1(); + + + DDRB |= (1 << DDB5); + DDRD |= (1 << DDD7); + + printf("Up and running.\n\r"); while (1) { /* We handle terminated commands here. Outside of the context of the UART receive interrupt. */ cmd_handle(cmd_getcommand()); + + pwm_worker(); } return 0;