STEP10-1:代码修改 main.c/* USER CODE BEGIN Includes */
#include "linked_list.h"
/* USER CODE END Includes */
/* USER CODE BEGIN PV */
__IO uint32_t UserButtonStatus = 0U;
/* USER CODE END PV */
int main(void)
{
……
/* USER CODE BEGIN 2 */
while (UserButtonStatus == 0U)
{
HAL_Delay(200);
HAL_GPIO_WritePin(GPIOH, LED_RED_Pin|LED_GREEN_Pin, GPIO_PIN_RESET);
HAL_Delay(200);
HAL_GPIO_WritePin(GPIOH, LED_RED_Pin|LED_GREEN_Pin, GPIO_PIN_SET);
}
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
/* USER CODE END 2 */
}
static void MX_LPDMA1_Init(void)
{
……
/* USER CODE BEGIN LPDMA1_Init 2 */
MX_GPIO_Q_Config();
/* Link queue to DMA channel */
if (HAL_DMAEx_List_LinkQ(&handle_LPDMA1_Channel0, &GPIO_Q) != HAL_OK)
{
Error_Handler();
}
/* Start linked list */
if (HAL_DMAEx_List_Start(&handle_LPDMA1_Channel0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE END LPDMA1_Init 2 */
}
static void MX_LPTIM1_Init(void)
{
……
/* USER CODE BEGIN LPTIM1_Init 2 */
HAL_LPTIM_PWM_Start(&hlptim1, LPTIM_CHANNEL_1);
/* USER CODE END LPTIM1_Init 2 */
}
|