你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

st-img
chrome
st-img
firefox
st-img
safari
st-img
ie8及以上
shequ.stmicroelectronics.cn
  • ST意法半导体官网
  • STM32中文官网
  • ST全球论坛
登录/注册
  • 首页
  • 技术问答
  • 话题
  • 资源
  • 创客秀
  • 视频
  • 标签
  • 积分商城
  • 每日签到
shabiyufeiwang

shabiyufeiwang

 

回答数 0 关注数 0
关注 私信
  • 动态99
  • 提问
  • 回答0
  • 创客秀 0
  • 分享 0
  • 关注0
9 回答

STM32F030K6T6无法进入中断,在线等大神

STM32F0
shabiyufeiwang shabiyufeiwang 回答时间: 2020-7-19 23:35

斯文人 发表于 2020-7-15 09:15 不是我泼凉水 看到你发个帖子都这么的随意 不用心, 我也没有看的欲望了 , 至少排版的整齐点,把乱码要不 ... void Usart_Init(void) {                GPIO_InitTypeDef   GPIO_InitStructure;      USART_InitTypeDef  USART_InitStructure;      NVIC_InitTypeDef   NVIC_InitStructure;      RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1|RCC_AHBPeriph_GPIOA, ENABLE);      USART_DeInit(USART1);      GPIO_PinAFConfig(GPIOA,GPIO_PinSource9,GPIO_AF_1);      GPIO_PinAFConfig(GPIOA,GPIO_PinSource10,GPIO_AF_1);        //USART1_TX   A.9      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9|GPIO_Pin_10; //PA.9      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; //¸´ÓÃÍÆÍìÊä³ö      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;      GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;      GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;      GPIO_Init(GPIOA, &GPIO_InitStructure);      USART_InitStructure.USART_BaudRate = 9600;      USART_InitStructure.USART_WordLength = USART_WordLength_8b;      USART_InitStructure.USART_StopBits = USART_StopBits_1;      USART_InitStructure.USART_Parity = USART_Parity_No;      USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;      USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;      USART_Init(USART1, &USART_InitStructure);      USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);      USART_ITConfig(USART1, USART_IT_IDLE, ENABLE);      USART_Cmd(USART1, ENABLE);                            NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;      NVIC_InitStructure.NVIC_IRQChannelPriority = 1;        NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;         NVIC_Init(&NVIC_InitStructure);     } void USART1_IRQHandler(void)                  {     uint8_t Res;        if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)      {         Res =USART_ReceiveData(USART1);//(USART1->DR);         USART1_RX_BUF[len_usart1]=Res;         len_usart1++;    }      if(USART_GetITStatus(USART1, USART_IT_IDLE) != RESET)      {         USART_ClearITPendingBit(USART1,USART_IT_IDLE);    }  

赞0
shabiyufeiwang shabiyufeiwang


阅读作者更多的帖子

所在话题

参与活动

  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16