diff options
Diffstat (limited to 'project/Core/Src/Homework/hw4.c')
| -rw-r--r-- | project/Core/Src/Homework/hw4.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/project/Core/Src/Homework/hw4.c b/project/Core/Src/Homework/hw4.c new file mode 100644 index 0000000..2154cd4 --- /dev/null +++ b/project/Core/Src/Homework/hw4.c @@ -0,0 +1,29 @@ +/* + * hw4.c + * + * Created on: Oct 4, 2025 + * Author: sowgro + */ + +#include "UART.h" +#include "systick.h" +#include "LED.h" +#include <stdio.h> + + +void read_and_print_char_nonblocking() { + uint8_t ch = USART_Read_Nonblocking(USART2); + printf("%c", ch); + if (ch == '\r') { + printf("\n"); + } +} + +void hw4_run() { + init_systick(); + for (;;) { + delay_systick(); + LED_Toggle(); + read_and_print_char_nonblocking(); + } +} |
