diff options
Diffstat (limited to 'src/test.c')
-rwxr-xr-x | src/test.c | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/src/test.c b/src/test.c new file mode 100755 index 0000000..94fe40d --- /dev/null +++ b/src/test.c @@ -0,0 +1,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 ********************************************************** + ******************************************************************************/ |