From 9278e9bafd96105b64f9946eb94f5618f01649d3 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Thu, 29 Oct 2015 15:42:29 -0400 Subject: add libhal tests, some cleanup (some mess-making) --- uart-test.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 uart-test.c (limited to 'uart-test.c') diff --git a/uart-test.c b/uart-test.c deleted file mode 100644 index 0f8926a..0000000 --- a/uart-test.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Test code that just sends the letters 'a' to 'z' over and - * over again using USART2. - * - * Toggles the BLUE LED slowly and the RED LED for every - * character sent. - */ -#include "stm32f4xx_hal.h" -#include "stm-init.h" -#include "stm-led.h" -#include "stm-uart.h" - -#define DELAY() HAL_Delay(100) - -int -main() -{ - uint8_t c = 'a'; - - stm_init(); - - while (1) - { - HAL_GPIO_TogglePin(LED_PORT, LED_RED); - - HAL_UART_Transmit(&huart2, (uint8_t *) &c, 1, 0x1); - DELAY(); - - if (c++ == 'z') { - c = 'a'; - HAL_GPIO_TogglePin(LED_PORT, LED_BLUE); - } - } -} -- cgit v1.2.3