hello~!when i see the code of mqx. i see the code follow:

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

hello~!when i see the code of mqx. i see the code follow:

334件の閲覧回数
litao
Contributor I
*(volatile pointer*) kernel_data = (pointer) & _mqx_version_number;
*(volatile pointer*) kernel_data = (pointer) & _mqx_vendor;

does the code equal   follows?

*(volatile pointer*) kernel_data = (pointer) & _mqx_vendor;

the code   *(volatile pointer*) kernel_data = (pointer) & _mqx_version_number;    doesn't used?

上面
两句连着的代码,什么意思,左边的地址是一样的。是不是代表两句话只有最后一句代码是有效的?。求解释?

0 件の賞賛
1 返信

248件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hello Li,

Not certain of your question.

In the mqx.c source code the preceding comment is:

  /* The following assignments are done to force the linker to include

  * the symbols, which are required by TAD.

  * Note that we should use address of the variable so it is not optimized

  * as direct constant assignment when optimization level is high.

  * Note that counter will be immediately reset to zero on the subsequent

  * _mem_zero call. */

I interpret the comment to be a workaround to some issue.

Regards,

David

0 件の賞賛