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

查看: 1315|回复: 0

[STM32L476] HAL庫 UART中斷接收問題

[复制链接]

3

主题

4

回帖

0

蝴蝶豆

高级会员

最后登录
2020-10-23
发表于 2017-7-11 15:49:21 | 显示全部楼层 |阅读模式
調回函數,這樣用,我只能收到1次字串後我就再也收不到下次字串了,請問這會是什麼原因呢?找了好幾天就是沒找到原因....

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
  /* Prevent unused argument(s) compilation warning */
  //UNUSED(huart);

  /* NOTE : This function should not be modified, when the callback is needed,
            the HAL_UART_RxCpltCallback can be implemented in the user file.
   */
        if(huart->Instance == USART1)
        {
                Uart1.write = (++Uart1.write == uart1_buffer_size) ? 0 : Uart1.write;
                Uart1.buffer[Uart1.write] = Uart1.Rx_buffer[0];

                HAL_UART_Receive_IT(&huart1,(uint8_t*)Uart1.Rx_buffer,1);
        }
}

回复

使用道具 举报

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
微信公众号二维码 微信公众号
手机版二维码 手机版