willywortel wrote on Thursday, March 19, 2009:
I use the pic32.
I’ve setup the ADC to capture automatically and store the ADC data during the ADC interrupt in a structure.
This works, no problem.
Now I need the ADC data (structure) available to some variety of tasks. What is the best way to do this?
The tasks do not need the data periodically, more randomly.
Was thinking to use sendQueueFromIsr to send the structure to a queue.
Then i thought to create a function that only peeks and returns a variable from the structure.
So a task that need an information just calls the right function.
But I don’t know if this solution is safe, anyone? Or are there better ways?
This is the data that gets filled during the interrupt and that i need to have available to the other tasks:
xAdcData.usBATT_24 = ADC1BUF0;
xAdcData.usTEMP = ADC1BUF1;
xAdcData.usCURR = ADC1BUF2;