这是我的CubeMX配置。调用的是HAL_TIM_PWM_Start_DMA(&htim4,TIM_CHANNEL_1,(uint32_t )pulse,(176));库函数,// DMA 传输完成回调函数 void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef htim) { // __HAL_TIM_SET_COMPARE(&htim4,TIM_CHANNEL_1,0); HAL_TIM_PWM_Stop_DMA(&htim4,TIM_CHANNEL_1); } //DMA 需要传输的数据 uint16_t pulse[176] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 59,59,59,59,59,59,59,59, 29,29,29,29,29,29,29,29, 59,59,59,59,59,59,59,59, 29,29,29,29,29,29,29,29, 59,59,59,59,59,59,59,59, 29,29,29,29,29,29,29,29, 29,29,29,29,29,29,29,29, 29,29,29,29,29,29,29,29, 59,59,59,59,59,59,59,59, 29,29,29,29,29,29,29,29, 29,29,29,29,29,29,29,29, 29,29,29,29,29,29,29,29,}; 把HAL_TIM_PWM_Start_DMA()函数放在while(1)之前,示波器上看不到波形,哪位大佬可以帮忙看看
|