Avoid one special routine optimization

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

Avoid one special routine optimization

ソリューションへジャンプ
1,306件の閲覧回数
fanziyu
Contributor IV

S32K144

S32 Design for Arm 2.2

Optimization Level (-O1)

After the Hall signal A is detected by the input capture function, it waits for about 6us before going to collect Hall signal B. I used a FOR loop to produce this 6us, so how do I prevent the compiler from optimizing away this FOR loop?

for(i=0; i<65535;i++)

{...}

0 件の賞賛
返信
1 解決策
1,278件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Yes, I have found it in certain presentation used following way:

davidtosenovjan_0-1704446616111.png

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,279件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Yes, I have found it in certain presentation used following way:

davidtosenovjan_0-1704446616111.png

 

0 件の賞賛
返信
1,296件の閲覧回数
fanziyu
Contributor IV

fanziyu_0-1704420071476.png

This method works well in S32K144 S32DS, is it theoretically applicable?

0 件の賞賛
返信