-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analog Buffer cannot be dynamically allocated on Teensy 4 #54
Comments
Yep - this was a quick and dirty class developed to test out the Teensy4 ADC operations. And so far it only has the ability to set the buffers with the constructor... Would not be hard to add another member like: setBuffers or the like that can be called before init. But if DMAMEM or malloc memory is used will probably need to add code to discard the cache data ... |
Hi, I have check the code and found some items of interest for the Teensy 4. There seems to be some precompiler item regarding double buffer that can be made better:
Please see the code as follows: //============================================================================= #ifndef KINETISL
} else { if (adc_num == 1) { adc->adc[adc_num]->continuousMode(); #ifdef DEBUG_DUMP_DATA if (adc_num == 1) { adc->startContinuous(adc_num); #endif _last_isr_time = micros(); |
I am trying to use dynamically allocated buffers and AnalogBufferDMA, and found the following:
An instantiation of AnalogBufferDMA must be global if two buffers are used for continuous operation, is this correct.
An instantiation of AnalogBufferDMA can be dynamic if one buffer is used for IntervalTimer operation.
The buffers must be global. I tried malloc and new the buffer(s), and they will fill up the first time by the DMA, but will never be filled up again with new data.
I tried using double buffer for IntervalTimer operation, by setting stopOnCompletion(true) after init. But this does not work. I looked through the code and during init some other methods are called other then just setting _stop_on_completion.
The text was updated successfully, but these errors were encountered: