timer
This commit is contained in:
parent
cc2271840a
commit
5832a107c3
@ -61,6 +61,7 @@ void Error_Handler(void);
|
||||
#define eepromSpi hspi1
|
||||
#define etherSpi hspi2
|
||||
#define debugUart huart1
|
||||
#define mainsCnt htim1
|
||||
#define LED_Red_Pin GPIO_PIN_13
|
||||
#define LED_Red_GPIO_Port GPIOC
|
||||
#define LED_Green_Pin GPIO_PIN_14
|
||||
|
@ -56,6 +56,7 @@ void SVC_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void TIM1_CC_IRQHandler(void);
|
||||
void SPI1_IRQHandler(void);
|
||||
void USART1_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
@ -60,6 +60,7 @@
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern SPI_HandleTypeDef hspi1;
|
||||
extern TIM_HandleTypeDef htim1;
|
||||
extern UART_HandleTypeDef huart1;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
@ -203,6 +204,20 @@ void SysTick_Handler(void)
|
||||
/* please refer to the startup file (startup_stm32f1xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM1 capture compare interrupt.
|
||||
*/
|
||||
void TIM1_CC_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_CC_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM1_CC_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim1);
|
||||
/* USER CODE BEGIN TIM1_CC_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM1_CC_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SPI1 global interrupt.
|
||||
*/
|
||||
|
@ -57,6 +57,7 @@
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern SPI_HandleTypeDef hspi1;
|
||||
extern TIM_HandleTypeDef htim1;
|
||||
extern UART_HandleTypeDef huart1;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
@ -198,6 +199,20 @@ void SysTick_Handler(void)
|
||||
/* please refer to the startup file (startup_stm32f1xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM1 capture compare interrupt.
|
||||
*/
|
||||
void TIM1_CC_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM1_CC_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM1_CC_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim1);
|
||||
/* USER CODE BEGIN TIM1_CC_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM1_CC_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SPI1 global interrupt.
|
||||
*/
|
||||
|
@ -91,6 +91,9 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
/* TIM1 interrupt Init */
|
||||
HAL_NVIC_SetPriority(TIM1_CC_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(TIM1_CC_IRQn);
|
||||
/* USER CODE BEGIN TIM1_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspInit 1 */
|
||||
@ -113,6 +116,8 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
|
||||
*/
|
||||
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_8);
|
||||
|
||||
/* TIM1 interrupt Deinit */
|
||||
HAL_NVIC_DisableIRQ(TIM1_CC_IRQn);
|
||||
/* USER CODE BEGIN TIM1_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM1_MspDeInit 1 */
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Processed by ../tools/insertMyCode.sh
|
||||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sun Jan 31 20:49:49 CET 2021]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Feb 06 15:53:10 CET 2021]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
|
@ -1,5 +1,5 @@
|
||||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sun Jan 31 20:49:49 CET 2021]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Feb 06 15:53:10 CET 2021]
|
||||
##########################################################################################################################
|
||||
|
||||
# ------------------------------------------------
|
||||
|
@ -37,7 +37,7 @@ Mcu.Pin8=PB11
|
||||
Mcu.Pin9=PB12
|
||||
Mcu.PinsNb=22
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=eepromSpi,hspi1;etherSpi,hspi2;debugUart,huart1
|
||||
Mcu.UserConstants=eepromSpi,hspi1;etherSpi,hspi2;debugUart,huart1;mainsCnt,htim1
|
||||
Mcu.UserName=STM32F103C8Tx
|
||||
MxCube.Version=6.0.0
|
||||
MxDb.Version=DB.6.0.0
|
||||
@ -52,6 +52,7 @@ NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
|
||||
NVIC.SPI1_IRQn=true\:0\:0\:false\:false\:true\:true\:true
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true
|
||||
NVIC.TIM1_CC_IRQn=true\:0\:0\:false\:false\:true\:true\:true
|
||||
NVIC.USART1_IRQn=true\:0\:0\:false\:false\:true\:true\:true
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
|
||||
PA10.GPIOParameters=GPIO_Label
|
||||
|
Loading…
x
Reference in New Issue
Block a user