Skip to content

Conversation

@gemenerik
Copy link
Member

@gemenerik gemenerik commented Dec 9, 2025

Enhanced the production self-test for Color LED decks with programmatically-readable test results and integrating LED position verification inside deck self test:

  • Test I2C_ADDRESS pin on Color LED deck connectivity by toggling it LOW/HIGH and verifying the deck MCU reads the correct state via I2C command. Ensures proper signal routing during production testing.
  • Added deckTest param group with bitmap test results for both decks (bit 0: protocol version, bit 1: LED position, bit 2: I2C address pin)
  • Replaced pollLedPosition() with verifyLedPosition() that checks LED is mounted on correct PCB side (bottom/top) and fails test on mismatch
  • Added LED position constants matching deck firmware values (NONE=0x00, BOTTOM=0x01, TOP=0x02)
  • Removed LED position from log groups (now verified during self test only)
  • Added debug output for test failures

Requires:

Test I2C_ADDRESS pin on Color LED deck connectivity by toggling it LOW/HIGH and verifying the deck MCU reads the correct state via I2C command. Ensures proper signal routing during production testing.
…led test results

Enhanced the production self-test for Color LED decks with programmatically-readable test results and integrating LED position verification inside deck self test:

- Added deckTest param group with bitmap test results for both decks (bit 0: protocol version, bit 1: LED position, bit 2: I2C address pin)
- Replaced pollLedPosition() with verifyLedPosition() that checks LED is mounted on correct PCB side (bottom/top) and fails test on mismatch
- Added LED position constants matching deck firmware values (NONE=0x00, BOTTOM=0x01, TOP=0x02)
- Removed LED position from log groups (now verified during self test only)
- Added comprehensive debug output for all test failures

This enables automated production testing to detect hardware assembly errors like LEDs mounted on wrong side.
uint8_t actualPosition = response[1];
ctx->ledPosition = actualPosition;

const char* expectedStr = (expectedPosition == COLORLED_LED_POS_BOTTOM) ? "BOTTOM" : "TOP";
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be only used for debug printing, what about putting it inside an #ifdef DEBUG and inside the if so it's only used if the comparison fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is important info to print, but we only need to (and do) in case of failure, so I moved constructing the string inside the failure case

Copy link
Member

@evoggy evoggy left a comment

Choose a reason for hiding this comment

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

Looks good!

@gemenerik gemenerik merged commit d406d60 into master Dec 9, 2025
25 checks passed
@gemenerik gemenerik deleted the rik/i2caddrtest branch December 9, 2025 15:08
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.

3 participants