summaryrefslogtreecommitdiffstats
path: root/src/test.c
blob: 94fe40dec1d0a5b161c95a20017ee9d21cfc120b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/******************************************************************************
 *	Copyright (C) 2018	Colomar Andrés, Alejandro		      *
 *	Copyright (C) 2018	García Pedroche, Francisco Javier	      *
 *	SPDX-License-Identifier:	GPL-2.0-only			      *
 ******************************************************************************/

/**
 *	@file		test.c
 *	@author		Colomar Andrés, Alejandro
 *	@author		García Pedroche, Francisco Javier
 *	@copyright	GPL-2.0-only
 *	@date		2018/jan/02
 *	@brief		Test modules
 */


/******************************************************************************
 ******* headers **************************************************************
 ******************************************************************************/
/* Standard C ----------------------------------------------------------------*/
	#include <stdbool.h>
	#include <stddef.h>
	#include <stdint.h>

/* Drivers -------------------------------------------------------------------*/
	#include "stm32l4xx_hal.h"

/* libalx --------------------------------------------------------------------*/
/* STM32L4 modules -----------------------------------------------------------*/
	#include "delay.h"
	#include "errors.h"
	#include "led.h"

	#include "can_test.h"
	#include "display_test.h"
	#include "led_test.h"
	#include "nunchuk_test.h"
	#include "servo_test.h"
	#include "tim_test.h"

/* project -------------------------------------------------------------------*/
	#include "test.h"


/******************************************************************************
 ******* macros ***************************************************************
 ******************************************************************************/


/******************************************************************************
 ******* enums ****************************************************************
 ******************************************************************************/


/******************************************************************************
 ******* structs **************************************************************
 ******************************************************************************/


/******************************************************************************
 ******* variables ************************************************************
 ******************************************************************************/
/* Volatile ------------------------------------------------------------------*/
/* Global --------------------------------------------------------------------*/
/* Static --------------------------------------------------------------------*/


/******************************************************************************
 ******* static functions (prototypes) ****************************************
 ******************************************************************************/


/******************************************************************************
 ******* global functions *****************************************************
 ******************************************************************************/
	/**
	 * @brief	Test modules
	 * @return	Error
	 */
int	test	(void)
{
	led_init();
	delay_us_init();

#if 0
	if (led_test()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	can_r_test();
#endif
#if 0
	can_w_test();
#endif
#if 1
	if (servo_test_0()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	if (servo_test_1()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	if (servo_test_2()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	if (display_test()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	if (nunchuk_test_2()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	if (tim_test()) {
		return	ERROR_NOK;
	}
#endif
#if 0
	prj_error_handle();
#endif

	return	ERROR_OK;
}


/******************************************************************************
 ******* static functions (definitions) ***************************************
 ******************************************************************************/


/******************************************************************************
 ******* end of file **********************************************************
 ******************************************************************************/