新手入门
- 积分
- 11
- 金钱
- 11
- 注册时间
- 2018-5-11
- 在线时间
- 2 小时
|

楼主 |
发表于 2018-12-10 20:23:19
|
显示全部楼层
int main(void)
{
/* USER CODE BEGIN 1 */
/* 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_DMA_Init();
MX_CAN1_Init();
MX_CAN2_Init();
MX_SPI5_Init();
MX_TIM2_Init();
MX_TIM4_Init();
MX_TIM5_Init();
MX_TIM6_Init();
MX_TIM8_Init();
MX_TIM12_Init();
MX_USART1_UART_Init();
MX_USART2_UART_Init();
MX_USART3_UART_Init();
MX_USART6_UART_Init();
MX_USB_DEVICE_Init();
MX_TIM3_Init();
/* USER CODE BEGIN 2 */
// MPU6500_Init();
HAL_TIM_Base_Start_IT(&htim6);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
// CanFilter_Init(&hcan1);
// CanFilter_Init(&hcan2);
// HAL_CAN_Receive_IT(&hcan1, CAN_FIFO0);
// HAL_CAN_Receive_IT(&hcan2, CAN_FIFO0);
// HAL_UART_Receive_IT(&huart3, uart3_rx_buff, 1);
// HAL_UART_Receive_IT(&huart6, uart6_rx_buff, 1);
if(MPU_id != 0)sTestResult.imuTest = 0x01;
/* USER CODE END 2 */
unsigned char Re[16];
/* Infinite loop */
/* USER CODE BEGIN WHILE */
// uint8_t DaTe[]="UartTest";
while (1)
{
/* USER CODE END WHILE */
// char8_t DaTe[]="UartTest";
/* USER CODE BEGIN 3 */
// IMU_Get_Data();
// HAL_UART_Transmit(&huart6, DaTe, 8, 0xffff);
HAL_UART_Receive(&huart6, Re, 16, 0x8fff);
HAL_Delay(10);
HAL_UART_Transmit(&huart6, Re, 16,0x8fff);
HAL_Delay(10);
// HAL_UART_RxCpltCallback(&huart2);
}
/* USER CODE END 3 */
}
补充一下我的main函数 |
|