删除RTC,改用TIM进行非中断定时时间戳

This commit is contained in:
不吃油炸鸡
2026-02-02 10:37:50 +08:00
parent 68d900e3ea
commit 508718358a
22 changed files with 25405 additions and 35195 deletions

View File

@@ -22,7 +22,6 @@
#include "adc.h"
#include "dma.h"
#include "i2c.h"
#include "rtc.h"
#include "spi.h"
#include "tim.h"
#include "usart.h"
@@ -75,7 +74,7 @@ int main(void)
/* USER CODE BEGIN 1 */
//this must set same as keil setting
SCB->VTOR = FLASH_BASE + 0x0000C000U;
SCB->VTOR = FLASH_BASE + 0x00000000U;
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
@@ -104,7 +103,7 @@ int main(void)
MX_SPI2_Init();
MX_I2C1_Init();
MX_TIM2_Init();
MX_RTC_Init();
MX_TIM5_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
@@ -148,10 +147,9 @@ void SystemClock_Config(void)
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = 8;