Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

efc: Avoid repeated afe_adc_spis in Shuttler IO#2921

Open
atseml wants to merge 1 commit into
m-labs:masterfrom
atseml:push-lxvzunxwqykq
Open

efc: Avoid repeated afe_adc_spis in Shuttler IO#2921
atseml wants to merge 1 commit into
m-labs:masterfrom
atseml:push-lxvzunxwqykq

Conversation

@atseml

@atseml atseml commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Having repeated afe_adc_spi entries for disparate Shuttler AFE HW revs caused the ADC SPI communication of Shuttler AFE v1.3 to be incoherent, and it seemed to behave the same regardless of the specified Shuttler AFE HW rev.

@sbourdeauducq

sbourdeauducq commented Dec 5, 2025

Copy link
Copy Markdown
Member

I see another bug: the AFE I/O is appended to the global list every time EfcShuttler is instantiated, so the global list accumulates them.

shuttler_io.append(afe_adc_io)

I suggest:
(1) capitalizing the names of global variables to clearly mark them as such
(2) either:

shuttler_io = SHUTTLER_IO + afe_adc_io

or, simply:

platform.add_extension(afe_adc_io)

This bug is silent right now since the class is only instantiated once per Python process, but it's certainly not best practices and could cause confusion in future use cases.

@atseml

atseml commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

(2) either:

shuttler_io = SHUTTLER_IO + afe_adc_io

or, simply:

platform.add_extension(afe_adc_io)

These will require wrapping afe_adc_io in a list to work. I went one step further though and just defined shuttler_io_afe_pre_v1_3 and shuttler_io_afe_v1_3 (deduplicated of course with shuttler_io -> shuttler_io_common) since I believe that's cleaner.

For (1) all Python global constants will be capitalized in a separate PR since that's going to be a repo-wide change.

@atseml atseml changed the title efc: Remove redundant afe_adc_spi from Shuttler IO efc: Avoid duplicate afe_adc_spis in Shuttler IO Dec 12, 2025
@atseml atseml changed the title efc: Avoid duplicate afe_adc_spis in Shuttler IO efc: Avoid repeated afe_adc_spis in Shuttler IO Dec 12, 2025
@atseml atseml force-pushed the push-lxvzunxwqykq branch 2 times, most recently from b736cf0 to 529419d Compare December 12, 2025 07:30
Having repeated `afe_adc_spi` entries of disparate Shuttler AFE HW
revs caused the ADC SPI communication of Shuttler AFE v1.3 to be
incoherent, and it seemed to behave the same regardless of the
specified Shuttler AFE HW rev.

Co-authored-by: occheung <dc@m-labs.hk>
@atseml

atseml commented Dec 12, 2025

Copy link
Copy Markdown
Contributor Author

Force-pushes re: metadata like commit message changes and authorship.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants