AnsweredAssumed Answered

how to use to event task synchronization in ISR

Question asked by walle li on Feb 9, 2015
Latest reply on Feb 23, 2015 by walle li

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!

Outcomes