Part Number: MSP432P4111
Hi,
I'm continous sampling ADC values and get an interrupt all 1000 samples. These samples I am sending from the ISR via queue. To do this I have two variants:
1. Send the data via queue:
- Dereferencing the completedADCBuffer in the xQueueSendFromISR() with a "*" fails: error #169: argument of type "void" is incompatible with parameter of type "const void *const"
- Normally I avoid this variant because of data coping in the ISR
int main(void) { . . . /* Configure the conversion struct */ continuousConversion.arg = NULL; continuousConversion.adcChannel = Board_ADCBUF0CHANNEL1; continuousConversion.sampleBuffer = sampleBufferOne; continuousConversion.sampleBufferTwo = sampleBufferTwo; continuousConversion.samplesRequestedCount = ADCBUFFERSIZE; xQueueADC = xQueueCreate( 10, 1000 * 2);// uint16_t => 2 byte unsigned integer . . . } void adcBufCallback(ADCBuf_Handle handle, ADCBuf_Conversion *conversion, void *completedADCBuffer, uint32_t completedChannel) { if( xQueueADC != 0 ) { BaseType_t xHigherPriorityTaskWoken; xHigherPriorityTaskWoken = pdFALSE; xQueueSendFromISR( xQueueADC, *completedADCBuffer, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) { portYIELD_FROM_ISR (xHigherPriorityTaskWoken); } } }
2. Send only the data pointer via queue but with more ADC sampleBuffer:
- Is this possible to increase the number of sampleBuffer to 10? I think it needs more than only editing the conversion struct !?
- Is the xQueueCreate() correct?
int main(void) { . . . /* Configure the conversion struct */ continuousConversion.arg = NULL; continuousConversion.adcChannel = Board_ADCBUF0CHANNEL1; continuousConversion.sampleBuffer1 = sampleBuffer1; continuousConversion.sampleBuffer2 = sampleBuffer2; continuousConversion.sampleBuffer3 = sampleBuffer3; . . . continuousConversion.sampleBuffer10 = sampleBuffer10; continuousConversion.samplesRequestedCount = ADCBUFFERSIZE; xQueueADC = xQueueCreate( 10, sizeof(uint16_t ADCBuf[1000] *));// uint16_t => 2 byte unsigned integer . . . } void adcBufCallback(ADCBuf_Handle handle, ADCBuf_Conversion *conversion, void *completedADCBuffer, uint32_t completedChannel) { if( xQueueADC != 0 ) { BaseType_t xHigherPriorityTaskWoken; xHigherPriorityTaskWoken = pdFALSE; xQueueSendFromISR( xQueueADC, completedADCBuffer, &xHigherPriorityTaskWoken ); if( xHigherPriorityTaskWoken ) { portYIELD_FROM_ISR (xHigherPriorityTaskWoken); } } }
I would be glad if someone could give me an advice.
Thanks