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

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

[复制链接]
lovewyufeng 发布时间:2015-1-8 12:08
赞 收藏 14 评论97 发布时间:2015-1-8 12:08
97个回答
lovewyufeng 回答时间:2015-1-8 12:52:49
cxtarm 发表于 2015-1-8 12:50
' c, h4 Q" R( g+ c6 w8 m" ucubemx 好用吗

, b9 R3 v2 N5 t. `4 u看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程
cxtarm 回答时间:2015-1-8 12:54:34
lovewyufeng 发表于 2015-1-8 12:52
9 K3 n  e( X; d' J3 O6 ~看帖 应该  就知道很好用了  基本上 点几下鼠标就创建一个可以直接使用的  工程 ...
- S' N1 n# W0 f: O. Z; K. \
那只是可用,效率怎么样呢
lovewyufeng 回答时间:2015-1-8 12:56:36
cxtarm 发表于 2015-1-8 12:54
( v) o/ S: h: x8 Q那只是可用,效率怎么样呢
* j5 U/ j: }, P  z
本人建议  库只用于 比较复杂的 外设初始化 比如  串口 ,SPI SDIO等等
/ ]: D4 o$ i7 r& `  q! n! i
4 N6 i' I& b) }  p0 k0 a初始化完成之后的操作 建议使用寄存器
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的注释。
: P1 S0 n% ?' S2) Resource management.
- S" L0 ^! V8 m* g0 h. p. z9 O% Z*    In this usage scenario the count value indicates the number of resources/ F0 ^$ Y$ }9 T, H
*    available.  To obtain control of a resource a task must first obtain a
& F! L& I, O2 ~' y( U4 |9 A *    semaphore - decrementing the semaphore count value.  When the count value
+ g- q" T2 w8 a6 l *    reaches zero there are no free resources.  When a task finishes with the
. y' O$ A. }# Q2 s  `% `7 k *    resource it 'gives' the semaphore back - incrementing the semaphore count
6 q' y4 |) Y. h. g4 W, ? *    value.  In this case it is desirable for the initial count value to be; P4 x: U& o" }
*    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
刚刚贴的代码怎么不见了?再贴一遍头文件中的注释,很明了:$ h, t0 _: W2 p+ w2 v2 X
* Counting semaphores are typically used for two things:0 x( C1 K; D! U5 H  J# w
*2 ~8 F5 u- R5 |$ B
* 1) Counting events.
. F+ P/ \( L  z5 j4 R- y$ ?, ~ *
$ g- Q( Z1 A2 Q0 F  d7 } *    In this usage scenario an event handler will 'give' a semaphore each time# G- v* [  k3 W0 ^" r
*    an event occurs (incrementing the semaphore count value), and a handler0 ?6 s* \2 w" ~+ P3 A+ H& e
*    task will 'take' a semaphore each time it processes an event1 [  r3 @2 |9 F
*    (decrementing the semaphore count value).  The count value is therefore6 }' g$ \  I; J, I3 _2 H  D* [
*    the difference between the number of events that have occurred and the3 b. h. r4 C6 k% Z: P  U
*    number that have been processed.  In this case it is desirable for the- _& c) D8 T4 V2 Q: B
*    initial count value to be zero.! r6 q% N/ Y/ d0 H
*: t9 |( J- F0 _2 i
* 2) Resource management.- Q) Q6 L2 K- K- p5 V% E* ~+ @+ W
*/ W# C$ _3 K3 ~3 S8 d
*    In this usage scenario the count value indicates the number of resources
6 V' O6 I: _2 [# w4 u) u( E *    available.  To obtain control of a resource a task must first obtain a- C8 O& y' y5 T3 Y5 p
*    semaphore - decrementing the semaphore count value.  When the count value
9 i' g- A" z5 T; f- u7 N *    reaches zero there are no free resources.  When a task finishes with the: S* g" \. w% x# {
*    resource it 'gives' the semaphore back - incrementing the semaphore count
- Y2 @$ K( k% X& R+ Z8 R8 b *    value.  In this case it is desirable for the initial count value to be+ H7 o7 g0 u, G" U' N0 t- I6 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! b, H% r& }- ?! f" A! ~
这种用法应该是先take,再give回去。而不是像第一种用法(也就是楼主说的常用用法)那样,需要先give,然后 ...

2 n. z& O) K4 k' g$ k  R是的  因为我的 资源一开始是不可用的  ) ^% ]1 ]1 n& r  ]" f
5 q% i* ^! T8 [  O/ A2 ]! M$ H: ^
这是典型的 生产消费问题
; g7 C7 p( s! O/ U5 K6 ?$ C; ?& i% P# u$ H# Z4 J" I
串口接收数据(生产) . Y' T7 Y6 w# D9 y
: u9 U3 m0 ~! e' A$ _  Q# f; }
线程消费数据  9 ]  q1 ]- r! B% a' Z
8 U: Z: e, q7 [% U* i
一开始是没有现成的数据的
  B# A+ I+ I$ D4 H( O! T  a6 c8 O! `# C- w$ b' J8 y
而这个 函数接口  只能以另一种方式使用那就是一开始就存在资源,这在实际使用中是不合理的!!
serge 回答时间:2015-1-8 21:50:06
支持楼主,留下记号,还能拿钱
lovewyufeng 回答时间:2015-1-9 08:38:07
serge 发表于 2015-1-8 21:50
8 N/ W# B9 A/ O3 z  Y支持楼主,留下记号,还能拿钱

: l' R) J. j, T% l2 b' G% q3 T哈哈 你来晚了钱都被他们拿完了~~
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 手机版