Use USART2

This commit is contained in:
Alexander Heldt
2025-01-01 12:33:52 +01:00
parent aecd073963
commit bd3af02626

View File

@@ -6,6 +6,7 @@
#include "flash.h"
#include "pwr.h"
#include "timer.h"
#include "usart.h"
#define exit 42
@@ -75,8 +76,10 @@ static void system_clock_init(void) {
int main(void) {
(void) system_clock_init();
(void) tim4_init();
(void) usart2_init();
(void) tim4_start();
(void) usart2_start();
uint16_t led = PIN('C', 13); // Blue LED
RCC->AHB1ENR |= (1 << PINPORT(led)); // Enable GPIO clock for LED
@@ -89,6 +92,8 @@ int main(void) {
led_on = !led_on;
gpio_write(led, led_on);
usart2_write("hello, world!\n");
counter = TIM4->CNT;
}
};