interruptファイルの追記処理が消える

Tip / ログイン to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
TaDa_1980266
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

TimerCounterコンポーネントのinterruptに isr_Timeout1 を追加し、
自動生成された isr_Timeout1.c に #include "xxx.h" を追記しましたが、
しばらくすると Build時に xxx.hの内容が定義されていないという
warning が発生し、isr_Timeout1.cを確認すると #include "xxx.h" が消えていました。

自動生成ファイル(isr_Timeout1.c)への追記内容が消去される原因が分かりますでしょうか?

個人的には isr_Timeout1.cの自動生成後に、何らかの要因で2回目のファイル自動生成処理が走り、
追加した処理が消えてしまったのではないか?と考えております。

0 件の賞賛
1 解決策
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

こんばんは、

Generated_Source 以下のファイルは基本的に generate application を行う度に上書きされてしまいます。

例外的に(私の例では) isr_Timeout.c の isr_Tiemout_interrupt 関数内の

    /* `#START isr_Timeout_Interrupt` */ と書かれている行から

    /* `#END` */ と書かれている行までの間に記述された内容は保存されるようです。

(timer_isr_test_190419B)

=================

CY_ISR(isr_Timeout_Interrupt)

{

    #ifdef isr_Timeout_INTERRUPT_INTERRUPT_CALLBACK

        isr_Timeout_Interrupt_InterruptCallback();

    #endif /* isr_Timeout_INTERRUPT_INTERRUPT_CALLBACK */

    /*  Place your Interrupt code here. */

    /* `#START isr_Timeout_Interrupt` */

#include "Timer.h"

extern volatile int timeout_flag ;

    Timer_ClearInterrupt(Timer_INTR_MASK_TC) ;

    timeout_flag = 1 ;

  

    /* `#END` */

}

=================

また、このように Generated_Source 以下のファイルを触りたくない場合には

ユーザー領域のソース (main.c 等) 内で下記のように記述すると

ユーザーの ISR がデフォルトの ISR の代わりに使用されるようです。

※ 私はもっぱらこちらを使用しています。

(timer_isr_test_190419A)

=====================

CY_ISR(my_timeout_isr)

{

...

}

...

isr_Timer_StartEx(my_timeout_isr) ;

...

=====================

添付は CY8CKIT-044 用のサンプルプロジェクトです。

moto

元の投稿で解決策を見る

0 件の賞賛
22 返答(返信)