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

STM32 如何快速创建 FREERTOS和RTX 工程  

[复制链接]
lovewyufeng 发布时间:2015-1-8 12:08
阅读主题, 点击返回1楼
赞 收藏 14 评论97 发布时间:2015-1-8 12:08
97个回答
lovewyufeng 回答时间:2015-1-8 12:52:49
cxtarm 发表于 2015-1-8 12:50' B3 R; V9 |, Y, f1 e- `
cubemx 好用吗

( s. i# V  v; \/ g看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程
cxtarm 回答时间:2015-1-8 12:54:34
lovewyufeng 发表于 2015-1-8 12:522 i+ p1 a% ^+ `2 U3 t
看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程 ...
( C( f2 B( C% n$ H
那只是可用,效率怎么样呢
lovewyufeng 回答时间:2015-1-8 12:56:36
cxtarm 发表于 2015-1-8 12:54
- q+ {( N1 [! H$ A+ P) S3 b5 F% z那只是可用,效率怎么样呢

, C4 u) d9 E0 D. J9 O8 V4 J5 Z本人建议  库只用于 比较复杂的 外设初始化 比如  串口 ,SPI SDIO等等
) ?7 D- z% m7 b$ v6 y3 X( a; ^# N* Q5 Q1 \1 `9 N, G- |
初始化完成之后的操作 建议使用寄存器
ewfty 回答时间:2015-1-8 13:12:10
在实际开发中,我还是喜欢裸奔,不过像这些OS学习还是可以的。
yceast 回答时间:2015-1-8 13:21:50
很好啊
moyanming2013 回答时间:2015-1-8 15:58:52
前来支持
我是东哥 回答时间:2015-1-8 16:20:57
看Freertos头文件Semphr.h的注释。) C% R8 @" u+ `8 z
2) Resource management.% Q) |0 L9 J1 L+ j% O8 f
*    In this usage scenario the count value indicates the number of resources
' R1 f8 U4 R/ Q7 ^7 f4 C *    available.  To obtain control of a resource a task must first obtain a% Q; P. \2 L$ m% k) C
*    semaphore - decrementing the semaphore count value.  When the count value/ x5 a8 C$ V" D! h2 h- }& c! c# o, d
*    reaches zero there are no free resources.  When a task finishes with the
+ k) a# u! j8 J3 m: \ *    resource it 'gives' the semaphore back - incrementing the semaphore count
$ y1 y3 Z# w" v; Q, g4 x/ I *    value.  In this case it is desirable for the initial count value to be( }2 t' @, k. O1 T- C& G. [
*    equal to the maximum count value, indicating that all resources are free.
我是东哥 回答时间:2015-1-8 16:28:35
这种用法应该是先take,再give回去。而不是像第一种用法(也就是楼主说的常用用法)那样,需要先give,然后才能take。
我是东哥 回答时间:2015-1-8 16:31:40
刚刚贴的代码怎么不见了?再贴一遍头文件中的注释,很明了:  L+ M  r& G+ Z- g1 E
* Counting semaphores are typically used for two things:8 u) u; N- H9 X
*
4 A, n- Y; v4 }$ l. G6 |1 ]. V * 1) Counting events.& s# W9 y' B' ?# d: W- I
*. r5 C0 o: f$ p: j* I! u
*    In this usage scenario an event handler will 'give' a semaphore each time
$ s5 R5 ~/ `9 M4 ^' X& X( F! }8 ?. e *    an event occurs (incrementing the semaphore count value), and a handler
+ @7 P: v+ D, z! u! D- X *    task will 'take' a semaphore each time it processes an event  X" H9 C( A/ J1 J
*    (decrementing the semaphore count value).  The count value is therefore
  W* @1 D( Z$ \+ I *    the difference between the number of events that have occurred and the. Z. E8 c1 X2 ~* y
*    number that have been processed.  In this case it is desirable for the- ?: c& ^8 ?5 K! c( g7 G
*    initial count value to be zero.+ f- @2 N3 o  P3 T5 ~: O0 |" o+ [
*+ X& |' x( O* o& D. g. u0 q
* 2) Resource management.
# i* O/ ?8 \! T *
1 y: \7 n9 l' f5 i; J: n *    In this usage scenario the count value indicates the number of resources( U0 p: r! X6 Q! z+ \/ ~% J
*    available.  To obtain control of a resource a task must first obtain a
: S  E4 @1 Y) d4 [  q9 M4 J0 F$ H *    semaphore - decrementing the semaphore count value.  When the count value
% _% F- k! {* z, c+ m *    reaches zero there are no free resources.  When a task finishes with the/ n1 X. @0 a6 L* K/ `- w7 }1 y
*    resource it 'gives' the semaphore back - incrementing the semaphore count
  w. Q  Z* I/ p6 o) C *    value.  In this case it is desirable for the initial count value to be
3 h8 x" f; {7 M *    equal to the maximum count value, indicating that all resources are free.
lovewyufeng 回答时间:2015-1-8 21:29:57
我是东哥 发表于 2015-1-8 16:28
" W/ `/ R6 ~- c3 l- Q8 l9 C% g这种用法应该是先take,再give回去。而不是像第一种用法(也就是楼主说的常用用法)那样,需要先give,然后 ...

$ _6 \7 A7 Q% q: h是的  因为我的 资源一开始是不可用的  ) y5 Z% D/ S, g3 f8 f/ y# o" W* o

8 q: T. t! ]* O3 P# p( k这是典型的 生产消费问题0 F: k% i- P; _& }2 `& ]3 y2 n

: F, m. F' D/ `* P串口接收数据(生产) 9 f/ P4 ]2 {! r5 ^: ]
+ @5 h3 U6 w, H7 \  ^
线程消费数据  
+ K, v2 L& g+ m7 n5 Y# E* v
% q* z; u' `) t' R# E一开始是没有现成的数据的 " P+ |7 @# }; w4 l' u' x1 @# g# a

/ y6 g' ^8 z3 p: z而这个 函数接口  只能以另一种方式使用那就是一开始就存在资源,这在实际使用中是不合理的!!
serge 回答时间:2015-1-8 21:50:06
支持楼主,留下记号,还能拿钱
lovewyufeng 回答时间:2015-1-9 08:38:07
serge 发表于 2015-1-8 21:500 ~3 }! J# y% P  {. r: W
支持楼主,留下记号,还能拿钱

4 F1 V1 Q1 e. Q/ P哈哈 你来晚了钱都被他们拿完了~~
ataudio 回答时间:2015-1-13 14:16:31
楼主强帖,当然要支持了。好好向楼主学习。
maxiaoxiaoq 回答时间:2015-1-13 14:21:50
好贴,正好用的着啊。。
w453509596 回答时间:2015-1-13 23:25:01
楼主写的太好了,刚拿到开发板,我要好好学习一下

所属标签

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
人形机器人运动控制、感知与智能配电
半导体创新技术与应用方向
EE架构与软件定义汽车
12V/48V 汽车智能配电(SPD)
区域控制单元(ZCU)与分区架构
关注我们
st-img 微信公众号
st-img 手机版