/* * Terminal.c * * Created on: Jul 13, 2021 * Author: angoosh */ #include "Terminal.h" #include "main.h" uint8_t pointr = 0; uint8_t RX[1]; uint8_t termRxBuffer[TERM_BUFFER_SIZE]; UART_HandleTypeDef huart3; uint8_t msgOk[] = {"\nOK\n"}; uint8_t msgBlank[] = {"> "}; uint8_t msgNoGpioPort[] = {"\nNo such GPIO port\n"}; uint8_t msgUnknownParameter[] = {"\nUnknown parameter\n"}; uint8_t msgNL = '\n'; /** * @brief Callback for uart byte by byte receive */ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){ termRxBuffer[pointr] = RX[0]; pointr++; HAL_UART_Receive_IT(&huart3, RX, 1); } /** * @brief Readout whole receive buffer, for debug */ void PrintRxBuffer(){ for(int l = 0; l