Skip to content

🐛Addressible LEDs are broken. #5

@NoahK216

Description

@NoahK216

Referring to purduesigbots/pros#631

Describe the bug
The ADILed device setters appear to be broken in a few ways.

  • ext_adi_led_set_pixel returns the wrong port mutex on L493. It essentially tries to zero-index a port that was already converted to zero-index, since get_ports already transforms the smart port outvalue. As a result, it tries to release a mutex on the port below what the LEDs are actually plugged into. In many cases this can permanently deadlock the user program (from past testing).
  • All other setters have a strange bug where it takes calling them twice, with a delay between calls to properly update the hardware state. The minimum delays between two setter calls seems to be around 70mS.

To Reproduce
This does not work

void initialize() {
  led.set_all(0xFFFFFF);
}

This does not work either

void initialize() {
  led.set_all(0xFFFFFF);
  led.set_all(0xFFFFFF);
}

This does

void initialize() {
  led.set_all(0xFFFFFF);
  pros::delay(70);
  led.set_all(0xFFFFFF);
}

This is likely an SDK bug. Sylib gets around this by updating LEDs in a daemon loop rather than just setting once.

Expected behavior
LEDs should update the first time the setter is called.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows
  • Version 11

Additional context
None

Prerequisites

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedother issues need to be resolved before this can be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions