+#include "stm32f411.h"
+
+static const char *text[] = {
+ "hello, friend.\r\n",
+ "hello, friend?\r\n",
+ "that's lame.\r\n",
+ "maybe i should give you a name.\r\n",
+ "but that's a slippery slope.\r\n",
+ "you're only in my head.\r\n",
+ "we have to remember that.\r\n",
+ "shit.\r\n",
+ "it's actually happening, i'm talking to an imaginary person.\r\n\n"
+};
+
+void
+kentry (void)
+{
+ unsigned int line, off;
+
+ /* Test UART and LED ---------------------------------------------------- */
+
+ while (1)
+ {
+ 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);
+ }
+ }
+}