-
Notifications
You must be signed in to change notification settings - Fork 134
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
fix scan mode for STM32F3 #977
fix scan mode for STM32F3 #977
Conversation
587b66c
to
72ee0c7
Compare
8f7bee5
to
9c1233f
Compare
@salkinium I created this PR improving the scan mode that was merged on monday, but it seems like the CI died on me. It made 13/25 tests and never executed the last 12. How can I make it execute the last 12? |
9c1233f
to
e5a579a
Compare
The 25 other CI jobs are guarded behind the |
I don't really know anything about the ADCs, so I'm delegating this to @rleh ;-P |
This Pr basically sets the scan flag on register CR1 and remove the enable and disable scan mode methods, because I figured that if one is adding a channel they are probably meaning scan mode, so would be better to just enable scan mode there silently. |
I'll look into it, give me some (2-3) days... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @victorandrehc,
the F3 devices in the linked reference manual use a completely different ADC driver found in modm/platform/adc/stm32f3
. The driver you changed is for F1, F2, F4, F7, L1 and F37x devices only. The scan mode flag seems to be present in all of them.
I'd be interested what your actual use-case for scan mode is. In my understanding scan mode is only valid when utilizing DMA which the driver does not support yet.
What it does is automatically starting the next conversion after the previous one has been completed. The DMA hardware would be triggered to fetch the conversion result and the next sampling cycle would commence shortly after. It's not recommended to use that mode with interrupts since the latency could be too high and the data register might be invalidated before it is read.
Thus, the F1 reference manual states:
Hi @chris-durand, I will change(eliminate) the reference of the F3 then, I thought it was referring to F303 controllers. |
I would just leave it as is and recommend to close the PR without merging. The scan mode does no harm for now. We can finally sort it when you implement ADC DMA in your next PR. |
The DMA PR is not right yet. But I will create a draft so the progress can be followed. |
This PR removes enableScanMode and disableScanMode methods and incorporate them into addChannel.