Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the LED driver’s pin mapping for segment J to use the correct microcontroller pin so the display multiplexing works as intended. Class diagram for updated LED pin mapping in leddrvclassDiagram
class pindesc_t {
char port
int pin
}
class LEDDriver {
+pindesc_t led_pins[LED_PINCOUNT]
}
LEDDriver "1" o-- "*" pindesc_t : uses
class SegmentJMapping {
+char port = B
+int pin = 17
}
SegmentJMapping --|> pindesc_t : conforms_to
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
… actually correct for a MicroUSB Board (which we don't have docs for)
|
Implementing this pull request seems to mess up some lines on my USBC badge. |
Could you elaborate? The lines are messed up as is with the current implementation. The fix does work with the badges that were handed out to us during 39C3 - as long as you provide |
|
Is it okay to use the USBC_VERSION Flag to distinguish these variants? In this other PR #117 the same Flag is used to distinguish between the USBC and MicroUSB Version. As far as I know, the currently sold version is already USBC but may use other Pins than the new hardware version |
It's an educated guess to be honest, I added it in the following commit which kind of elaborates on the rationale: It seems that the MicroUSB version was more popular back in the time, and the display did seem to work based on the video that is contained within the README.md file (link). Our assumption therefore was that perhaps the pin definition was different for MicroUSB boards, and it worked just fine there, but it's not the case for the USB-C version - hence why we added these defensive programming techniques (big words for an if condition) If I had access to the MicroUSB PCB schema (or hardware in its' physical form) then I could confirm the above-mentioned with a higher degree of certainty.
I wasn't aware there are two USB-C versions of the board - I thought the original one was the one that was just a market-ready PCB, rather than a custom-tailored PCB (open hardware)? |
|
@epi0n Before applying your patch, my screen is fine, I have set the USBC_VERSION = 1 in the makefile and everything is great. After applying your patch, two lines on my screens are switched it seems. Maybe there are multiple usbc versions? |
|
I tried this patch on the new open hardware version https://github.com/fossasia/badgemagic-hardware/tree/main I got handed by the friendly people on the 39c3 ;-). It works perfectly fine when USBC_VERSION = 1 is set for building it. But there are indeed 2 USBC Version PCBs out there. I bought another one (older USBC Version) on the 39c3. Please see them in comparison here: The upper one is the new generation (ng) variant which is the open hardware one found in the other github repository. The lower one is the one sold everywhere on the 39c3 with USBC, too. But this one still uses the old hardware pins for the LED matrix. To sum up, I think there are actually 3 versions out in the field:
I would sugget adding another build flag Maybe there is anybody at fossasia who knows more about the different hardware variants out there? |

Contrib shared with @michal-raczkowski - joint work during 39c3 :)
The fix turned out to be simple and consists of correcting pin numbering in the code so that the multiplexing logic works as expected.
20251230_193802.mp4