-#include "stm32f411.h"
+#include "uart.h"
+#include "led.h"
+
+__attribute__ ((noreturn)) void kentry (void);
static const char *text[] = {
"hello, friend.\r\n",
void
kentry (void)
{
- unsigned int line, off;
+ unsigned int line;
/* Test UART and LED ---------------------------------------------------- */
{
for (line = 0; line < sizeof text / sizeof *text; ++line)
{
- /* Print current line */
- off = 0;
- while (text[line][off])
- {
- /* TXE: Transmit data register empty */
- while (!(*USART1_SR & (1u << 7))); /* 0: Data is not transferred
- to the shift register */
-
- /* DR[8:0]: Data value */
- *USART1_DR = text[line][off++];
- }
-
- /* TC: Transmission complete */
- while (!(*USART1_SR & (1u << 6))); /* 0: Transmission is not
- complete */
-
- /* Blink LED */
- *GPIOC_ODR ^= (1u << 13);
+ kputs_busytc (text[line]);
+ led_toggle ();
}
}
}