Description Resource Path Location Type The float formatting support is not enabled, check your MCU Settings from "Project Properties > C/C++ Build > Settings > Tool Settings", or add manually "-u _printf_float" in linker flags. main.c /NUCLEO-F446RE_BME280/Core/Src line 188 Code Analysis Problem
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h"
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */
/** Configure the main internal regulator output voltage */ __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
/** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); }
/* USER CODE BEGIN MX_GPIO_Init_2 */ /* USER CODE END MX_GPIO_Init_2 */ }
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "ST7735.h" #include "GFX_FUNCTIONS.h" #include "image.h" /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */
/* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h"
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_SPI1_Init(void); static void MX_USART2_UART_Init(void); /* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ //Use printf int _write(int fd, char *ptr, int len) { HAL_UART_Transmit(&huart2, (unsigned char*)ptr, len, HAL_MAX_DELAY); return len; } /* USER CODE END 0 */
/** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */ SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_SPI1_Init(); MX_USART2_UART_Init(); /* USER CODE BEGIN 2 */ printf("hello\r\n"); /* USER CODE END 2 */
/* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */
/* USER CODE BEGIN MX_GPIO_Init_2 */ /* USER CODE END MX_GPIO_Init_2 */ }
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "ST7735.h" #include "GFX_FUNCTIONS.h" /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */
/* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h"
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/* USER CODE BEGIN MX_GPIO_Init_2 */ /* USER CODE END MX_GPIO_Init_2 */ }
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
3.동작 결과
COM7 에서 UART3에 Transmit -> COM5 Uart2에 Receive
4. 참고 링크 : https://blog.naver.com/PostView.naver?blogId=ajoo92&logNo=221540143478&parentCategoryNo=&categoryNo=&viewDate=&isShowPopularPosts=false&from=postView
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h"
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include <stdio.h> #include "stm32746g_discovery_ts.h" #include "stm32746g_discovery.h" #include "stm32746g_discovery_sdram.h" #define CIRCLE_RADIUS 30 #define BUFFER_SIZE 20 TS_StateTypeDef TS_State;
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
if (status != TS_OK) { printf("ERROR - Touchscreen cannot be initialized.\r\n"); }
while (1) { if (status == TS_OK) { /* Check in polling mode in touch screen the touch status and coordinates */ /* if touch occurred */ BSP_TS_GetState(&TS_State); if(TS_State.touchDetected) { /* Get X and Y position of the touch post calibrated */ x = TS_State.touchX[0]; y = TS_State.touchY[0];
if (TS_State.touchDetected >= 2) /* Display 2nd touch detected coordinates if applicable */ { printf("2[%d,%d]\r\n", TS_State.touchX[1], TS_State.touchY[1]); }
if (TS_State.touchDetected >= 3) /* Display 3rd touch detected coordinates if applicable */ { printf("3[%d,%d]\r\n", TS_State.touchX[2], TS_State.touchY[2]); }
if (TS_State.touchDetected >= 4) /* Display 4th touch detected coordinates if applicable */ { printf("4[%d,%d]\r\n", TS_State.touchX[3], TS_State.touchY[3]); }
if (TS_State.touchDetected >= 5) /* Display 5th touch detected coordinates if applicable */ { printf("5[%d,%d]\r\n", TS_State.touchX[4], TS_State.touchY[4]); }
/* Calculate circle radius to fill according to finger pressure applied on screen (weight) */ radius = TS_State.touchWeight[0]/3; if (radius > CIRCLE_RADIUS) { radius = CIRCLE_RADIUS; } else if (radius < 1) { radius = 1; } printf("touchWeight : %d\r\n", radius); } /* of if(TS_State.touchDetected) */ }
HAL_Delay(100); } } void sdram_test(void) { int i = 0; uint32_t error = 0; uint32_t srcBuf[BUFFER_SIZE]; uint32_t dstBuf[BUFFER_SIZE];
for (i=0; i<BUFFER_SIZE; i++ ) { srcBuf[i] = i; }
/* Write data to the SDRAM memory */ BSP_SDRAM_WriteData(SDRAM_DEVICE_ADDR, srcBuf, BUFFER_SIZE); printf("Write data to the SDRAM memory\r\n");
/* Read back data from the SDRAM memory */ BSP_SDRAM_ReadData(SDRAM_DEVICE_ADDR, dstBuf, BUFFER_SIZE); printf("Read back data from the SDRAM memory\r\n");
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h"
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include <stdio.h> #include "stm32746g_discovery_ts.h" #include "stm32746g_discovery.h" TS_StateTypeDef TS_State; /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
if (status != TS_OK) { printf("ERROR - Touchscreen cannot be initialized.\r\n"); }
while (1) { if (status == TS_OK) { /* Check in polling mode in touch screen the touch status and coordinates */ /* if touch occurred */ BSP_TS_GetState(&TS_State); if(TS_State.touchDetected) { /* Get X and Y position of the touch post calibrated */ x = TS_State.touchX[0]; y = TS_State.touchY[0];
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */ SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */ MX_GPIO_Init(); MX_I2C3_Init(); MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ printf("hello\r\n"); Touchscreen_demo(); /* USER CODE END 2 */
/* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include <stdio.h> /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/* USER CODE BEGIN PV */ volatile int gTimerCnt = 0; volatile unsigned int gsec = 0; volatile unsigned int gmin = 0; volatile unsigned int ghour = 0; volatile unsigned int canState = 0; volatile unsigned int canTime = 0;
/* Private variables ---------------------------------------------------------*/ /* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_UART4_Init(void); static void MX_TIM3_Init(void); static void MX_CAN1_Init(void); static void MX_CAN2_Init(void); static void MX_I2C2_Init(void); /* USER CODE BEGIN PFP */ /* Private function prototypes -----------------------------------------------*/ /* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */
// USART #ifdef __GNUC__ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #endif //
uint8_t WriteBuffer[BUFFER_SIZE] = "COPYRIGHT(c) Waveshare\r\n" "Replace this string buffer with your own one (512 bytes or less). " "The string will be saved into the EEPROM.\r\n" "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" " "AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE " "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE " "DISCLAIMED.\r\n";
HAL_StatusTypeDef AT24C04_Write(I2C_HandleTypeDef *hi2c, uint8_t *pData) { uint16_t MemAddress; uint16_t Page = 0; /** The AT24C04 internally organized with 32 pages of 16 bytes each, the 4K * requires an 9-bit data word address for random word addressing. * However, AT24C04 can only receive 8-bit data per period, so the 9-bit * data word address is actually compromised with the page address bit in * device address and the 8-bit memory address. * The device address 0xA0 means the first 16 pages while 0xA2 means the * last 32 pages. * The jumpers will also define the address, so the address 0xA0 or 0xA2 * are not always right. */ while(Page < 16) { MemAddress = Page << 4; /** A page write is initiated the same as a byte write, but the * microcontroller does not send a stop condition after the first data word * is clocked in. * In AT24C04, 1 page = 16 bytes. * When the word address, internally generated, reaches the page boundary, * the following byte is placed at the beginning of the same page. */ Status = HAL_I2C_Mem_Write(&hi2c2, ADDR_AT24C04_WRITE_FIRST_16_PAGES, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, AT24C04_PAGE_SIZE, AT24C04_TIMEOUT); if(Status == HAL_OK) { Page++; pData += AT24C04_PAGE_SIZE; HAL_Delay(5); } else { return Status; } } while(Page >= 16 && Page < 32) { MemAddress = (Page - 16) << 4; Status = HAL_I2C_Mem_Write(&hi2c2, ADDR_AT24C04_WRITE_LAST_16_PAGES, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, AT24C04_PAGE_SIZE, AT24C04_TIMEOUT); if(Status == HAL_OK) { Page++; pData += AT24C04_PAGE_SIZE; HAL_Delay(5); } else { return Status; } } return Status; } /** * @brief Read all of the data from the AT24C04 EEPROM. * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains * the configuration information for the specified I2C. * @param pData Pointer to data buffer * @retval HAL status */ HAL_StatusTypeDef AT24C04_Read(I2C_HandleTypeDef *hi2c, uint8_t *pData) { uint16_t MemAddress = 0x00; Status = HAL_I2C_Mem_Read(&hi2c2, ADDR_AT24C04_READ, MemAddress, I2C_MEMADD_SIZE_8BIT, pData, BUFFER_SIZE, AT24C04_TIMEOUT); return Status; }
// /* USER CODE END 4 */
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2022 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include <stdio.h>
/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */
/* USER CODE BEGIN PV */ volatile int gTimerCnt = 0; volatile unsigned int gsec = 0; volatile unsigned int gmin = 0; volatile unsigned int ghour = 0; volatile unsigned int canState = 1; volatile unsigned int canTime = 0;
/* Private variables ---------------------------------------------------------*/ /* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_UART4_Init(void); static void MX_TIM3_Init(void); static void MX_CAN1_Init(void); static void MX_CAN2_Init(void); /* USER CODE BEGIN PFP */ /* Private function prototypes -----------------------------------------------*/ /* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ // USART #ifdef __GNUC__ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) #else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) #endif //
/** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ }
#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */