Events in ADC demo for MQX

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

Events in ADC demo for MQX

1,168 Views
anguel
Contributor V

Hi!

When I open the ADC example from MQX I see that ADC channel #1 is configured to use LW Events. But when I look at the code it seems to do only dumb polling by calling read() in an endless for loop. The code after the loop that actually seems to block until the event occurs is never reached...

Why is that?

Anguel

Tags (3)
5 Replies

667 Views
b35930
Contributor I

It is just a demo for how to use ADC module, so, sometimes, the return value of read is not the IO_ERROR. Please refer to the attachment for an example, which is waiting for the event occurring.

0 Kudos

667 Views
anguel
Contributor V

Hua Feng,

Thanks for the file, I will check it. On the other hand I think that a demo shipped with an OS as reference which defines events at the beginning should also make some use of these events.

What do you mean by:

sometimes, the return value of read is not the IO_ERROR

I don't understand this?

Regards,

Anguel

0 Kudos

667 Views
b35930
Contributor I

Hi, Anguel

      Sorry for that it is a typo. it should be "sometimes, the return value of read is the IO_ERROR", please refer to mqx\source\fio\io_read.c file for the _io_read() member fucntion. If you try to debug the default ADC demo project, in for() loop

         for(i = 0; ; i++)

         {
            ......

            if (read(f_ch1, &data, sizeof(data) ))

                 printf("ADC ch 1: %4d ", data.result);

            else

                 printf("               ");

            .......

         }

sometimes, printf("                   "); is excuted.

have a nice day

fenghua

0 Kudos

667 Views
c0170
Senior Contributor III

Hello anguel,

I will report it, we will take a look into ADC example. Thank you for sharing !

Regards,

c0170

667 Views
anguel
Contributor V

Martin,

Thank you for taking care of this. Unfortunately, when even the standard demos coming with MQX and the Freescale boards do not work at all or are not documented well this is very frustrating for new customers and it makes them move away to other manufacturers who have done their homework. I really have the impression that some of the demos are not finished and have not been tested at all. And we are talking about ADC and MQX version 4. Sorry, but customer's time is not for free to bugfix demos and to read or look for undocumented board errata.

Some similar problems I encountered so far:

MQX 4.0 ADC demo does not work on KWIKSTIK

Cannot import KwikStik MQX demo into CW 10.3


I hope for improvement. My recommendation: At least get some students to test the demos if they work as expected. This will save you questions and will keep customers. Feel free to forward this to your managers.

Regards,

Anguel

0 Kudos