加入C板样例的bsp_can和CAN_receive函数库
This commit is contained in:
92
Core/Inc/CAN_receive.h
Normal file
92
Core/Inc/CAN_receive.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
****************************(C) COPYRIGHT 2019 DJI****************************
|
||||
* @file can_receive.c/h
|
||||
* @brief there is CAN interrupt function to receive motor data,
|
||||
* and CAN send function to send motor current to control motor.
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CAN<41>жϽ<D0B6><CFBD>պ<EFBFBD><D5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,CAN<41><4E><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>.
|
||||
* @note
|
||||
* @history
|
||||
* Version Date Author Modification
|
||||
* V1.0.0 Dec-26-2018 RM 1. done
|
||||
*
|
||||
@verbatim
|
||||
==============================================================================
|
||||
|
||||
==============================================================================
|
||||
@endverbatim
|
||||
****************************(C) COPYRIGHT 2019 DJI****************************
|
||||
*/
|
||||
|
||||
#ifndef CAN_RECEIVE_H
|
||||
#define CAN_RECEIVE_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#define CHASSIS_CAN hcan1
|
||||
|
||||
/* CAN send and receive ID */
|
||||
typedef enum
|
||||
{
|
||||
CAN_CHASSIS_ALL_ID = 0x200,
|
||||
CAN_3508_M1_ID = 0x201,
|
||||
CAN_3508_M2_ID = 0x202,
|
||||
CAN_3508_M3_ID = 0x203,
|
||||
CAN_3508_M4_ID = 0x204,
|
||||
|
||||
} can_msg_id_e;
|
||||
|
||||
//rm motor data
|
||||
typedef struct
|
||||
{
|
||||
uint16_t ecd;
|
||||
int16_t speed_rpm;
|
||||
int16_t given_current;
|
||||
uint8_t temperate;
|
||||
int16_t last_ecd;
|
||||
} motor_measure_t;
|
||||
|
||||
|
||||
/**
|
||||
* @brief send CAN packet of ID 0x700, it will set chassis motor 3508 to quick ID setting
|
||||
* @param[in] none
|
||||
* @retval none
|
||||
*/
|
||||
/**
|
||||
* @brief <20><><EFBFBD><EFBFBD>IDΪ0x700<30><30>CAN<41><4E>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
||||
* @param[in] none
|
||||
* @retval none
|
||||
*/
|
||||
extern void CAN_cmd_chassis_reset_ID(void);
|
||||
|
||||
/**
|
||||
* @brief send control current of motor (0x201, 0x202, 0x203, 0x204)
|
||||
* @param[in] motor1: (0x201) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor2: (0x202) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor3: (0x203) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor4: (0x204) 3508 motor control current, range [-16384,16384]
|
||||
* @retval none
|
||||
*/
|
||||
/**
|
||||
* @brief <20><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>(0x201,0x202,0x203,0x204)
|
||||
* @param[in] motor1: (0x201) 3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>, <20><>Χ [-16384,16384]
|
||||
* @param[in] motor2: (0x202) 3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>, <20><>Χ [-16384,16384]
|
||||
* @param[in] motor3: (0x203) 3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>, <20><>Χ [-16384,16384]
|
||||
* @param[in] motor4: (0x204) 3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>, <20><>Χ [-16384,16384]
|
||||
* @retval none
|
||||
*/
|
||||
extern void CAN_cmd_chassis(int16_t motor1, int16_t motor2, int16_t motor3, int16_t motor4);
|
||||
|
||||
/**
|
||||
* @brief return the chassis 3508 motor data point
|
||||
* @param[in] i: motor number,range [0,3]
|
||||
* @retval motor data point
|
||||
*/
|
||||
/**
|
||||
* @brief <20><><EFBFBD>ص<EFBFBD><D8B5>̵<EFBFBD><CCB5> 3508<30><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
* @param[in] i: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>Χ[0,3]
|
||||
* @retval <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
*/
|
||||
extern const motor_measure_t *get_chassis_motor_measure_point(uint8_t i);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -51,7 +51,6 @@
|
||||
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
extern uint32_t SystemCoreClock;
|
||||
void xPortSysTickHandler(void);
|
||||
#endif
|
||||
#ifndef CMSIS_device_header
|
||||
#define CMSIS_device_header "stm32f4xx.h"
|
||||
@@ -162,7 +161,7 @@ standard names. */
|
||||
|
||||
/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */
|
||||
|
||||
#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1
|
||||
#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0
|
||||
|
||||
/* USER CODE BEGIN Defines */
|
||||
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
|
||||
|
||||
8
Core/Inc/bsp_can.h
Normal file
8
Core/Inc/bsp_can.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef BSP_CAN_H
|
||||
#define BSP_CAN_H
|
||||
#include "main.h"
|
||||
|
||||
|
||||
extern void can_filter_init(void);
|
||||
|
||||
#endif
|
||||
@@ -63,7 +63,7 @@
|
||||
/* #define HAL_SD_MODULE_ENABLED */
|
||||
/* #define HAL_MMC_MODULE_ENABLED */
|
||||
/* #define HAL_SPI_MODULE_ENABLED */
|
||||
/* #define HAL_TIM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
/* #define HAL_UART_MODULE_ENABLED */
|
||||
/* #define HAL_USART_MODULE_ENABLED */
|
||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
@@ -52,7 +52,7 @@ void MemManage_Handler(void);
|
||||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void TIM6_DAC_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
137
Core/Src/CAN_receive.c
Normal file
137
Core/Src/CAN_receive.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
****************************(C) COPYRIGHT 2019 DJI****************************
|
||||
* @file can_receive.c/h
|
||||
* @brief there is CAN interrupt function to receive motor data,
|
||||
* and CAN send function to send motor current to control motor.
|
||||
* @note
|
||||
* @history
|
||||
* Version Date Author Modification
|
||||
* V1.0.0 Dec-26-2018 RM 1. done
|
||||
*
|
||||
@verbatim
|
||||
==============================================================================
|
||||
|
||||
==============================================================================
|
||||
@endverbatim
|
||||
****************************(C) COPYRIGHT 2019 DJI****************************
|
||||
*/
|
||||
|
||||
#include "CAN_receive.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
|
||||
extern CAN_HandleTypeDef hcan1;
|
||||
//motor data read
|
||||
#define get_motor_measure(ptr, data) \
|
||||
{ \
|
||||
(ptr)->last_ecd = (ptr)->ecd; \
|
||||
(ptr)->ecd = (uint16_t)((data)[0] << 8 | (data)[1]); \
|
||||
(ptr)->speed_rpm = (uint16_t)((data)[2] << 8 | (data)[3]); \
|
||||
(ptr)->given_current = (uint16_t)((data)[4] << 8 | (data)[5]); \
|
||||
(ptr)->temperate = (data)[6]; \
|
||||
}
|
||||
/*
|
||||
motor data, 0:chassis motor1 3508;1:chassis motor2 3508;2:chassis motor3 3508;3:chassis motor4 3508;
|
||||
*/
|
||||
static motor_measure_t motor_chassis[4];
|
||||
|
||||
static CAN_TxHeaderTypeDef chassis_tx_message;
|
||||
static uint8_t chassis_can_send_data[8];
|
||||
|
||||
/**
|
||||
* @brief hal CAN fifo call back, receive motor data
|
||||
* @param[in] hcan, the point to CAN handle
|
||||
* @retval none
|
||||
*/
|
||||
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
|
||||
{
|
||||
CAN_RxHeaderTypeDef rx_header;
|
||||
uint8_t rx_data[8];
|
||||
|
||||
HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rx_header, rx_data);
|
||||
|
||||
switch (rx_header.StdId)
|
||||
{
|
||||
case CAN_3508_M1_ID:
|
||||
case CAN_3508_M2_ID:
|
||||
case CAN_3508_M3_ID:
|
||||
case CAN_3508_M4_ID:
|
||||
{
|
||||
static uint8_t i = 0;
|
||||
//get motor id
|
||||
i = rx_header.StdId - CAN_3508_M1_ID;
|
||||
get_motor_measure(&motor_chassis[i], rx_data);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief send CAN packet of ID 0x700, it will set chassis motor 3508 to quick ID setting
|
||||
* @param[in] none
|
||||
* @retval none
|
||||
*/
|
||||
void CAN_cmd_chassis_reset_ID(void)
|
||||
{
|
||||
uint32_t send_mail_box;
|
||||
chassis_tx_message.StdId = 0x700;
|
||||
chassis_tx_message.IDE = CAN_ID_STD;
|
||||
chassis_tx_message.RTR = CAN_RTR_DATA;
|
||||
chassis_tx_message.DLC = 0x08;
|
||||
chassis_can_send_data[0] = 0;
|
||||
chassis_can_send_data[1] = 0;
|
||||
chassis_can_send_data[2] = 0;
|
||||
chassis_can_send_data[3] = 0;
|
||||
chassis_can_send_data[4] = 0;
|
||||
chassis_can_send_data[5] = 0;
|
||||
chassis_can_send_data[6] = 0;
|
||||
chassis_can_send_data[7] = 0;
|
||||
|
||||
HAL_CAN_AddTxMessage(&CHASSIS_CAN, &chassis_tx_message, chassis_can_send_data, &send_mail_box);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief send control current of motor (0x201, 0x202, 0x203, 0x204)
|
||||
* @param[in] motor1: (0x201) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor2: (0x202) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor3: (0x203) 3508 motor control current, range [-16384,16384]
|
||||
* @param[in] motor4: (0x204) 3508 motor control current, range [-16384,16384]
|
||||
* @retval none
|
||||
*/
|
||||
void CAN_cmd_chassis(int16_t motor1, int16_t motor2, int16_t motor3, int16_t motor4)
|
||||
{
|
||||
uint32_t send_mail_box;
|
||||
chassis_tx_message.StdId = CAN_CHASSIS_ALL_ID;
|
||||
chassis_tx_message.IDE = CAN_ID_STD;
|
||||
chassis_tx_message.RTR = CAN_RTR_DATA;
|
||||
chassis_tx_message.DLC = 0x08;
|
||||
chassis_can_send_data[0] = motor1 >> 8;
|
||||
chassis_can_send_data[1] = motor1;
|
||||
chassis_can_send_data[2] = motor2 >> 8;
|
||||
chassis_can_send_data[3] = motor2;
|
||||
chassis_can_send_data[4] = motor3 >> 8;
|
||||
chassis_can_send_data[5] = motor3;
|
||||
chassis_can_send_data[6] = motor4 >> 8;
|
||||
chassis_can_send_data[7] = motor4;
|
||||
|
||||
HAL_CAN_AddTxMessage(&CHASSIS_CAN, &chassis_tx_message, chassis_can_send_data, &send_mail_box);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return the chassis 3508 motor data point
|
||||
* @param[in] i: motor number,range [0,3]
|
||||
* @retval motor data point
|
||||
*/
|
||||
const motor_measure_t *get_chassis_motor_measure_point(uint8_t i)
|
||||
{
|
||||
return &motor_chassis[(i & 0x03)];
|
||||
}
|
||||
24
Core/Src/bsp_can.c
Normal file
24
Core/Src/bsp_can.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "bsp_can.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
extern CAN_HandleTypeDef hcan1;
|
||||
|
||||
void can_filter_init(void)
|
||||
{
|
||||
|
||||
CAN_FilterTypeDef can_filter_st;
|
||||
can_filter_st.FilterActivation = ENABLE;
|
||||
can_filter_st.FilterMode = CAN_FILTERMODE_IDMASK;
|
||||
can_filter_st.FilterScale = CAN_FILTERSCALE_32BIT;
|
||||
can_filter_st.FilterIdHigh = 0x0000;
|
||||
can_filter_st.FilterIdLow = 0x0000;
|
||||
can_filter_st.FilterMaskIdHigh = 0x0000;
|
||||
can_filter_st.FilterMaskIdLow = 0x0000;
|
||||
can_filter_st.FilterBank = 0;
|
||||
can_filter_st.FilterFIFOAssignment = CAN_RX_FIFO0;
|
||||
HAL_CAN_ConfigFilter(&hcan1, &can_filter_st);
|
||||
HAL_CAN_Start(&hcan1);
|
||||
HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING);
|
||||
|
||||
}
|
||||
@@ -163,6 +163,28 @@ void SystemClock_Config(void)
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
* @brief Period elapsed callback in non blocking mode
|
||||
* @note This function is called when TIM6 interrupt took place, inside
|
||||
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
|
||||
* a global variable "uwTick" used as application time base.
|
||||
* @param htim : TIM handle
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
/* USER CODE BEGIN Callback 0 */
|
||||
|
||||
/* USER CODE END Callback 0 */
|
||||
if (htim->Instance == TIM6)
|
||||
{
|
||||
HAL_IncTick();
|
||||
}
|
||||
/* USER CODE BEGIN Callback 1 */
|
||||
|
||||
/* USER CODE END Callback 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function is executed in case of error occurrence.
|
||||
* @retval None
|
||||
|
||||
137
Core/Src/stm32f4xx_hal_timebase_tim.c
Normal file
137
Core/Src/stm32f4xx_hal_timebase_tim.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f4xx_hal_timebase_tim.c
|
||||
* @brief HAL time base based on the hardware TIM.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2026 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 "stm32f4xx_hal.h"
|
||||
#include "stm32f4xx_hal_tim.h"
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
TIM_HandleTypeDef htim6;
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief This function configures the TIM6 as a time base source.
|
||||
* The time source is configured to have 1ms time base with a dedicated
|
||||
* Tick interrupt priority.
|
||||
* @note This function is called automatically at the beginning of program after
|
||||
* reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
|
||||
* @param TickPriority: Tick interrupt priority.
|
||||
* @retval HAL status
|
||||
*/
|
||||
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||
{
|
||||
RCC_ClkInitTypeDef clkconfig;
|
||||
uint32_t uwTimclock, uwAPB1Prescaler = 0U;
|
||||
|
||||
uint32_t uwPrescalerValue = 0U;
|
||||
uint32_t pFLatency;
|
||||
|
||||
HAL_StatusTypeDef status;
|
||||
|
||||
/* Enable TIM6 clock */
|
||||
__HAL_RCC_TIM6_CLK_ENABLE();
|
||||
|
||||
/* Get clock configuration */
|
||||
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
|
||||
|
||||
/* Get APB1 prescaler */
|
||||
uwAPB1Prescaler = clkconfig.APB1CLKDivider;
|
||||
/* Compute TIM6 clock */
|
||||
if (uwAPB1Prescaler == RCC_HCLK_DIV1)
|
||||
{
|
||||
uwTimclock = HAL_RCC_GetPCLK1Freq();
|
||||
}
|
||||
else
|
||||
{
|
||||
uwTimclock = 2UL * HAL_RCC_GetPCLK1Freq();
|
||||
}
|
||||
|
||||
/* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */
|
||||
uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U);
|
||||
|
||||
/* Initialize TIM6 */
|
||||
htim6.Instance = TIM6;
|
||||
|
||||
/* Initialize TIMx peripheral as follow:
|
||||
* Period = [(TIM6CLK/1000) - 1]. to have a (1/1000) s time base.
|
||||
* Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
|
||||
* ClockDivision = 0
|
||||
* Counter direction = Up
|
||||
*/
|
||||
htim6.Init.Period = (1000000U / 1000U) - 1U;
|
||||
htim6.Init.Prescaler = uwPrescalerValue;
|
||||
htim6.Init.ClockDivision = 0;
|
||||
htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
||||
status = HAL_TIM_Base_Init(&htim6);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Start the TIM time Base generation in interrupt mode */
|
||||
status = HAL_TIM_Base_Start_IT(&htim6);
|
||||
if (status == HAL_OK)
|
||||
{
|
||||
/* Enable the TIM6 global Interrupt */
|
||||
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
|
||||
/* Configure the SysTick IRQ priority */
|
||||
if (TickPriority < (1UL << __NVIC_PRIO_BITS))
|
||||
{
|
||||
/* Configure the TIM IRQ priority */
|
||||
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, TickPriority, 0U);
|
||||
uwTickPrio = TickPriority;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = HAL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Return function status */
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Suspend Tick increment.
|
||||
* @note Disable the tick increment by disabling TIM6 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_SuspendTick(void)
|
||||
{
|
||||
/* Disable TIM6 update Interrupt */
|
||||
__HAL_TIM_DISABLE_IT(&htim6, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resume Tick increment.
|
||||
* @note Enable the tick increment by Enabling TIM6 update interrupt.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_ResumeTick(void)
|
||||
{
|
||||
/* Enable TIM6 Update interrupt */
|
||||
__HAL_TIM_ENABLE_IT(&htim6, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "stm32f4xx_it.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
/* USER CODE END Includes */
|
||||
@@ -57,6 +55,7 @@
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern TIM_HandleTypeDef htim6;
|
||||
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
@@ -153,28 +152,6 @@ void DebugMon_Handler(void)
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
#if (INCLUDE_xTaskGetSchedulerState == 1 )
|
||||
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
|
||||
{
|
||||
#endif /* INCLUDE_xTaskGetSchedulerState */
|
||||
xPortSysTickHandler();
|
||||
#if (INCLUDE_xTaskGetSchedulerState == 1 )
|
||||
}
|
||||
#endif /* INCLUDE_xTaskGetSchedulerState */
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32F4xx Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
@@ -182,6 +159,20 @@ void SysTick_Handler(void)
|
||||
/* please refer to the startup file (startup_stm32f4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles TIM6 global interrupt, DAC1 and DAC2 underrun error interrupts.
|
||||
*/
|
||||
void TIM6_DAC_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN TIM6_DAC_IRQn 0 */
|
||||
|
||||
/* USER CODE END TIM6_DAC_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim6);
|
||||
/* USER CODE BEGIN TIM6_DAC_IRQn 1 */
|
||||
|
||||
/* USER CODE END TIM6_DAC_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
||||
|
||||
Reference in New Issue
Block a user