Programs such as
addTwoNums
call the SER_GetChar()
and SER_PutChar()
functions to output ASCII characters to a terminal. The Retarget.c
file redefines the fgetc()
and fputc()
functions, which, in turn, call SER_GetChar()
and SER_PutChar()
. These low-level functions illustrate some important I/O models that we'll explore using a program that checks if a string entered is a palindrome (for example, radar, civic, and level are palindromes). We'll call this recipe palindrome_c3v0
.
Follow the steps outlined to configure UART ports:
Create a project named palindrome; use the RTE manager to configure the board as we did for
addTwoNums_c3v0
folder, in the Performing arithemetic operations recipe.Create a file named
palindrome.c
and copy theSystemClock_Config(void)
function and associated boilerplate from a previous recipe. Add the following#include
statements:#include "stm32F4xx_hal.h" #include <stdio.h> #include <string.h> #include "Serial.h" #include...