how to use to event task synchronization in ISR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to use to event task synchronization in ISR

Jump to solution
995 Views
WALL-E
Contributor I

I add mydac driver in ...mqx\source\io, I use interrupt when the dac read point is in the buffer of top,

// isr code

void _mydac_int_isr(void * param_ptr)

{

  void * event_ptr;

  if (_event_open("event.global", &event_ptr) != MQX_OK) {

  _event_set(cfg_data_ptr->event_ptr, 0x01);

    }

    

}

void main_task

    (

        uint32_t initial_data

    )

{

   

    _mqx_int result;   

    /* Set up an event group */

   if (_event_create("event.global") != MQX_OK) {

      printf("\nMake event failed");

      _task_block();

   }

   if (_event_open("event.global", &dac_buf_task_data.EVENT_PTR) != MQX_OK) {

      printf("\nOpen event failed");

      _task_block();

   }

   

    _mqx_int load_dac_buf_task_id = _task_create(0,

                                                 LOAD_DAC_BUF_TASK,

                                                 0);

    if (load_dac_buf_task_id == MQX_NULL_TASK_ID) {

        printf ("\n Could not create load_dac_buffer_task\n");

    }   

   

   

    while(1)

    {        

        _time_delay(1000);       

    }

}

//in my task

void load_dac_buffer_task(uint32_t param)

{

    void * event_ptr;

    if (_event_open("event.global", &event_ptr) != MQX_OK) {

      printf("\nOpen event failed");

      _task_block();

   }

    while(1)

    {

        if (_event_wait_any(event_ptr, 0x01, 0) != MQX_OK){

            printf("\nEvent Wait failed");

            _task_block();

        }

    }

}

I debug ,the ISR _event_set successed, but the _event_wait_any is not responseed!why?

Please tell me How to do it, thanks!

0 Kudos
1 Solution
636 Views
soledad
NXP Employee
NXP Employee

Hello walle,

Please check the example attached,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
636 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the below threads

Re: lwgpio interrupt problem

K60 and MQX installed ISR not called, why?

MQX application ISR help


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
636 Views
WALL-E
Contributor I

Hi Sol .

       thanks for your help, by the way , can you give me so demo that is ISR _event_set() a event ,and another task is _event_wait_any(). I try do it,but ,the task always wait.thanks agin!

     walle.

0 Kudos
637 Views
soledad
NXP Employee
NXP Employee

Hello walle,

Please check the example attached,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
636 Views
WALL-E
Contributor I

Hi Sol

      thanks!

walle

0 Kudos