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!
Solved! Go to Solution.
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!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Please check the below threads
K60 and MQX installed ISR not called, why?
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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.
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Sol
thanks!
walle