实验现象:
核心代码:
int main(void) { /* USER CODE BEGIN 1 */ RTC_DateTypeDef sDate; RTC_TimeTypeDef sTime; uint8_t second_tmp = 0; /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_RTC_Init(); MX_USART1_UART_Init(); SystemClock_Config(); /* USER CODE BEGIN 2 */ LED_RED_ON; //ºìµÆ³£ÁÁ usart1.printf("x0c"); //ÇåÆÁ usart1.printf("