Changes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -159,6 +159,12 @@
|
||||
<Compile Include="board\ain.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\din.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\din.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\dio.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
@@ -171,28 +177,49 @@
|
||||
<Compile Include="board\halfbridge.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\hvdin.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\hvdin.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\mcu\mcu_hal.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\mcu\mcu_hal_r8.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\odout.cpp">
|
||||
<Compile Include="board\dout.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\odout.h">
|
||||
<Compile Include="board\dout.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\od_com.cpp">
|
||||
<Compile Include="board\pwm.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\od_com.h">
|
||||
<Compile Include="board\pwm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="board\udccd_board.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\button.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\button.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\cc_driver.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\cc_driver.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\display_led.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\display_led.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\potentiometer.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="hw\potentiometer.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="main.cpp">
|
||||
@@ -214,6 +241,7 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="board" />
|
||||
<Folder Include="board\mcu" />
|
||||
<Folder Include="hw" />
|
||||
<Folder Include="utils" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
|
||||
Reference in New Issue
Block a user