edit and testing code

edited some functions and testing code in main
This commit is contained in:
joran2738
2023-11-06 20:15:00 +01:00
parent 01f018536f
commit 5942274e6a
3 changed files with 54 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "log.h"
#include "UDP_broadcast.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -70,7 +71,17 @@ static void MX_QUADSPI_Init(void);
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
int _write(int file, char *ptr, int len) {
for (int x = 0;x<len;x++){
if (ptr[x]=='\n'){
HAL_UART_Transmit(&huart1, (uint8_t*)"\r", 1, HAL_MAX_DELAY);
}
HAL_UART_Transmit(&huart1, (uint8_t*)&ptr[x], 1, HAL_MAX_DELAY);
}
return len;
}
/* USER CODE END 0 */
/**
@@ -80,6 +91,12 @@ static void MX_QUADSPI_Init(void);
int main(void)
{
/* USER CODE BEGIN 1 */
owner_details_t owner;
printf("%s",get_owner_details_reply());
set_owner_details(owner, "joran", "vn");
printf("%s",get_owner_details_reply());
set_owner_details(owner, "joran", "Van Nieuwenhoven");
printf("%s",get_owner_details_reply());
/* USER CODE END 1 */