Repo unification

This commit is contained in:
2024-03-12 21:22:26 +02:00
parent 7aa7edba33
commit 02cb3a9c70
152 changed files with 14575 additions and 2038 deletions

View File

@@ -0,0 +1,62 @@
#include "ut_odout.h"
#include "..\mock_mcu\mock_mcu_hal_r8.h"
#include "..\..\src\hw\board\setup.h"
static adcClkDiv_t not_accesed_adc_clk = MCU_ADC_DIV128;
static timerClkDiv_t not_accesed_pwm_clk = MCU_TIM_DIV1024;
static uint16_t not_accesed_pwm_top = 0;
static uint8_t not_accesed_pwm_chb_en = 255;
static int ut_bsp_startup(startupCfg_t* exp_cfg)
{
printf(" Input: \n");
startupCfg_t not_accesd_cfg;
not_accesd_cfg.adc_clk = not_accesed_adc_clk;
not_accesd_cfg.pwm_clk = not_accesed_pwm_clk;
not_accesd_cfg.pwm_top = not_accesed_pwm_top;
not_accesd_cfg.pwm_chb_en = not_accesed_pwm_chb_en;
mock_mcu_startup_write_cfg(&not_accesd_cfg);
bsp_startup();
startupCfg_t cfg;
mock_mcu_startup_read_cfg(&cfg);
printf(" Output: ADC-CLK:%d PWN-CLK:%d PWM-TOP:%d PWM-CHB-EN:%d \n", cfg.adc_clk, cfg.pwm_clk, cfg.pwm_top, cfg.pwm_chb_en);
printf("Expected: ADC-CLK:%d PWN-CLK:%d PWM-TOP:%d PWM-CHB-EN:%d \n", exp_cfg->adc_clk, exp_cfg->pwm_clk, exp_cfg->pwm_top, exp_cfg->pwm_chb_en);
if((cfg.adc_clk==exp_cfg->adc_clk)&&(cfg.pwm_clk==exp_cfg->pwm_clk)&&(cfg.pwm_top==exp_cfg->pwm_top)&&(cfg.pwm_chb_en==exp_cfg->pwm_chb_en))
{
printf("PASS\n\n");
return 1;
}
else
{
printf("FAIL\n\n");
return 0;
}
}
int ut_bsp_startup_test(void)
{
printf("******************************************************\n");
printf("void bsp_startup(void) \n");
int test_res;
int pass = 1;
startupCfg_t exp_cfg;
// Control level - LOW
exp_cfg.adc_clk = MCU_ADC_DIV2;
exp_cfg.pwm_clk = MCU_TIM_DIV1;
exp_cfg.pwm_top = 511;
exp_cfg.pwm_chb_en = 1;
test_res = ut_bsp_startup(&exp_cfg);
if(!test_res) pass = 0;
return pass;
}