Cortex-M0 Atomic/integral access

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Cortex-M0 Atomic/integral access

1,245件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JoWi on Wed May 14 01:02:13 MST 2014
Hi.
I am currently mirgrating from 8051 to M0.

For simple IRQ<->UserSoftware comunication the 8051 had 1-bit flags. What is the smallest way (without disabling IRQs) to replace this on the M0 or do I have to use 32-bit ints?

Thanks, Jo
0 件の賞賛
返信
3 返答(返信)

1,018件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rocketdawg on Wed May 14 09:26:53 MST 2014
variable access may not be atomic and M0 do not have bit band
start some where near here
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHBIHDF.html
0 件の賞賛
返信

1,018件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JoWi on Wed May 14 06:44:57 MST 2014
Ok, Thx ;-)
0 件の賞賛
返信

1,018件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed May 14 05:45:58 MST 2014
You might use any 8bit, 16bit or 32bit memory location to replace "flag bits".

Do not use C bitfields!

Don't forget to add the "volatile" keyword if you want interrupt communication!


volatile unsigned char/short/int this_is_a_flag;

0 件の賞賛
返信