<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with events using demo hvac for M52259EVB. in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196323#M4075</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with hvac_demo in my M52259EVB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a idea to add a extra event and a new task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I program the new task correctly(TASK_A), and one event to managment any aplication.&lt;/P&gt;&lt;P&gt;I can create the event.&lt;/P&gt;&lt;P&gt;I can open a pointer to set this event from TASK_B. All is right.&lt;/P&gt;&lt;P&gt;But, from TASK_C, I can open pointer and set event, but it does not cause any change in TASK_A. I use the debug aplication, and I can see how the pointer open in TASK_B have a different value with regard to pointer opern in TASK_C.&lt;/P&gt;&lt;P&gt;All can be due to demo program, my eval-license or MQX 3.2 have a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need the code, said me and I will put it.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jul 2009 17:24:42 GMT</pubDate>
    <dc:creator>d_vara</dc:creator>
    <dc:date>2009-07-03T17:24:42Z</dc:date>
    <item>
      <title>Problem with events using demo hvac for M52259EVB.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196323#M4075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working with hvac_demo in my M52259EVB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a idea to add a extra event and a new task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I program the new task correctly(TASK_A), and one event to managment any aplication.&lt;/P&gt;&lt;P&gt;I can create the event.&lt;/P&gt;&lt;P&gt;I can open a pointer to set this event from TASK_B. All is right.&lt;/P&gt;&lt;P&gt;But, from TASK_C, I can open pointer and set event, but it does not cause any change in TASK_A. I use the debug aplication, and I can see how the pointer open in TASK_B have a different value with regard to pointer opern in TASK_C.&lt;/P&gt;&lt;P&gt;All can be due to demo program, my eval-license or MQX 3.2 have a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need the code, said me and I will put it.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 17:24:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196323#M4075</guid>
      <dc:creator>d_vara</dc:creator>
      <dc:date>2009-07-03T17:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with events using demo hvac for M52259EVB.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196324#M4076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you looked at the event or lwevent examples in the mqx\examples directory?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that does not help, post your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2009 19:40:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196324#M4076</guid>
      <dc:creator>EAI</dc:creator>
      <dc:date>2009-07-03T19:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with events using demo hvac for M52259EVB.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196325#M4077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, my program have 3 task and 2 events.&lt;/P&gt;&lt;P&gt;The first task is "task_shell".&lt;/P&gt;&lt;P&gt;Second task is "task_adc", that manages the eight adc channels.&lt;/P&gt;&lt;P&gt;And&amp;nbsp; third task is "task_supervise", that manages input datas from eight adc channels, and create log files in USB mass storage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first event is "event.adc", that connect the three task.&lt;/P&gt;&lt;P&gt;And the second event is "event.supervise", that connect "task_shell" with "task_shell".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is "task_adc" :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void adc_task(uint_32 initial_data)
{

 ADC_RESULT_STRUCT data;
 FILE_PTR  f,fadc, fadc0, fadc1, fadc2, fadc3, fadc4, fadc5, fadc6, fadc7;
    //para manejar los canales
    int canal,accion;
    int prueba_mensaje;
    pointer event_ptr;



   
    //inicializa el adc
    printf("\n\n-------------- Begin ADC  --------------\n\n");
    printf("Inicializando dispositivo adc....");
    f = fopen("adc:",&amp;amp;adc_init);
    if(f != NULL)
    {   
        printf("OK.\n");
    }
    else
    {   
        printf("Fallo en la inicialización del dispositivo adc.\n");
        _task_block();//bloqueamos la tarea en caso de fallo.
        fclose(f);
 }

 //arrancamos los punteros a los ficheros
 for (canal=0;canal!=8;canal++)
 {
  printf("Abriendo canal #%d...",canal);
  switch (canal)
     {
    
  case ADC_SOURCE_AN0: fadc=fopen("adc:0",&amp;amp;adc_channel_param0); 
         fadc0=fadc;
         break;
      case ADC_SOURCE_AN1: fadc = fopen("adc:1",&amp;amp;adc_channel_param1);
         fadc1=fadc;
         break;
      case ADC_SOURCE_AN2: fadc = fopen("adc:2",&amp;amp;adc_channel_param2);
         fadc2=fadc;
         break;
      case ADC_SOURCE_AN3: fadc = fopen("adc:3",&amp;amp;adc_channel_param3);
         fadc3=fadc;
         break;
      case ADC_SOURCE_AN4: fadc = fopen("adc:4",&amp;amp;adc_channel_param4);
         fadc4=fadc;
         break;
      case ADC_SOURCE_AN5: fadc = fopen("adc:5",&amp;amp;adc_channel_param5);
         fadc5=fadc;
         break;
      case ADC_SOURCE_AN6: fadc = fopen("adc:6",&amp;amp;adc_channel_param6);
         fadc6=fadc;
         break;
      case ADC_SOURCE_AN7: fadc = fopen("adc:7",&amp;amp;adc_channel_param7);
         fadc7=fadc;
         break;
     }
     if(fadc != NULL)
     {
      printf("correcto, puntero asociado a canal %d OK.\n",canal);
     }
     else
     {
      printf("error, nose ha podido asociar puntero al canal %d",canal);
     }
 }//del for

 //manejamos las peticiones de lectura de los adc´s
 //consideramos que ésta es la función principal donde crear el evento
 //asi se si intenta leer un canal, no se podrá al no existir el evento.
 //usamos el grupo event.adc
 &lt;FONT color="#00ff00"&gt;
&lt;/FONT&gt; &lt;FONT color="#00ff00"&gt;&lt;FONT color="#008000"&gt;// Creamos y abrimos el evento. //Create and open event.
    if (_event_create_auto_clear("event.adc") != MQX_OK)
     {
  printf("\nMake event failed");
  _mqx_exit(0);
 }
   
  if (_event_open("event.adc", &amp;amp;event_ptr) != MQX_OK)
      {
   printf("\nOpen event failed");
   _mqx_exit(0);
  }
 
  //Entremos en bucle infinito hasta la espera de eventos que soliciten una lectura
 while (TRUE)
  {
  prueba_mensaje=_event_wait_any(event_ptr, 0x03, 0);
  if (prueba_mensaje != MQX_OK)
   {
   printf("\nEvento espera   Wait failed");
   if (prueba_mensaje== EVENT_DELETED) printf("Event delete");
   if (prueba_mensaje== EVENT_INVALID_EVENT) printf("Event INVALID");
   if (prueba_mensaje== EVENT_INVALID_EVENT_HANDLE) printf("Event INVALID HANDLE");
   if (prueba_mensaje== EVENT_WAIT_TIMEOUT) printf("Event time out");
   if (prueba_mensaje== MQX_CANNOT_CALL_FUNCTION_FROM_ISR) printf("MQX fallo de ISR");
  
   
    //_mqx_exit(0);
  }&lt;/FONT&gt;
  &lt;/FONT&gt; 
 
 ................................................
 
   }//del while

}&lt;/PRE&gt;&lt;P&gt;I create and open "event.adc". I use "event.ptr". You can view it in colour green.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the "task_supervise", I create "event.sv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
void supervise_task(uint_32 initial_data)
{
 ...............
 ADC_RESULT_STRUCT data;

    pointer event_ptr1=0;
    pointer event_ptr2=0;
    int prueba_mensaje;
    data.result=VALOR_NO_VALIDO;
   

 //use event.adc

 &lt;FONT color="#008000"&gt;// Creamos y abrimos el evento.//Create and open event.sv
     if (_event_create_auto_clear("event.sv") != MQX_OK)
     {
  printf("\nMake event failed");
  _mqx_exit(0);
 }
    if (_event_open("event.sv", &amp;amp;event_ptr1) != MQX_OK)
     {
  printf("\nOpen event failed");
  _mqx_exit(0);
 }
 //Only open "event.adc"
  if (_event_open("event.adc", &amp;amp;event_ptr2) != MQX_OK) //puntero para el evento del adc
 {
  printf("\nOpen Event failed");
  //_mqx_exit(0);
 }
 //Entremos en bucle infinito hasta la espera de eventos que soliciten una lectura
 while (TRUE)
  {
   if (estado==APAGADO)
  {
    prueba_mensaje=_event_wait_all(event_ptr1, 0x01, 0);
&lt;/FONT&gt;   ............................
.......................................................
 

   }//del while

}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this task, I have two pointer to event, event_ptr1 and event_ptr2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the task_shell, I have another two pointers that open, set and cleart correctly with&amp;nbsp; "event.adc" and "event.sv".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is "even_ptr2" in "task_supervise". I open it (in task_supervise). It does not show error. But it does not set or clear action. I use Debug, and I can see that event_ptr2(of task_supervise) do not point at the same direction of the event: event.ptr(from task_adc).&lt;/P&gt;&lt;P&gt;I think that when I open a event using:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#008000"&gt;if (_event_open("event.adc", &amp;amp;event_ptrx) != MQX_OK)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;event_ptrx point at event "event.adc".&lt;/P&gt;&lt;P&gt;And if I use again&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#008000"&gt;if (_event_open("event.adc", &amp;amp;event_ptr_probe) != MQX_OK)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;event_ptr_probe point at event "event.adc". I think that both have the same direction in their values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I can set "event.adc" from "task_shell", but I don´t it form "task_supervise".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:51:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196325#M4077</guid>
      <dc:creator>d_vara</dc:creator>
      <dc:date>2020-10-29T09:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with events using demo hvac for M52259EVB.</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196326#M4078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I understand it right, you create "auto-clear" event and you are trying to react to it in two separate tasks. But since it is "auto-clear" event, only one task catches it (and then clears it). I think, the order is by default FIFO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;PetrM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2009 15:02:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-events-using-demo-hvac-for-M52259EVB/m-p/196326#M4078</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2009-07-20T15:02:50Z</dc:date>
    </item>
  </channel>
</rss>

