Repo unification
This commit is contained in:
102
firmware/tests/hw_main.c
Normal file
102
firmware/tests/hw_main.c
Normal file
@@ -0,0 +1,102 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ut_hw/ut_analog.h"
|
||||
#include "ut_hw/ut_buttons.h"
|
||||
#include "ut_hw/ut_hb_control.h"
|
||||
#include "ut_hw/ut_led_display.h"
|
||||
#include "ut_hw/ut_startup.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int tr;
|
||||
int pass = 1;
|
||||
int t_cnt = 0;
|
||||
int f_cnt = 0;
|
||||
|
||||
/* ANALOG TESTS */
|
||||
printf("******************************************************\n");
|
||||
|
||||
tr = ut_analog_ch_get_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
/* BUTTON TESTS */
|
||||
printf("******************************************************\n");
|
||||
|
||||
tr = ut_btn_reset_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_btn_process_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_btn_ch_process_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_btn_ch_set_pull_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
/* HALFBRIDGE CONTROL TESTS */
|
||||
printf("******************************************************\n");
|
||||
|
||||
tr = ut_hb_is_equal_fb_struct_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_hb_is_equal_ctrl_struct_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_hb_init_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_hb_enable_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_hb_disable_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_hb_process_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
/* DISPLAY TESTS */
|
||||
printf("******************************************************\n");
|
||||
|
||||
tr = ut_led_dsp_set_image_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
tr = ut_led_dsp_backligth_set_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
/* STARTUP TESTS */
|
||||
printf("******************************************************\n");
|
||||
|
||||
tr = ut_hw_startup_test();
|
||||
t_cnt++;
|
||||
if(!tr){ pass = 0; f_cnt++;};
|
||||
|
||||
printf("******************************************************\n");
|
||||
printf("\n%d TESTS DONE\n", t_cnt);
|
||||
if(pass)
|
||||
{
|
||||
printf("ALL PASS\n\n");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%d FAILED\n\n", f_cnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user