Skip to content

Adc3 support#9594

Open
ElDominio wants to merge 5 commits into
rusefi:masterfrom
ElDominio:adc3-support
Open

Adc3 support#9594
ElDominio wants to merge 5 commits into
rusefi:masterfrom
ElDominio:adc3-support

Conversation

@ElDominio

Copy link
Copy Markdown
Collaborator

this adds support to have mux channels on adc3, since my s550 board was made with PF analog inputs on STM32F7, and they are muxed. I have tested this on the board and the mux inputs work

actions-user and others added 4 commits May 2, 2026 06:54
Enables ADC3 as a second slow ADC bank on STM32F7 (and similar) targets
that define ADC3_SLOW_CHANNEL_COUNT. Adds background-mode callback
(slowAdc3EndCB), updates the state machine to interleave ADC3 primary
and muxed passes alongside ADC1, and introduces ADC_MUX_PIN_INVERTED
to support boards where the mux select polarity is reversed.

SLOW_ADC_CHANNEL_COUNT in adc_onchip_slow.cpp is updated to account
for the extra ADC3 primary + muxed channels when the macro is defined.
EFI_ADC_40+ comment clarified to reflect muxed ADC3 usage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rusefillc

Copy link
Copy Markdown
Contributor

unable to merge

image

maybe because of your choices

image

@rusefillc

Copy link
Copy Markdown
Contributor

why is this here

image

@rusefillc rusefillc requested a review from dron0gus May 30, 2026 02:01
#endif

#ifdef ADC3_SLOW_CHANNEL_COUNT
static void slowAdc3EndCB(ADCDriver *adcp) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance to use same slowAdcEndCB for both ADC?
So whole state machine will be in one place easy to read and maintain.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will be implementing this and testing to see if nothing breaks

@rusefillc

Copy link
Copy Markdown
Contributor

poke @ElDominio

@ElDominio

Copy link
Copy Markdown
Collaborator Author

Have not been able to go to shop, should be tested tomorrow

@ElDominio

Copy link
Copy Markdown
Collaborator Author

Tested in car, working for adc channels on adc3

@rusefillc

Copy link
Copy Markdown
Contributor

@ElDominio can you attempt a (new?) clean PR without libfirmware and merge commits?

@ElDominio

Copy link
Copy Markdown
Collaborator Author

will be happening today!

@ElDominio ElDominio closed this Jun 5, 2026
@rusefillc rusefillc reopened this Jun 5, 2026
@rusefillc

Copy link
Copy Markdown
Contributor

let's keep this one open until a better one exists, just in case?

@ElDominio

Copy link
Copy Markdown
Collaborator Author

exploded on proteus_f4 and 8chan f4; master is doing this too; what is the course of action? in my locals i have set 8chan f4 to not comple inis or wideband firmware on board because space

@rusefillc

Copy link
Copy Markdown
Contributor

@ElDominio can you attempt a (new?) clean PR without libfirmware and merge commits?

@ElDominio

Copy link
Copy Markdown
Collaborator Author

I was going to PR, but I got a hunch that something was still up, and talking with my new buddy Antigravity sort of confirmed something. I had not taken time to consider that if we enable ADC3 muxing, the system could possibly also try to mux ADC1. Antigravity said
"If you enable muxing for ADC3 by defining ADC_MUX_PIN , ADC1 will still be forced to perform a second set of
conversions in the muxed state. It will not mess up your physical ADC1 readings, but it will consume extra CPU/DMA
bandwidth to sample the un-multiplexed ADC1 pins a second time."

so i will be trying to debug this before PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants