From f320bfefb79c42c83330ee887d9162ce5c2880e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andis=20Z=C4=ABle?= Date: Wed, 10 Apr 2024 15:46:26 +0300 Subject: [PATCH] Changes --- firmware/src/main.cpp | 66 +++++++------------------------------- firmware/src/uDCCD.cppproj | 48 +++++++++++++++++++++------ 2 files changed, 50 insertions(+), 64 deletions(-) diff --git a/firmware/src/main.cpp b/firmware/src/main.cpp index 16d5bba..a2517e0 100644 --- a/firmware/src/main.cpp +++ b/firmware/src/main.cpp @@ -1,33 +1,23 @@ /**** Includes ****/ #include "utils/utils.h" + #include "board/mcu/mcu_hal.h" #include "board/ain.h" +#include "board/din.h" +#include "board/dout.h" #include "board/dio.h" -#include "board/hvdin.h" #include "board/halfbridge.h" -#include "board/od_com.h" -#include "board/odout.h" +#include "board/pwm.h" + +#include "hw/button.h" +#include "hw/potentiometer.h" +#include "hw/display_led.h" + +#include "board/udccd_board.h" /**** Private definitions ****/ /**** Private constants ****/ /**** Private variables ****/ -static board::AnalogIn dccd_i(mcu::ADC0); -static board::AnalogIn dccd_u(mcu::ADC1); -static board::AnalogIn bat_u(mcu::ADC2); -static board::AnalogIn bat_i(mcu::ADC3); - -static board::AnalogIn ain1(mcu::ADC5); -static board::AnalogIn ain2(mcu::ADC4); - -static board::DigitalIO din1(mcu::GPIO0, board::DIO_HIGH); -static board::DigitalIO din2(mcu::GPIO1, board::DIO_HIGH); -static board::DigitalIO din3(mcu::GPIO2, board::DIO_HIGH); -static board::DigitalIO din4(mcu::GPIO3, board::DIO_HIGH); - -static board::HVDigitalIn hvdin1(mcu::GPIO4, board::HVDIN_LOW); -static board::HVDigitalIn hvdin2(mcu::GPIO5, board::HVDIN_LOW); -static board::HVDigitalIn hvdin3(mcu::GPIO6, board::HVDIN_LOW); - /**** Private function declarations ****/ /**** Public function definitions ****/ int main(void) @@ -39,42 +29,10 @@ int main(void) mcu_cfg.pwm_ch1_en = 1; mcu::startup(&mcu_cfg); - - dccd_i.mul = 1; - dccd_i.div = 1; - dccd_i.offset = 0; - - dccd_u.mul = 1; - dccd_u.div = 1; - dccd_u.offset = 0; - - bat_u.mul = 1; - bat_u.div = 1; - bat_u.offset = 0; - - bat_i.mul = 1; - bat_i.div = 1; - bat_i.offset = 0; - + // Super loop while(1) - { - dccd_i.read(); - dccd_u.read(); - bat_u.read(); - bat_i.read(); - ain1.read(); - ain2.read(); - - din1.read(); - din2.read(); - din3.read(); - din4.read(); - - hvdin1.read(); - hvdin2.read(); - hvdin3.read(); - + { continue; // End of super loop } diff --git a/firmware/src/uDCCD.cppproj b/firmware/src/uDCCD.cppproj index 327eb2a..1b21809 100644 --- a/firmware/src/uDCCD.cppproj +++ b/firmware/src/uDCCD.cppproj @@ -159,6 +159,12 @@ compile + + compile + + + compile + compile @@ -171,28 +177,49 @@ compile - - compile - - - compile - compile compile - + compile - + compile - + compile - + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + + compile + + compile @@ -214,6 +241,7 @@ +