Files
uDCCD/firmware/tests/logic_main.c
2024-03-12 21:22:26 +02:00

99 lines
2.1 KiB
C

#include <stdio.h>
#include <stdlib.h>
#include "ut_logic/ut_coil.h"
#include "ut_logic/ut_display.h"
#include "ut_logic/ut_force.h"
#include "ut_logic/ut_pot.h"
#include "ut_logic/ut_user_force.h"
int main()
{
int tr;
int pass = 1;
int t_cnt = 0;
int f_cnt = 0;
/* COIL TESTS */
printf("******************************************************\n");
tr = ut_coil_target_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
/* DISPLAY TESTS */
printf("******************************************************\n");
tr = ut_dsp_init_ctrl_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_set_lock_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_reset_lock_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_img_percent_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_img_raw_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_get_act_img_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_dsp_backlight_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
/* FORCE TESTS */
printf("******************************************************\n");
tr = ut_force_cycle_bmode_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_force_next_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
/* POT TESTS */
printf("******************************************************\n");
tr = ut_pot_mv_to_percent_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
/* USER FORCE TESTS */
printf("******************************************************\n");
tr = ut_user_force_btn_test();
t_cnt++;
if(!tr){ pass = 0; f_cnt++;};
tr = ut_user_force_pot_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;
}