博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
stm32中阻塞模式和非阻塞模式 in blocking mode 与 in non-blocking mode区别
阅读量:4656 次
发布时间:2019-06-09

本文共 1791 字,大约阅读时间需要 5 分钟。

阻塞模式和非阻塞模式......

我的理解是:

阻塞模式就像是一个延时函数,当这个函数没处理完那么,所有的按照流程需要执行的代码都不会被执行,要等到这个延时完成,类似 平时看书上写的LED灯闪烁,用的delay()一样..
而非阻塞模式就像他定义的那样,一般用的是中断,执行这条语句的时候,开启相应的中断达到一定的条件才进行处理,这样不会影响到流程的执行.

我的理解就是,阻塞就是死等,非阻塞就是中断

 

可以参考

/**

  * @brief  Sends an amount of data in non blocking mode.
  * @note   When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
  *         the sent data is handled as a set of u16. In this case, Size must indicate the number
  *         of u16 provided through pData.
  * @param  huart Pointer to a UART_HandleTypeDef structure that contains
  *               the configuration information for the specified UART module.
  * @param  pData Pointer to data buffer (u8 or u16 data elements).
  * @param  Size  Amount of data elements (u8 or u16) to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
 

/**

  * @brief  Sends an amount of data in blocking mode.
  * @note   When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01),
  *         the sent data is handled as a set of u16. In this case, Size must indicate the number
  *         of u16 provided through pData.
  * @param  huart Pointer to a UART_HandleTypeDef structure that contains
  *               the configuration information for the specified UART module.
  * @param  pData Pointer to data buffer (u8 or u16 data elements).
  * @param  Size  Amount of data elements (u8 or u16) to be sent
  * @param  Timeout Timeout duration
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
————————————————
版权声明:本文为CSDN博主「liming0931」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/liming0931/article/details/99721916

转载于:https://www.cnblogs.com/CodeWorkerLiMing/p/11376725.html

你可能感兴趣的文章
linux上FTP服务器搭建
查看>>
hdu 1506 Largest Rectangle in a Histogram dp
查看>>
华为机试测试-dna-字符串
查看>>
JSON序列化和解析
查看>>
20150221—LINQ to SQL 查询数据
查看>>
asp.net Mvc 访问静态页面
查看>>
数据结构和算法 — 平衡二叉树的实现
查看>>
帝国CMS判断会员是否登录及登录后才能看到内容的方法
查看>>
使用三大框架实现文件的上传及下载
查看>>
理解 HTTP2.0
查看>>
小米手机安装mitmproxy证书
查看>>
简要分析webpack打包后代码
查看>>
js中级第四天
查看>>
mysql 指令
查看>>
【转载】COM 组件设计与应用(六)——用 ATL 写第一个组件
查看>>
使用python处理文件
查看>>
语法制导翻译——语义分析
查看>>
Android中自定义实现高德地图图层效果的源码
查看>>
报错解决
查看>>
去除TFS版本控制
查看>>