中级会员
 
- 积分
- 316
- 金钱
- 316
- 注册时间
- 2019-4-1
- 在线时间
- 118 小时
|
1金钱
IO脚KEY1_Pin配置成输入态,led_Pin配置成输出态,代码如下:
- static void MX_GPIO_Init(void)
- {
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- /* GPIO Ports Clock Enable */
- __HAL_RCC_GPIOE_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
- __HAL_RCC_GPIOB_CLK_ENABLE();
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(led_GPIO_Port, led_Pin, GPIO_PIN_SET);
- /*Configure GPIO pin : KEY1_Pin */
- GPIO_InitStruct.Pin = KEY1_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- HAL_GPIO_Init(KEY1_GPIO_Port, &GPIO_InitStruct);
- /*Configure GPIO pin : led_Pin */
- GPIO_InitStruct.Pin = led_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(led_GPIO_Port, &GPIO_InitStruct);
- }
复制代码 调试时发现,下图中第99行、第102行语句不能设置断点:
工程编译没warning没error。会是什么原因呢?望指教!谢谢
|
|