MQX Kinetis disable all IRQ

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

MQX Kinetis disable all IRQ

ソリューションへジャンプ
1,043件の閲覧回数
GudeADS
Contributor III

Hi,

I want to disable all IRQ on K64 for a short time. I found the following statement: "To disable all interrupts, use psp function cortex_int_disable in file cortex.c." But I cannot find a function cortex_int_disable(). Has anybody an idea?

Best Regards

0 件の賞賛
返信
1 解決策
679件の閲覧回数
soledad
NXP Employee
NXP Employee

HI Andeas,

You can use the _int_enable() and  _int_disable() functions, these functions enable and disable ALL interrupts EXCEPT NON MASKABLE interrupts becuase it is not possible to disable this type of interrupts.

These functions are defined in the mqx.h file, in addition you can find more information in Freescale MQX™RTOS Reference Manual(page 60), this manual is located at the path: C:\Freescale\Freescale_MQX_4_1\doc\mqx

Below you can find an example.

#include mqx_prv.h

#define WAIT_BLOCKED 0xF1

Restart(_task_id tid)

{

    TD_STRUCT_PTR td_ptr = _task_get_td(tid);

    _int_disable();

    if ((td_ptr != NULL) && (td_ptr->STATE == WAIT_BLOCKED)){

          _task_ready(td_ptr);

          }

    _int_enable();

}

Wait()

{

    TD_STRUCT_PTR td_ptr = _task_get_td(_task_get_id());

    _int_disable();

    td_ptr->STATE = WAIT_BLOCKED;

    _task_block();

    _int_enable();

}


Have a great day,
Sol
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
680件の閲覧回数
soledad
NXP Employee
NXP Employee

HI Andeas,

You can use the _int_enable() and  _int_disable() functions, these functions enable and disable ALL interrupts EXCEPT NON MASKABLE interrupts becuase it is not possible to disable this type of interrupts.

These functions are defined in the mqx.h file, in addition you can find more information in Freescale MQX™RTOS Reference Manual(page 60), this manual is located at the path: C:\Freescale\Freescale_MQX_4_1\doc\mqx

Below you can find an example.

#include mqx_prv.h

#define WAIT_BLOCKED 0xF1

Restart(_task_id tid)

{

    TD_STRUCT_PTR td_ptr = _task_get_td(tid);

    _int_disable();

    if ((td_ptr != NULL) && (td_ptr->STATE == WAIT_BLOCKED)){

          _task_ready(td_ptr);

          }

    _int_enable();

}

Wait()

{

    TD_STRUCT_PTR td_ptr = _task_get_td(_task_get_id());

    _int_disable();

    td_ptr->STATE = WAIT_BLOCKED;

    _task_block();

    _int_enable();

}


Have a great day,
Sol
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信